cvex shader and Global Variables

   3652   2   2
User Avatar
Member
383 posts
Joined:
Offline
Hello,

I am trying to make a cvex shader for volume and i would like to know if there is a way to get all the global variable in cvex. For the moment I can only use P ( with a parameter node).
If I try to get another variable I fail …

Thanks for your help

++

Vincent
http://vimeo.com/vbkstudio [vimeo.com]
User Avatar
Staff
2540 posts
Joined: July 2005
Offline
The volume procedural only passes in P and time in to the cvex programme. See the docs here:

http://www.sidefx.com/docs/houdini12.1/nodes/shop/vm_geo_vexvolume [sidefx.com]

This Volume Procedural context runs in isolation of any of the shader calls. Stepping back, the volume procedural constructs ad-hoc volumes that then get passed in to the displacement and shader contexts. The Volume Procedural is run during the stage when Mantra is constructing geometry prior to displacement shader calls and even further down opacity and shading calls.

This means that this Volume cvex programme when run by the volume procedural is unaware of any of the shader attributes/properties.


To answer your question, you can't pass in any shader globals. You have to use other VEX techniques such as inspecting geometry saved to disk (volumes, point clouds, etc.) to query any information about the scene geometry. Note that it is common to construct volume data from point clouds saved to disk either as .bgeo or .pc files.

You can add any export Parameter VOPs of any of the volumes you construct by name in the Volume Procedural cvex context. You can then use Parameter VOPs to pick up these volumes in to the displacement and surface shader networks as volume data.

Remember that if you reference a volume saved to disk in the volume procedural cvex context that this will be an unfiltered look-up of the position within the referenced volume, just incase you try that.
There's at least one school like the old school!
User Avatar
Member
383 posts
Joined:
Offline
hmm ok I see …

thanks for your hi-detailled reply Jeff.

I have another question about Global variables.

I am trying to make a volume shader. I tried to use the Global Variable “ Direction from surface to Light” with a Illuminance Loop. At the first glance it looked good but when I decided to animate the lights, I noticed the render didn't update. I tried to use the global node outside and inside the loop, nothing changes. When I replaced the global variable with a vector parameter it works : if a change the vector value the render reacts.

I don't what happens exactly …


Thanks again for your help

++

Vincent

Attachments:
illLoopVar.jpg (56.5 KB)

http://vimeo.com/vbkstudio [vimeo.com]
  • Quick Links