[Bf-cycles] Cycles Fresnel behaviour

Dmitry Andreev andcoder at gmail.com
Sat Jan 10 10:10:51 CET 2015

```Ok. It looks like my old post on blenderartists.org has been removed but
this one reports similar issues:

The issues is this.

>From artists point of view - you get really odd specular highlight behavior
when using microfacet BRDFs (GGX, Beckmann) with Fresnel node. Basically
you get "glowing edges" effect.

That is because when BRDFs are calculated F term (Fresnel) is not taken
into account correctly but instead it was taken out so that one could use
Fresnel node instead. The problem is that Fresnel at the point of BRDF
evaluation is H (half angle) based (read - microfacet). But later in the
pipeline Freanel node is geometry normal based. It seems like not that big
of a deal and in fact it is hard to find cases when it breaks but once you
try to get something to look realistic or replicate photographs then you
get to see it break.

So from the programmers perspective the problem is here:
bsdf_microfacet_ggx_eval_reflect and bsdf_microfacet_ggx_sample in
bsdf_microfacet.h
(it is the same for beckmann as well)

float out = (G * D) * 0.25f / cosNO;

notice that there is no F term there...

In sample function:

// eq. 20: (F*G*D)/(4*in*on)
float out = (G * D) * 0.25f / cosNO;

same thing - F term is not taken into account whereas the comment states
correct equation.

This F could be as complex as one can get, but even Schlick's approximation
similar to the actual Fresnel node work fine so no really need for
Maxwell's equations as one would think. The only catch is that in here it
depends on H (microfacet normal) as opposed to N (geometry normal). This
little detail makes a huge difference.

On Fri, Jan 9, 2015 at 3:07 PM, storm <kartochka22 at yandex.ru> wrote:

> It have no sense, as Fresnel node paired with mix node assume layered
> physical surface, with infinite small almost flat dielectric last layer
> (coat). By definition, if you assume microfaset it will broke whole idea
> about Freshel equation, as it related only to almost perfect(with
> respect to wavelength) polished boundary between media with different
> IOR. If you want Freshnel- like law with microfacet, you will end with
> extreme complex Maxwell equation that hard (impossible for me) to solve.
>
> В Пт, 09/01/2015 в 21:44 +0100, Marco G пишет:
> > @storm - what i've read it's not related to more physically correct
> > glossy, the point highlighted in many sources is about Fresnel, which
> > needs to be computed per-microfacet.
> >
> > A user following the list kindly pointed me to the same very topic on
> > this list, back in 2013, and gave me permission to link back here.
> > It's what i've tried to say (though my understanding of what's
> > involved is much more limited)
> > Hope this clear things up a bit. By "improving" this - if feasible -
> > artists should get better shading when fresnel and rough glossy are
> > involved (i.e. a ton of materials, not really corner cases), both at
> > grazing angles and at facing normal, like the head examples from
> > arnold.
> > http://lists.blender.org/pipermail/bf-cycles/2013-May/001397.html
> >
> >
> > Regards,
> > MG
> >
> >
> >
> >
> >
> > 2015-01-07 10:11 GMT+01:00 gandalf3 <zzyxpaw at gmail.com>:
> >         Just in case anyone is wondering, I think this is the project
> >         storm was
> >
> http://blender.45788.x6.nabble.com/Realistic-Nk-Data-Metal-BSDF-td116555.html#a116623
> >
> >         --
> >         -gandalf3
> >
> >         _______________________________________________
> >         Bf-cycles mailing list
> >         Bf-cycles at blender.org
> >         http://lists.blender.org/mailman/listinfo/bf-cycles
> >
> >
> >
> > _______________________________________________
> > Bf-cycles mailing list
> > Bf-cycles at blender.org
> > http://lists.blender.org/mailman/listinfo/bf-cycles
>
>
> _______________________________________________
> Bf-cycles mailing list
> Bf-cycles at blender.org
> http://lists.blender.org/mailman/listinfo/bf-cycles
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.blender.org/pipermail/bf-cycles/attachments/20150110/09885c5d/attachment.htm
```