Jump to content

Rsl Fuctions In Vex Builder


Lutojar

Recommended Posts

Hi I'm starter in VEX :unsure:

try to build simple shader (based on rsl matte)

surface
matte( float Ka=1, Kd=1 )
{
	normal Nf;

	Nf = faceforward(normalize(N),I);

	Oi = Os;
	Ci = Os * Cs * ( Ka*ambient() + Kd*diffuse(Nf) );
}

this shader use functions:

faceforward(), normalize(), ambient(), diffuse() - where can I find implementation of these functions as nodes in VEX-builder

Link to comment
Share on other sites

Thanks a lot!!!! it solve one my problem :notworthy:

and question is open: where in VOPs i can find analogs of RSL functions such as ambient(), diffuse()

I found some items -

normalize() - normalize VOP

faceforward() - Front Face VOP ( <_< is it true?)

p.s.

I don't use Lightning model VOP because i want create it by myself to get more understanding VOP workflow

Link to comment
Share on other sites

VOPs give you the best from these two worlds: easiness of nodes and flexibility of code. Thus not every function of RSL has an implementation in VOPs. Every time you feel like you need more, you can jump in Inline VOP and write a code. Besides that Lighting Model VOP gives you an access to both diffuse() and specular() components nicely packed together.

If you look for a maximum power and flexibility of RSL, code is perhaps the best choice. Many people familiar with programming prefer to write a few lines instead of wiring nodes. Specially in case of many nested loops and "if-then" statements code tends to be more elegant.

cheers,

sy.

Edited by SYmek
Link to comment
Share on other sites

  • 5 months later...
  • 3 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...