[Eevee - Principled Method] The current principled method for Eevee has several bugs

Issue #336 resolved
Xin created an issue

Refer to #335 for a new alternative that avoids screen space refractions (SSR). This Issue details the current problems and solutions for the current principled method for Eevee, which relies on SSR.

Refer to the attached .blend:

1- The Eyelashes are set up with Blend Mode = Alpha Blend, when it should be Alpha Clip or Alpha Hashed (a general rule of thumb for hair blending). This is the same issue reported in #334 .

2- Pupils are fully opaque and that's correct. No issues here.

3- Irises are Alpha Hashed and that's right. Any mask that is fading stuff should be set up to Alpha Hashed.

Why? because Alpha Blend tends to have sorting issues, and doesn't play well with Screen Space Refraction (SSR). In the attached .blend, check the plane/spheres collection to understand the problem.

4- EyeMoisture is set with Screen Space Refraction (SSR), this is a common set up.

The other common set up sets the EyeMoisture with alpha = 0, effectively removing it from participating in shading, and the "moisture" effect is done entirely on the Cornea & Sclera. This is what V7 does. That set up is very good for Eevee since you get rid of one refractive surface, so double refraction issues, which SSR can’t handle, don't arise.

In this example though, that isn't the case. So let's continue, assuming we leave EyeMoisture with SSR.

5- Cornea & Sclera: these share the same geometry, they are attached. It's very common to find masks here. From the discussion above, these masks should be in a material that has Blend Mode == Alpha Hashed, since the layer above, EyeMoisture, very likely has SSR, and we can’t have Alpha Blend surfaces behind SSR surfaces (again, check the plane/spheres collection to understand the problem).

So here the addon fails again, and uses Alpha Blend on the Sclera material, which contains the alpha mask for fading. So we set it up to Alpha Hashed to correct it.

Another issue with the addon right now is that it is setting Blend Modes of materials with Alpha == 1 to Alpha Hashed or Alpha Blended seemingly arbitrarily. An easy check that could be made to avoid potential issues with transparency is the following:

if material's alpha == 1 (and is using Principled node):
    Blend Mode = Opaque
    if Transmission == 1:
      Shadow Mode = None 
    else:
      Shadow Mode = None (or Opaque)

# For partially transmissive surfaces you can't get partial shadows,
# since the Shadow Mode depends on the Alpha input not Tranmission. 
# So it's a matter of choice: either no shadows (None), 
# or shadows as if it was opaque (Opaque).
# Alpha hashed is the same as Opaque since alpha == 1.

No reason to set it up to anything else if it's fully opaque and is using the Principled node. We do this for the Cornea then.

The Cornea is also refractive, so here a potential issue arises: since the EyeMoisture already has SSR, we can't have another surface with SSR behind it, Eevee can't handle more than 1 SSR refractive surface. Any refractive surface behind the first one is simply completely ignored by Eevee during rendering (it behaves the same as if that surface was completely transparent, alpha == 0).

This works to our advantage here, but we lose some accuracy. The Cornea has Transmission == 1, so it should have SSR enabled.
This makes the Cornea completely invisible from a shading perspective. In Cycles, the Cornea would still have a minor effect in the final shading. This is the current weakness of the Principled method.

Refer to #335 for an alternative.

6- Now the eyes are shaded properly, fixing the current issues.

Comments (10)

  1. Alessandro Padovani

    A. Indeed alpha blend should be used only when we use transparency with no refraction to mimic thin glass, that’s the bsdf thin glass. This is reported in #334 too. Once this is fixed then 1-5 will be fine.

    B. As for alpha = 1, I agree that opaque is enough in this case, but alpha hashed doesn’t harm anyway as a general purpose setting.

    C. As for the cornea refraction, this is a limit of eevee. Some complex cases are to be fixed by the user. This is expected for iray to eevee conversion.

  2. Xin reporter

    Issue still exists in the current commit when choosing Principled for Opaque surfaces and Principled for Refraction too.

    Now the Issue is that SSR is enabled in materials which have Transmission == 0. Seems like an old Issue coming back.

  3. Log in to comment