This should be an easy question for all you veterans out there. I am translating a procedural Renderman shader into VEX as an excercise. I have no experience with either language, but after reading the Houdini docs I think I've written something that looks passably like VEX. But I'm perplexed as to how to translate a combination surface and displacement.
In VEX it seems that the main function is either a surface or a displacement, not both. I could have two nearly identical shaders, one doing the displacement and the other the surface, but this seems computationally expensive. It seems I would want to do this in VOPs, putting my VEX code in a custom operator within a displacement shader and exporting the surface color–one more thing I haven't figured out how to do yet. Any suggestions?
translating a combined surface + displacement shader
4839 5 1- mikela
- Member
- 27 posts
- Joined: July 2005
- Offline
- craiglhoffman
- Member
- 252 posts
- Joined: July 2005
- Offline
- JColdrick
- Member
- 4140 posts
- Joined: July 2005
- Offline
That's correct. Actually, the official renderman spec also asks that you restrict displacements to displacement shaders too - it's just that Pixar in their prman caved to production realities quite some time ago and allowed it since far more often than not, you want your surface shading to reflect the effects of the same code as the displacement. It's “wrong” and less elegant, but it makes for much faster workflow - so instead of having to manage snippets of code between two shaders you do it all in one.
Alas, mantra is “correct”. I'm hoping at some point in the future they may loosen it up and allow disp in surface shaders. I doubt it's like this for any reasons of elegance, though - probably because there is streamlining you could do in the renderpipe knowing that if there's no displacement shader - the geo is effectively “locked”.
Cheers,
J.C.
Alas, mantra is “correct”. I'm hoping at some point in the future they may loosen it up and allow disp in surface shaders. I doubt it's like this for any reasons of elegance, though - probably because there is streamlining you could do in the renderpipe knowing that if there's no displacement shader - the geo is effectively “locked”.
Cheers,
J.C.
John Coldrick
- Mario Marengo
- Member
- 941 posts
- Joined: July 2005
- Offline
- silvina
- Staff
- 181 posts
- Joined: July 2005
- Offline
Not sure if this is what you are looking for…
To export variables from your Displacement Vop Network just
pipe a Parameter Vop and click on the export Tab (taking care, of course, of assigning the correct Parameter Type).
To bring it into your Surface Vop Network, you can use the “Import Displacement Variable Vop”
To export variables from your Displacement Vop Network just
pipe a Parameter Vop and click on the export Tab (taking care, of course, of assigning the correct Parameter Type).
To bring it into your Surface Vop Network, you can use the “Import Displacement Variable Vop”
- deecue
- Member
- 412 posts
- Joined: July 2005
- Offline
-
- Quick Links