Vex shader writing help ?

   4405   3   0
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
As per the help “Transitioning between VEX and RSL” there is one page listing 12 mapping values. Is it a case of the simple RSL listed below will render as a mantra shader after its been compiled ?. I suspect of course not . So where can I find out the differences between RSL and the vex for writing shaders ?

ie


surface
constant_test(float Kfb = 1 /* fake brightness */)
{
color surfcolor = 1;

Oi = Os;

Ci = Oi * Cs * surfcolor * Kfb;
}


r
Gone fishing
User Avatar
Member
320 posts
Joined: Aug. 2007
Offline
You can check the Globals in VOPs for the basic Globals, but some don't match up like “Pz” and “dPdz” are not present in RSL. In order to get “Pz” in RSL you can do this.

point myPz = depth(P);

pPdz fries my brain, so I'll let somebody else tackle that one.

The code below just needs a few Global changes, and the way you assign variables has to be changed.

ex:

surface
constant_test(float Kd = 1;
vector opac = 1)
{
vector Cd = 1;

Of = opac;

Cf = Cd * Kd;
}

I'm learning RSL myself so I could be wrong, but I think checking VOPS and reading the shader code in SHOP nodes helps on the transition.
www.alan-warren.com
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Hey Alan thanks for the reply.I found this in the latest online help

http://www.sidefx.com/docs/houdini9.1/vex/contexts/shading_contexts [sidefx.com] , it should be of some use. If you fancy sharing info let me know

R
Gone fishing
User Avatar
Member
2624 posts
Joined: Aug. 2006
Offline
Well I dont seem to be having much luck with houdini.A simple constant shader works fine in the scene but when I try and re open the scene I get errors.
What is the workflow for creating scripted shaders ?

Attachments:
workflow.JPG (33.8 KB)

Gone fishing
  • Quick Links