View Single Post
# 4 30-07-2008 , 11:39 PM
LauriePriest's Avatar
Moderator
Join Date: May 2003
Location: London
Posts: 1,001
I dont think you understand what the facing ratio is doing to a ramp when you connect it to the v coord.

When rendering, the sampler info node is called to find the angle a point is facing towared the camera. The value it outputs is a float that ranges from 0 to 1.

0 facing away and 1 facing the camera head on. If you where to plug this directly into a channel you get a very obvious resut.
This image is facing ratio dirrectly plugged into the diffuse channel:

user added image

This is all good but it does not offer for control over the values, this is why a ramp is used. Instead of calling upon the sampler info node to provide the value for a rendered point, the ramp is called upon, however instead of using a UV coordinates to decide the value on the ramp, the facing ratio is called.

To have the facing ratio decide which point along the ramp to use just connect the facing ratio into the v choord of a ramp.

This gives you huge control in comparison, as the values that are applied to your channels are decided by you via the ramp.

For example here is a spheres diffused decided by a ramp with its v choord decided by facing ratio:
user added image

Now, lets say i want this effect on my diffuse channel but I dont want to get rid of my fractal texture i have applied to my diffuse:
user added image

To do this we just have to be aware of simple mathematics, by making two images or values interact with eacother we can achieve a result which is the combination of the two, just like with layers in photoshop.

To see how these work just play about with them in photoshop, for this example i will just use the multiplication method using a layer node in maya. All it is doing is multiplying the result from my ramp which is dictated by the facing ratio with that of the fractal.

Here is the result:
user added image

This is where knowing how channels work helps, with a layer node it does not assume that the luminance of your image is the same as your alpha channel which you may find to be the case when you apply a ramps out alpha to any value.

The layer node will assume you want the entire image to be visable, and will automatically assign an alpha of 1 uniformally, (a pure white image) so if you assign your out alpha directly to your diffuse after layering your texture and facing ratio you will just get a result of 1 or white.

To get a good result it is good practice to use an RGB > luminance node to convert your rgb vector information into a luminance float which can be used directly into diffuse etc.

You can naturally use the alpha as luminance attribute on the layered texture but this is not applicable if you want your alpha channel to be different from your luminance and i personally prefer to keep things seperate and visible so i know what i have going on.

Here is the resultant network:
user added image


Last edited by LauriePriest; 31-07-2008 at 01:00 AM.