<div dir="ltr">I think the main reason you don&#39;t see fresnel term in the microfaset code (actually, in all BSDF code) is because it was designed in a way so you can mix it with fresnel term in the shader tree.<div><br></div><div>Now, i would think for more realistic results fresnel should be per-microfaset, even if it&#39;ll be approximation of fresnel. it might be needed to re-consider user interaction in the nodes a bit to support &quot;manual&quot; mixing with the fresnel term, but it should all be doable.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jan 10, 2015 at 2:10 PM, Dmitry Andreev <span dir="ltr">&lt;<a href="mailto:andcoder@gmail.com" target="_blank">andcoder@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Ok. It looks like my old post on <a href="http://blenderartists.org" target="_blank">blenderartists.org</a> has been removed but this one reports similar issues:<br><a href="http://blenderartists.org/forum/showthread.php?303499-Begging-for-the-return-of-IOR-for-Glossy&amp;highlight=Fresnel+term+incorrect" target="_blank">http://blenderartists.org/forum/showthread.php?303499-Begging-for-the-return-of-IOR-for-Glossy&amp;highlight=Fresnel+term+incorrect</a><br><div><br></div><div>The issues is this.</div><div><br></div><div>From artists point of view - you get really odd specular highlight behavior when using microfacet BRDFs (GGX, Beckmann) with Fresnel node. Basically you get &quot;glowing edges&quot; effect.</div><div><br></div><div>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.</div><div><br></div><div>So from the programmers perspective the problem is here:</div><div>bsdf_microfacet_ggx_eval_reflect and bsdf_microfacet_ggx_sample in bsdf_microfacet.h<br></div><div>(it is the same for beckmann as well)</div><div><br></div><div><div><span style="white-space:pre-wrap">                </span>float out = (G * D) * 0.25f / cosNO;</div></div><div><br></div><div>notice that there is no F term there...</div><div><br></div><div>In sample function:</div><div><br></div><div><div><span style="white-space:pre-wrap">                                        </span>// eq. 20: (F*G*D)/(4*in*on)</div><div><span style="white-space:pre-wrap">                                        </span>float out = (G * D) * 0.25f / cosNO;</div></div><div><br></div><div>same thing - F term is not taken into account whereas the comment states correct equation.</div><div><br></div><div>This F could be as complex as one can get, but even Schlick&#39;s approximation similar to the actual Fresnel node work fine so no really need for Maxwell&#39;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.</div><div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 9, 2015 at 3:07 PM, storm <span dir="ltr">&lt;<a href="mailto:kartochka22@yandex.ru" target="_blank">kartochka22@yandex.ru</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">It have no sense, as Fresnel node paired with mix node assume layered<br>
physical surface, with infinite small almost flat dielectric last layer<br>
(coat). By definition, if you assume microfaset it will broke whole idea<br>
about Freshel equation, as it related only to almost perfect(with<br>
respect to wavelength) polished boundary between media with different<br>
IOR. If you want Freshnel- like law with microfacet, you will end with<br>
extreme complex Maxwell equation that hard (impossible for me) to solve.<br>
<br>
В Пт, 09/01/2015 в 21:44 +0100, Marco G пишет:<br>
<div><div>&gt; @storm - what i&#39;ve read it&#39;s not related to more physically correct<br>
&gt; glossy, the point highlighted in many sources is about Fresnel, which<br>
&gt; needs to be computed per-microfacet.<br>
&gt;<br>
&gt; A user following the list kindly pointed me to the same very topic on<br>
&gt; this list, back in 2013, and gave me permission to link back here.<br>
&gt; It&#39;s what i&#39;ve tried to say (though my understanding of what&#39;s<br>
&gt; involved is much more limited)<br>
&gt; Hope this clear things up a bit. By &quot;improving&quot; this - if feasible -<br>
&gt; artists should get better shading when fresnel and rough glossy are<br>
&gt; involved (i.e. a ton of materials, not really corner cases), both at<br>
&gt; grazing angles and at facing normal, like the head examples from<br>
&gt; arnold.<br>
&gt; <a href="http://lists.blender.org/pipermail/bf-cycles/2013-May/001397.html" target="_blank">http://lists.blender.org/pipermail/bf-cycles/2013-May/001397.html</a><br>
&gt;<br>
&gt;<br>
&gt; Regards,<br>
&gt; MG<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; 2015-01-07 10:11 GMT+01:00 gandalf3 &lt;<a href="mailto:zzyxpaw@gmail.com" target="_blank">zzyxpaw@gmail.com</a>&gt;:<br>
&gt;         Just in case anyone is wondering, I think this is the project<br>
&gt;         storm was<br>
&gt;         talking about:<br>
&gt;         <a href="http://blender.45788.x6.nabble.com/Realistic-Nk-Data-Metal-BSDF-td116555.html#a116623" target="_blank">http://blender.45788.x6.nabble.com/Realistic-Nk-Data-Metal-BSDF-td116555.html#a116623</a><br>
&gt;<br>
&gt;         --<br>
&gt;         -gandalf3<br>
&gt;<br>
&gt;         _______________________________________________<br>
&gt;         Bf-cycles mailing list<br>
&gt;         <a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
&gt;         <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; Bf-cycles mailing list<br>
&gt; <a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
&gt; <a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br>
<br>
_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org" target="_blank">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
</div></div></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
Bf-cycles mailing list<br>
<a href="mailto:Bf-cycles@blender.org">Bf-cycles@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-cycles" target="_blank">http://lists.blender.org/mailman/listinfo/bf-cycles</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div><span style="color:rgb(102,102,102)">With best regards, Sergey Sharybin</span></div></div>
</div>