[Eevee - Principled Method] You could make use of a Transparent BSDF node to solve issues with SSR for thin films

Issue #335 resolved
Xin created an issue

This is similar to #333 regarding thin films and the proposed usage of Transparent BSDF to fix current issues as described in #336.

To clarify the available options and the different ways of achieving transparency in Eevee (focused on thin films):

  • The principled node has a Transmission input which requires Screen Space Refractions (SSR) to be enabled. This is quite costly and limited, and its main advantage is handling IORs != 1 and roughness, none of which are necessary for thin films (the eyes surfaces). Currently this is what the addon tries to do, but it still needs corrections to work properly (see Issue #336).
  • Another option is to try to achieve transparency with the Alpha input of the Principled node. This doesn’t require SSR but it needs Blend Mode to be Alpha Blend. This works awfully because the Alpha blend fades Fresnel reflections too, it fades all shading. This option will be ignored.
  • The third option is to use a Transparent BSDF much like in the current BSDF method for Eevee. This allows you to solve the issue from the option above since you can implement the Fresnel reflections yourself and avoid fading the reflections (it also requires Blend Mode to be Alpha Blend). With this solution, the Principled method would use a Principled node for the opaque surfaces or opaque portions of a material, and a Transparent BSDF (+ Fresnel + Clearcoat if needed) for the transmissive thin film portions.

See the attached .blend comparing the corrected principled SSR solution (1st point above) with the proposed principled/transparent BSDF solution (3rd option above).

Note that I ignored the Clearcoat part for the Transparent BSDF method, but that’s just a matter of adding it.

In my opinion, using SSR for thin films with almost zero roughness is a waste, it introduces all the limitations of SSR: fading near the screen edges; inability to stack more than 1 thin film; performance cost; inability to handle Alpha Blended surfaces behind an SSR surface; having to tweak the refraction thickness in the material settings; etc. The gains are negligible if any: I think the shading is a little better with SSR out of the box, but it’s a matter of taste and it’s a tiny difference. The way the SSR algorithm works is also not sophisticated, it’s not real refraction like in a path tracer since it’s a screen space algorithm. The real advantage is the roughness input and the shifting for IORs != 1. But those are irrelevant in this case.

I agree with engetudouiti here, using the transparent BSDF for handling thin films in the Principled method under Eevee might be the better option and simplify the increasingly complex algorithm to set up eyes in Eevee with the Principled method. Alessandro proposed pretty much the same too, so I think he agrees too.

If Thomas feels like keeping the solution that only uses principled nodes and SSR (corrected as in #336) , maybe he could also offer the alternative of using the Transparent BSDF/Principled hybrid that is less limited since it doesn’t require SSR.

One tangential issue: I used Alpha Blend for the Blend Mode of the Sclera, but I think I like the Alpha Hashed Blend Mode for the Sclera masks, it gives the eye more volume. Just try changing the Blend Mode of the material “Sclera-1.003” and see the effect.

Comments (14)

  1. Alessandro Padovani

    Initially we had a separate choice for refractive materials and we could choose bsdf or principled. Then we merged for simplicity, since we thought that users were more interested in a easy global setting. That is, bsdf or principled.

    What you’re asking for is to bring back a separate choice for refractive materials. That I guess it’s viable if Thomas agrees.

  2. Thomas Larsson repo owner

    Separate methods for opaque and refractive materials sounds like a good idea, if that means that we can get rid of the second principled node.

  3. Alessandro Padovani

    If you mean the double principled for refraction maps, personally I’d go with ignoring the map so to keep it simple. But I know others may not agree.

  4. Thomas Larsson repo owner

    Now the opaque and refractive methods are separated, although I haven’t tested all cases yet. The refractive principled method will have its limitations, but the node tree for the refractive bsdf method is quite simple - typically just one node group - -so one can choose that if the principled method does not work.

  5. engetudouiti

    Alessandro, I understand you do not rely mach eevee refraction, but about this case, we can use it for all option.

    1. if we strictily use one principled bsdf shader, we must connect it in transmission socket. it is refraction weight for principled bsdf (uber shader)

    2. now at least we use 2 shader to get thin wall.. base and refractive part. (it not matter how we make refractive part and how include reflective part for 2nd shader) so about this case,, we must use mix node, then the mix factor should be refraction weight. so we can divide refractive part..

    it basically worked for me,, though if you try complex material it may cause non realistic issue, but it not for base shader part.. it may show refractive part only. I may not expect match if we use it for volume glass with eevee.. but at least it can divide with refractive weight texture.. when you see from front,, and basically show reasonable reflection. with eevee too. at least about eye related mat,, we can use refractive weight map without problem.. the refractive weight map for cornea not generate bad effect for me.

    (so I can actually change cornea edge texture color.. or can adjust small with refraction weight,, easy)

    Many vendor may use 3d paint tool. then they may generate each diffuse texture for each surface or each UV set, but to paint them they do not need to divide each surface group on same island.. (it is merit of 3d paint tool). the aprication may auto generate, textures. for same uv island suface group include cornea..

    so they may include diffuse texture . then separate by refraction weight map. the merit can it can get buldge smooth mix. not restric by surface group. and not show the surface group shape as cornea. (not user friendly but more pro like way ^^;)

    If actually the refraction weight map cause issue,, I may re-consider, but at least we can easy remove it. if we found problem ,, if we remove it from start, we simply lost the funcition at all.

  6. Log in to comment