Announcement

Collapse
No announcement yet.

Using drivers in V-ray shading networks?

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

  • Using drivers in V-ray shading networks?

    I've been using drivers in Cycles shading networks to allow textures to be blended based on the position of empties. I can add a driver (manually create later (single)) to the V-ray User Scalar, but it does not then show up anywhere in the graph editor properties to allow me to configure it - the field turns purple, but I don't seem to have any way to work with it.

    Is this supported? If not, is there a way to query a different object's transforms to allow similar shading to be created in V-ray?

  • #2
    You can try Distance Node:
    Click image for larger version

Name:	bcb072b358.png
Views:	63
Size:	215.3 KB
ID:	1008501
    Win11 Pro 64bit, GTX 970, Standalone version: V-Ray Next 4.30.03,

    Comment


    • #3
      Thanks. Sadly, I was trying to use an absolute world coordinate - i.e. a control for time-of-day to blend images on a skydome, so I'm not sure that distance will work. I couldn't see a way to get transform information from an object - is that possible?

      Comment


      • #4
        That smaller cube on my example is the control object named "cube distance".
        https://docs.chaosgroup.com/display/...RayDistanceTex
        Win11 Pro 64bit, GTX 970, Standalone version: V-Ray Next 4.30.03,

        Comment


        • #5
          Yes, so I don't really want a point-based distance texture effect. What I want to do is take an empty and use its distance to the world origin to affect which images are blended together for the sky texture. For example, if the empty is placed at Z==12, the 12th image is used. If the empty is placed at Z==12.5, a blend of the 12th and 13th image is used (a linear blend is applied). I can do this with drivers (where I can manage the input/output relationship based on Z and an output from 0 to 1) and a mix node in Cycles, for each set of images. I'm missing a path to an equivalent approach in V-ray.

          Comment


          • #6
            Well for now it could be done with multiple distance textures but a bit convoluted. This example will blend colors in this order: Black -> White -> Green -> Red. You can attach your image files to the textures slots instead of hard colors.

            Comment


            • #7
              I'll put an example in the github issue shortly. I think that might better explain what I'm trying to do. The example is setup in Cycles shading network, but should be obvious enough.

              Comment


              • #8
                Here's an example of what I'm trying to do in V-ray. The example is using Cycles. F12 will show the effect as you see the 'time of day' control animated over the 10 frames in Y. Viewport update doesn't always seem reliable in Cycles or texture mode.
                Attached Files

                Comment


                • #9
                  I've added a bit hacky way to evaluate drivers on Python node trees. Builds are uploaded, please, check if this works for you.
                  V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
                  andrei.izrantcev@chaos.com
                  Support Request

                  Comment

                  Working...
                  X