|
I’m using the sampler info node in the blender slot of a blend colors node and would like to set it up to sample whether faces on an object are facing up or down. Could anyone shed some light?
The result is to use two textures on for the faces pointing up and another for the faces pointing down.
thanks
Adam
|
|
|
|
The sampler info node is correct, but you should use a condition node instead of the blend colors node.
Drag the Sampler Info node onto the Condition node, and open the Connection Editor. Connect the “Flipped Normal” attribute of the Sampler Info to the “First Term” of the Condition.
Open the Condition node in the Attribute Editor. Drag the first texture onto the “Color If True” attribute, and the second texture onto the “Color If False”. Connect the output of the condition node to the color attribute of your shader. This will give you your double-sided shader.
If the textures are on the wrong sides, open the Condition node in the attribute and change the “Operation” from “Equal” to “Not Equal”, and the textures will be reversed.
|
|
|
|
halfstone beat me to the post while I was making this little scene.
I wasn’t quite sure what you meant by facing Up and Down...so I created three different shaders that could address various facing desires.
Just note that the light based shader in the scene used the connected light for direction only not illumination...though you can easily use it for that as well.
Of course with maya there are a million ways to do everything...but hopefully these ideas will help.
All the best.
~Ben
|
|
|
|
Halfstone and Animatedfox thank you both. That is exactly what I was looking for. I looked at the condition node first but thought the sampler node had the same functionality but now it makes sense that I need to tell maya what to do with the info it samples.
Thanks for the scene the middle ball is the winner but its nice to learn how things work. The set up for the facing ratio is cool because of the ramp and the blending. Big thanks
Adam
|
|
|