Fresnel node

Thomas M.

New member
Well, it should spit out a number between 0 and 1 (0% -100%) which either is the amount reflected or transmitted. So far IOR from medium A and B and the incidence angle should be the only input parameters I can think of.

Right now I do use Excel to calculate these settings which I then convert into a gradient. Pretty boring and if you need to come up with new calculations it takes 10-15 minutes to set everything up.

It should use the original fresnel equations. From my point this should be super simple to set up for somebody who knows how it works.

Gradients only work with incidence as a input parameter, but that doesn't help at all.

Cheers
Thomas
 

dpont

Member
Have released a Fresnel node beta (Win32):
http://perso.orange.fr/dpont/plugins/nodes/FresnelNode.zip

Fresnel.gif

Not fully tested,
located in "DP Kit/Shaders",
incidence is calculated inside,
Ray vectors are directions for Raytrace function,
but may be inverted, need some feedback.

Regards,
Denis.
 
Last edited:

Thomas M.

New member
Wow! That was quick!

Can't test it right now because I'm rendering like **** to finish some work. But I do have a few questions.

Is there the possibility to set the IOR for both mediums? Sometimes it's not air which is the first medium.

Does it handle total internal reflection (if IORa is bigger than IORb, e.g. water-air) ?

Does it take both s- and p-polarisation into account?

Don't want to be a pain, but if somebody does it I guess it makes sense to make it perfect. I don't want any more fast fresnel-, real fresnel-, quick fresnel-, ... shaders. I guess one is enough.

Thanks for the work already invested. I guess that'll be a really helpful node which will be used everyday. At least here.

Cheers
Thomas
 

dpont

Member
Yes It should be possible to have inside and outside IOR,
this current beta take 1.0 for air (outside).
Yes it take both s- and p-polarisation into account.
This algorithm was originaly designed for water effect,
but need to be more tested with Lightwave.
Hope to make an update soon.

Denis.
 

dpont

Member
Added a note here, that could be discussed:
May be reflection output should not be inverted
like it is in the current beta fresnel node,
But have found some glass material which take
both Transmission & reflection from reflection
output in the equation (inverted for Trans.)
with this comment...
"Physically incorrect, but portable"

Denis.
 

Thomas M.

New member
Hmm, not sure if I understand what you mean. If there is a "non-physical approach", I'd like something like a checkbox to switch between correct and "in-correct" if it's possible. Normaly I would use this node to change opacity in a mixer node, with reflection and refraction as the input. Did you think of something else?
 

vashts

Member
thank you dpont!

can you or someone post an example about how this node works? or an explanation about each node output.. please :help:

vashts
 

dpont

Member
Yes me too,
Not the Fresnel Node itself,
but a node tree with it for glass with
raytrace functions !?
Use the Spot Info to get Object World point position,
and Ray vectors from Fresnel Node, for both reflection (blurry?)
and refraction, use the transmission and reflection scalar
for transparency and reflection, filter also specular and some other things...

Denis
 

vesalius

New member
Denis,
Great work! thank you
Ok I've set up a network that seem to work, but the render is taking forever...
I'm testing your fresnel against the old fashion'd "real-fresnel/IOR/air-polys" setup.
I'm taking advantage of the "polygon-side" feature to get rid of those air polys, in the node version.

Anyway, i dont understand what you mean by "Object World point position,
and Ray vectors from Fresnel Node, for both reflection.."
 

vesalius

New member
Ok, here are the renders.

left thing is node-made with the Fresnel node.
To the right is the classic flipped-air-polys/Real-Fresnel.
The air polys are displaced 10um to avoid artifacts.
The diamond is node-surfaced, with the same network, set to 2.6 IOR.
Refraction on the diamond seems to work also.
(i avoided blurs/antialias/aberrations by now to speed up renders)

test_fresnel_03.jpg
It seems that the node version works even better...

(But i still don't get what that world spot thing really means...)

And here is my network
nodes_1.gif
 

dpont

Member
This sample is convincing,
"Object Spot" is the position of (spot) point, being evaluated
in object coordinates, "World Spot" is its position in world coordinates,
this one could be the first parameter of a raytrace node,
the other parameter is the direction vector of the ray.

Denis.
 

vesalius

New member
Thank you denis, i think i understad that,
what i don't understand is how to use that vector info with a raytrace node... or what could be the advantage of that.
Anyway it's not your job to teach me that, i'll try to guess it for myself.

You did a great job, the fresnel node is ok,
and i don't know if my network is the best one could build but for now is working, i'll keep improving it.
when i make something more worthwile than 2 cilinders and a diamond primitive on an infinite plane i'll post it here.

thank you again for making life a little better for us lightwavers.
 

dpont

Member
In fact raytrace function should do almost the same job for
reflection and refraction than the specific nodes you have used,
May be the result you get should be scaled with Fresnel output
Reflection and Transmission scalars, but not sure that is necessary.

Denis.
 
Top Bottom