rcortes Posted October 13, 2003 Share Posted October 13, 2003 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 Quote Link to comment Share on other sites More sharing options...
Shannon Posted October 14, 2003 Share Posted October 14, 2003 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. Quote Link to comment Share on other sites More sharing options...
rcortes Posted October 14, 2003 Author Share Posted October 14, 2003 Thanks so much... I tried doing it with vex builder and then analyze the code. However I wasn't able to get the param (vector 3 ) to work. Instead I used the "shading layer parameter" node.. it is designed exaclty for uv spaces. Thanks a lot. Rcortes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.