SubSurface vs PreIntegrated : some problems

Hi,

I was comparing some shaders today and was interested by the PreIntegarted skin lighting model. I noticed some little things however. This comparison was made with exactly the same material setup, the only thing that change is the lighting model. (The ingame screenshot is showing the “lighting complexity” mode of the main viewport).

In SubSurface mode you can notice some geometry artifacts along the shadow line of the mesh, showing some sort of triangulation/normal map problem.

In PreIntegrated skin mode this artifact disappear but the final effect is much more brighter. I isolated this problem around the subsurface color. The more bright this input is, the brighter the lighting will be. Unfortunately it makes a problem because if you reduce the amount of luminosity (with a multiply for example) in this input to counter-act the amount of lighting you lose the depth of the skin.

I don’t mind at all the geometry artifact to be honest (even if for a cinematic it can be problematic), however I don’t know how I could workaround the brightness problem…

With the preintegrated skin lighting model, the subsurface color input scales the light that bounced around and then exits the skin. That happens on the side facing the light as well as a little bit past the terminator, which is why it makes the side facing the light so bright. Can you reduce your base color used with the preintegrated skin to compensate? I don’t think the SSS lighting model properly takes this into account.

Thanks for the explanation ! :slight_smile:

As for the subsurface model artifacts, I’m wondering now if it could be because the shadow is computed only in the vertex fragment shader, but not the terminator which is in the pixel shader ?

It looks a bit like a sort of linear interpolation between the vertices of my mesh.

The SSS self shadowing artifacts are because SSS materials get special shadow filtering which treats the material as if it is semi-translucent when blocking light in shadows. It has pretty poor quality at Opacity = 1 though. Try a smaller opacity and the artifacts should disappear.