View Full Version : Fresnel node
Thomas M.
09-25-2006, 09:00 AM
Could somebody please do that? Should be a piece of cake.
Cheers
Thomas
jameswillmott
09-25-2006, 09:37 AM
What do you want it to do exactly?
3dworks
09-25-2006, 09:56 AM
Could somebody please do that? Should be a piece of cake.
Cheers
Thomas
Isn't the 'Incidence' node doing this already?
Thomas M.
09-25-2006, 11:25 AM
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
09-25-2006, 02:21 PM
Have released a Fresnel node beta (Win32):
http://perso.orange.fr/dpont/plugins/nodes/FresnelNode.zip
37218
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.
Thomas M.
09-25-2006, 02:59 PM
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
09-25-2006, 03:31 PM
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.
Thomas M.
09-25-2006, 03:33 PM
Thanks, Denis.
dpont
09-25-2006, 04:19 PM
Fresnel has been updated,
have not tested the case where first
medium isn't the air.
Denis.
Limbus
09-26-2006, 09:16 AM
Once again Denis to the rescue. Thanks a lot.
Florian
dpont
09-27-2006, 04:06 AM
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.
09-27-2006, 05:17 AM
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?
dpont
09-27-2006, 05:35 AM
I mean that a lot of glass shaders, use a transmission
which is the inverse of reflection (transmission 1 in this new beta).
have also changed reflection, which is what you get in node preview.
37248
http://perso.orange.fr/dpont/plugins/nodes/FresnelNode2.zip
Denis.
vashts
09-28-2006, 03:18 PM
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
09-28-2006, 03:51 PM
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
09-29-2006, 08:09 PM
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
09-29-2006, 09:05 PM
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)
37346
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
37347
dpont
09-30-2006, 02:13 AM
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
09-30-2006, 08:36 PM
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
10-01-2006, 02:34 AM
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.
Thomas M.
10-28-2006, 01:55 PM
O.k., Denis. I played around with the node a bit and for air-blablabla surfaces everything works fine.
But if the ray exits the object (second fresnel node, IORs switched), there's no total reflection going on. Compared the results (preview and render output) with a gradient I created by using data from an excel sheet.
In comparisson to the thinner to thicker medium node, the thicker-thinner fesnel node's preview should have a much thicker white area and the transition from 0 degree to the angle when total reflection occurs is much harder. As far as I remember for glass-air total reflection occurs somewhere around 45 or 50°. In my excel sheet that's the border after which the math function puts out an error message. But in reality the amount of reflection is then 100%.
Please try to fix this. Otherwise the node is top notch.
Cheers
Thomas
P.S.: Are there any explanations availabe for your metal and velvet node?
Thomas M.
10-30-2006, 05:18 PM
Thought an image might help a bit to make clear what it's supposed to look like. The lower right gradient is my inner reflection gradient. Your lower fresnel node is like the upper one, only the two IORs are exchanged.
Could you please fix this, Denis? Then the node would rock.
Thanks
Thomas
dpont
10-31-2006, 01:40 AM
Ok, I will study this and try to fix,
please could you post the entire surface preset,
with both examples, this could help me.
Denis.
Thomas M.
11-03-2006, 07:22 AM
Hi Denis,
finally managed to save the nodal surface with the most important nodes. Threw away Specular to "clean" it a bit.
For the inner reflection and inner transparency your Fresnel node should work in a way that you just switch the IORs and at least for flint glass the preview should be similar to my Fresnel gradient. Hope it helps a bit.
A problem you might run into is that the Fresnel equation from the total reflection angle on won't work anymore (spits out an error message) as there isn't any more than total reflection.
Would love if there's a way to fix the node in this aspect.
Cheers
Thomas
dpont
11-03-2006, 11:27 AM
Thanks for sample, so yes it doesn't match your gradient,
and the first question in this thread about reversibility
could have here a (disapointing) reply, honestly I can solve
directly why this Fresnel formulae could fail, but may be
I could try to find a more accurate one.
I Know only that the total reflection
occurs in in some case in a refract function and calls a reflect
function instead, but for a raytrace vector (shader node to refraction shading)
not for transparency scalar output.
I'm afraid, because I'm not a glass specialist.
Denis.
vBulletin® v3.8.2, Copyright ©2000-2010, Jelsoft Enterprises Ltd.