Announcement

Collapse
No announcement yet.

Not possible to set UV-set for Displacement textures?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Not possible to set UV-set for Displacement textures?

    I can't seem to access the texture applied as a displacement to my shader in the UV relationship editor. I can get round this by applying it to another slot in the shader (ie opacity) but this is less than ideal.
    Is there another way to set the UV-Set for a texture used as discplacement? I couldn't get it to show up in the relationship editor (I thought I could access it by showing the shadingGroup the displacement texture was piped in to).
    Thanks
    p.
    Patrick Macdonald
    Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/




  • #2
    Originally posted by re:FORM View Post
    I can't seem to access the texture applied as a displacement to my shader in the UV relationship editor. I can get round this by applying it to another slot in the shader (ie opacity) but this is less than ideal.
    Is there another way to set the UV-Set for a texture used as discplacement? I couldn't get it to show up in the relationship editor (I thought I could access it by showing the shadingGroup the displacement texture was piped in to).
    Thanks
    p.
    Did you try to add an attribute on your placement2dtexture ?
    www.deex.info

    Comment


    • #3
      No I didn't, I'll have another look tomorrow. I'm pretty sure I had a look for vray attributes to do this, but didn't stumble across anything!
      Thanks again
      p.
      Patrick Macdonald
      Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



      Comment


      • #4
        Aha yes, it's there! UV-Set name.
        Thanks!
        Patrick Macdonald
        Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



        Comment


        • #5
          Maybe I celebrated too soon. I can't seem to get this working.

          I couldn't find anything in the documentation on the "Vray UVSet Name" attribute.
          Does it require simply the UV set name, or the full DAG name giving the node-name too; eg pPlaneShape1|map2

          It's weird though, in a simple scene with a plane with two uv-sets, the attribute works fine. Any ideas what I might be doing that prevents vray from picking up the UV-set correctly?
          Patrick Macdonald
          Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



          Comment


          • #6
            It's just a name, so it should be "map2" without the quotes in your case.

            If you are wondering what set name to use, export to a .vrscene file and see what are the names of the exported UV sets for your mesh. Or if you are using a VRayProxy object, use the ply2vrmesh -info command to see the available UV/color sets.

            Best regards,
            Vlado
            I only act like I know everything, Rogers.

            Comment


            • #7
              Thanks Vlado,
              Ok, I have the right name, but it still isn't working.
              Looking at the vrscene, the uvw-set for the texture also has the right name, as does the names in the 'map_channels_names' for the geo. So, from the vrscene it seems like everything is correct.

              To check I've got everything else setup correctly, when I copy the UVs from map2 to the default map1, the mapping/displacement works correctly.

              The only thing I thought might be related are the tags for the texture :-
              UVWGenMayaPlace2dTexture place2dTexture16 {
              uvw_channel=1;
              uvw_channel_tex=place2dTexture16@uvIndexSwitch;

              If I'm defining the UV set with the attribute "uv_set_name="map2";" the why does the shader also have uvw adjustments defined by the above attributes?

              Maya doesn't even have UVW_channels, so why is this being set? Does the uvw_channel value refer to the index of the uv_set_name within the array of uv-sets?

              Thanks again!
              p.
              Patrick Macdonald
              Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



              Comment


              • #8
                Where this place2dTexture16 is used? It has "uvw_channel_tex" member which means that its used by a material with custom uv linking, not displacement. Or I'm missing something. It will be best if you can send a scene with your setup to the support.
                V-Ray/PhoenixFD for Maya developer

                Comment


                • #9
                  Hi Ivaylo,
                  Thanks for your reply.
                  Yes the texture was also attached to the shader; but only to allow me to try uv-linking. disconnecting the texture from the shader leaves the UVW_channel_tex attribute by the looks of the vrscene. Disconnecting the UV chooser that the uv-set linking tool creates resets the value "uvw_channel=0;" and removes the "UVW_channel_tex" attribute. Doing these two things still does not fix the issue.

                  Unfortunately I can't send you the scene as the internet is completely locked down here, but I can recreate the issue with a simple scene of just a plane and a noise texture placed in a displacement node (displacement as node rather than within the shader) and have provided the steps below for you to recreate.

                  The uv set is respected for "normal displacement" but reverts to the default (uvw channel 1) when the discplacement is set to 2d.
                  Is it not possible to use a 2d procedural texture with 2d displacement? I thought the restriction was only for textures that used world space coordinates (ie 3d textures).

                  To recreate :
                  Create a plane and vray rect light.
                  Edit the plane to have multiple segments (I split using the mesh edit tools).
                  Setup the default UVW channel. (planar fit to UV space) : called "map1"
                  Copy the UV to a new uv set. (called "map2)
                  In the default UV set, open the uv editor, split the uv's and offset slightly so any procedural map will become disjointed.
                  Create a vraymtl.
                  Create a 2d Noise texture.
                  Add a vray uvw-set attribute to the 2d noise texture 2d placement node.
                  Add the name of the second uvset "map2" (the uvset without any seams) to the uvw-set attribute.
                  Select the plane and create a vray displacement.
                  Place the 2dnoise texture in the vray displacement displace slot.
                  In the attribute editor, add a vray attribute for "displacement control"
                  Set the mode to "2d displacement"
                  Render, and then compare with the displacement mode set to normal.

                  Unless I've set things up incorrectly (highly likely), or have misunderstood the limitations of 2d displacement (probably guarenteed!), this looks like it might be bug maybe?

                  Thanks again,
                  p.
                  Patrick Macdonald
                  Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                  Comment


                  • #10
                    Oh, and to add one thing, it's not restricted to procedural maps; using a file node also doesn't respect the uv-set when the displacement is set to 2d displacement.
                    Patrick Macdonald
                    Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                    Comment


                    • #11
                      Looking at the code, I think the 2D displacement is hard-coded to always use the first mapping channel. You can probably use a post-translate Python callback to change the "map_channel" parameter of the GeomDisplacedMesh plugin in the scene to some other number than 0.

                      Best regards,
                      Vlado
                      I only act like I know everything, Rogers.

                      Comment


                      • #12
                        Ah, thanks for that Vlado. I'll give that a go.
                        Patrick Macdonald
                        Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                        Comment


                        • #13
                          Thanks for the steps to reproduce. It really seems like an issue with the 2d displacement. Will investigate what is going wrong.
                          V-Ray/PhoenixFD for Maya developer

                          Comment


                          • #14
                            Originally posted by ivaylo.ivanov View Post
                            Thanks for the steps to reproduce. It really seems like an issue with the 2d displacement. Will investigate what is going wrong.
                            No problem, it was more for my own sanity than anything else!
                            Can you try what Vlado suggested? I tried a PTPS but it didn't work, and the attribute "map_channel" didn't appear in the updated vrscene, so perhaps I'm setting the attribute the wrong way.
                            Thanks
                            p.
                            Patrick Macdonald
                            Lighting TD : http://reformstudios.com Developer of "Mission Control", the spreadsheet editor for 3ds Max http://reformstudios.com/mission-control-for-3ds-max/



                            Comment


                            • #15
                              Here is a scene how to do it using the Python work-around. I think it's working

                              uvset+2d_displacemen.zip
                              V-Ray/PhoenixFD for Maya developer

                              Comment

                              Working...
                              X