You need to change the wavelength to the appropriate value - R=0.650 G=0.510 B=0.475
Announcement
Collapse
No announcement yet.
Complex fresnel using VRayOSLtex
Collapse
X
-
Here's mine for what it's worth.
This is a somewhat different approach, I think I got the equation from the old Odforce Wiki. If someone wants to do complex number calculations in OSL there are a few functions for that included here.Attached Files
Comment
-
This works like a charm, thanks guys!
Vlado, would it be possible to include colour swatches next to the n and k values? It would be awesome if we can put the correct numbers in and then tweak the colours individually. It would give more control over a colour correct and keep the shader a bit simpler.
Comment
-
Originally posted by vlado View PostHere is a shader that allows you to enter n and k values directly (for 0.65, 0.55 and 0.45 micrometers - you can get values directly from http://refractiveindex.info/)
Use as a reflection color map and make sure the Fresnel option in the VRayMtl material is disabled.
Best regards,
Vlado
Comment
-
Originally posted by kosso_olli View PostVlado, that's working great! But it seems I have to apply gamma to the osl texture, otherwise the result is very washed out.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
Sure! Here you can see your complex fresnel osl with the values for copper. On the left without any modifications, on the right with gamma 2.2. When I redraw the reflectance curves with a falloff map, I get a result close to the gamma 2.2 version. Will check my gamma settings just to be sure, but I never had something like that before.
Comment
-
Ok; not sure about that one though - I just copied the formulas and I'm pretty sure the Fresnel equations do not feature any gamma correction. What are the n and k values that you used? I think the default ones that I put in the shader are for copper.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
Vlado,
I looked up the settings for copper over at refractiveindex.info and found out that your default values are already set for copper. But it is the same for all my other materials as well. My older ones used the curves, and they are much more saturated then the materials with the osl and no gamma correction.
That isn't a big problem for me, I can always put the osl texture into a color correct node.
Comment
-
I'm not sure this is a gamma issue.
I made a test with gold, rendering 3 different versions :
1- with the complex ior vrayosltex (values from refractiveindex.info)
2- with a falloff map with custom RGB curves (values from refractiveindex.info)
3- same as 1 (vrayosltex) but with a cc with gamma 0,45
As you can see the first two are pretty close, but the vrayosltex does indeed lack a little punch in the colors, whereas the gamma corrected version is very different.
Comment
-
Well, it also depends on what wavelength you decide to sample; I used 0.45, 0.55 and 0.65 because this is what seemed to be used in the paper linked to the first post. However, in the thin film shader, I used 0.475, 0.51 and 0.65. A better approach will probably be to integrate the n and k values over the CIE curves for red/green/blue instead of point-sampling specific wavelengths. Or else, do full spectral rendering - but then you need to draw the n/k curves for the full spectrum.
Best regards,
VladoI only act like I know everything, Rogers.
Comment
-
Originally posted by theedge View PostI'm not sure this is a gamma issue.
I made a test with gold, rendering 3 different versions :
1- with the complex ior vrayosltex (values from refractiveindex.info)
2- with a falloff map with custom RGB curves (values from refractiveindex.info)
3- same as 1 (vrayosltex) but with a cc with gamma 0,45
As you can see the first two are pretty close, but the vrayosltex does indeed lack a little punch in the colors, whereas the gamma corrected version is very different.
[ATTACH=CONFIG]22982[/ATTACH][ATTACH=CONFIG]22983[/ATTACH][ATTACH=CONFIG]22984[/ATTACH]
Comment
-
Originally posted by kosso_olli View PostCould you please share that simple scene? I would like to make sure that there is no error on my setup.
gold_test.zip
I used values of .65 .55 and .45 for wavelenghts
As for the curves, well, they are approximated by eye so maybe not very accurate.
Please let me know if this is the way you have set up things. I'm also curious to know if this is the right workflow.
Comment
Comment