[Bf-cycles] Cycles and Fresnel
andcoder at gmail.com
Fri May 31 00:43:03 CEST 2013
I posted some related into in here
http://www.blender.org/forum/viewtopic.php?t=27455 but just in case I
though I would write to this list as well.
Long story short - there is a fundamental issue in Cycles related to
Fresnel calculation. For microfacet roughness models (Backmann, GGX,
etc...) the Fresnel term has to be computed based on microfacet normal
(Half angle vector in our case) instead of average normal whether it's
geometry or pixel normal.
I included some very basic examples in the post of where it breaks. I only
included Glossy BSDF example with GGX distribution since it has much longer
specular tail and thus the problem is quite apparent. But this happens
everything. Sure, for single shots you can find cases where it works, but
when you render animations that have to match real-world footage then it's
really hard to control.
I looked at YafaRay and Mitsuba but everything is fine there though they
don't support GPU rendering.
I have local changes only for Glossy BSDF with GGX distribution but would
like to generalize it to everything. The question is how to do it best
within Cycles kernels and SVM (without side effects) ?
I have/had a few ideas of how to do it best but some of them had side
effects. The one that I am thinking of right now is that everything has
basic IOR input, but you could plug a special advanced Fresnel node into it
that would be evaluated withing closures themselves. That advanced node
could have multiple options: 1. simple dielectric IOR, 2. spectral n,k data
that could be pre-integrated into LUTs using standard CIE illuminant and
standard CIE observer. It would look something similar to ColorRamp node.
And add some presets there that could be easily generated from n,k
Another idea was to have closures leave something on stack like microfacet
normal. So by default it would be average geometry/pixel normal, but it
closure is microfacet based it would override that with H vector. Then
Fresnel node that is connected to its output will use that. But this would
not work with all the mixing and other stuff unless you plug that Fresnel
node directly after the BSDF.
Anyway, I'd like to know what you think about it.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Bf-cycles