translating a combined surface + displacement shader

   4865   5   1
User Avatar
Member
27 posts
Joined: July 2005
Offline
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?
User Avatar
Member
252 posts
Joined: July 2005
Offline
Renderman now allows you to do displacement in a surface shader, and as far as I know at this time Houdini does not. (Someone please correct me if I am wrong.)

You will have to seperate the displacement code out into a different shader.

-Craig
User Avatar
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.
John Coldrick
User Avatar
Member
941 posts
Joined: July 2005
Offline
JColdrick
That's correct. Actually, the official …

Now get the hell outta here and go enjoy your time off!!
Sheesh! :shock:


Mario Marengo
Senior Developer at Folks VFX [folksvfx.com] in Toronto, Canada.
User Avatar
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”
User Avatar
Member
412 posts
Joined: July 2005
Offline
and you prob wouldn't want to do this, but the texture model vop has a bump map param and file string. you could use that to fake it. wont really be displaced, but it will appear somewhat bumpy. i wouldn't go this route, but maybe it works for you.

hth,
dave
Dave Quirus
  • Quick Links