Jump to content

Help with muli-layered vex shader code


rcortes

Recommended Posts

Hello there. I have a question for those vex shader writers out there.

Im writting a shader and I need to make it mutli-layered (like the one that ships with houdini). How do I go about implementing that in vex code.

my first layer will be applied with a

texture ("layer01.tx",s,t); ## .

how do I apply the second layer? according to the manuals a layer sop will turn s and t into s2 t2.. do i just use those to index my texture,

texture("layer02.tx",s2,t2);

???

your help is greatly appreciated.

RCortes

Link to comment
Share on other sites

If you want to see the vex layered shader's code, right click on the op and choose Type Properties > VEX tab. I'ts all right there.

I understand if must code this, however, it's really straight forward and IMHO

more fun in vops.

Here is an extremely simplified example in vops.

Throw down a lighting model op, then decide what sort of layering operation you wish to do. If you wish to multiply your layers, pipe 2 texture ops to the inputs on a multiply op and send the product out to the diffuse channel of the lighting model.

To add more layers, either plug another texture op into your existing multiply op's input 3; or, pipe the product of your existing multiply op to another multiply's input 1, and pipe your next texture op into input 2. You can keep building up as many texture layers as you wish in this manner. Experiment.

For the s, t on the texture ops, use a param op set to vector 3 and label it uv, this imports the uv info you've placed on your model. The inputs s, t are floats and they won't let you plug in the vector from the param op, so use a vector to float op (conversion) between the output of the param op and the s, t of the texture ops.

Link to comment
Share on other sites

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...