PDA

View Full Version : Facing Ratio to X, Y or Z


akewt
08-11-2005, 12:23 PM
hello. i was wondering if its possible to set the facing ratio in the sampleInfo node to use X,Y or Z of local or world space instead the cameras Z? if anyone knows the falloff shader in max or a fresnel type effect that i can control in x,y and z. thats the kinda of thing im going for. i know all about the 'snow shader' but want more functionality than that and the snow shader doesnt seem to work on bump. not sure why. thats irrelavent really.


thanks for you knowledgism.

Digit
08-11-2005, 01:21 PM
What are you trying to achieve? maybe theres another way of doing it...

akewt
08-11-2005, 01:31 PM
i havent actually got anything specific atm but its always something i've needed in the past for shading. there just dosent seem to be a decent fresnel node of shader anywhere.

i think you would say, its the state of a point on any surface which is decided by the surface direction according to either a light, camera, x,y,z or object/locator. whether its perpendicular or parallel.

Pixero
08-11-2005, 02:09 PM
If your using Mentalray I have just the thing for you. :thumbsup:
Take a look at JS_Incidence in the download section of my site.
There is also a short tutorial in the tutorial section.

akewt
08-11-2005, 02:28 PM
hehehehehhehe! thanks pixero. it is exactly what need if im using mental ray (used many times before and is in my shader lib). but im using turtle and need to use maya native nodes.....

is it possible to get light incidence in maya s/w?

Pixero
08-11-2005, 02:43 PM
I´m not in front of Maya at the moment so I cant check, but have you tried the surface luminance node? Not a perfect solution but it gives you the part of an object that is illuminated by a light. Wouldn´t that be the direction toward the light...sort of ?

Jozvex
08-11-2005, 03:28 PM
is it possible to get light incidence in maya s/w?

The Ramp Shader (not the ramp 2d texture) can do that.

I hope Turtle supports the Ramp Shader!!

BillSpradlin
08-11-2005, 08:41 PM
The clearcoat node also has fresnel, not sure if Turtle will suport it or not.

Pixero
08-11-2005, 10:55 PM
Just had to try and found a way with just maya shaders:

http://www.pixero.com/stuff/lightdirection.jpg


Connect:

spotLightShape1.worldMatrix[0] to lightInfo1.worldMatrix
lightInfo1.lightPosition to multiplyDivide.input1
(You could also connect translate of a Locator instead of the lightInfo.)

samplerInfo1.pointObj to multiplyDivide.input2

Here it gets a little tricky to do by hand. Easiest way is to execute these three lines in the script editor:

connectAttr -f multiplyDivide1.outputX plusMinusAverage1.input1D[0];
connectAttr -f multiplyDivide1.outputY plusMinusAverage1.input1D[1];
connectAttr -f multiplyDivide1.outputZ plusMinusAverage1.input1D[2];

plusMinusAverage1.output1D to blender of a blend colors.
Finally connect the blend colors to color of the material shader.

Hope this helps!

Jan

frogspasm
10-09-2005, 07:30 PM
Hi Jan,

I tried rendering your tutorial file for the incindence shader, but I get an error saying:

API 0.0 error 301041: incorrect member "Gain", "JS_Incidence" does not return a struct

This happened in 6.0 and 6.5
Could you think of what would cause that error?

Thanks,

~Mike D.

frogspasm
10-09-2005, 08:20 PM
OK, scratch that.
For some reason in the sample file the JS_Incidence bias was hooked up to the JS_BlendColors Blender value. Don't know how it could have gotten that way. When I break that connection it won't let me connect it back again. I just connected the outValue to the Blender value an it works fine.

~Mike D.

CGTalk Moderation
10-09-2005, 08:20 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.