[Bf-cycles] Cycles and Fresnel

Brecht Van Lommel brechtvanlommel at pandora.be
Fri May 31 03:17:02 CEST 2013


Hi Dmitry,

On Fri, May 31, 2013 at 12:43 AM, Dmitry Andreev <andcoder at gmail.com> wrote:
> 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
> databases.

Probably it makes sense to include the fresnel in the Glossy BSDF node
itself yes, if it needs to depend on the specific BSDF normal.

> 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.

I don't think this woud work, node should be self contained and only
pass data forward through node links.

When we put the fresnel in the BSDF node, the main issue is how you
mix / layer such BSDF's. I haven't figured out a design yet for more
advanced layering of BSDF's. Maybe the BSDF node needs to output some
mix / layer weight, or we need a new Layer Shader node, or something
else entirely? What would need to be done is look at some layered BSDF
models, write down the equations and figure out how we can split that
in composable nodes.

I'm not familiar enough yet with this stuff to give good advice, would
need to do a lot more reading and thinking for that. The design would
have to fit in the OSL closure model, where the result of a shader
evaluation is a linear combination of closures. If a linear
combination is not possible then a special layering closure could be
created too, which takes other closures as parameters but I'm not sure
if this will be needed.

Brecht.


More information about the Bf-cycles mailing list