I believe I nailed V8 act 2 (aka decent sss skins hopefully)

Issue #179 resolved
Alessandro Padovani created an issue

Tested with daz studio 4.11.0.383 (4.12 is buggy for animation), blender 2.83.5, plugin commit 8cd9124.

This is related to #129. This is not a "math" conversion the same as the volumetric skin in #24, it is vastly empiric so exceptions are to be expected. I tried to focus on the main features while also dealing with the eevee limitations, so to get a setup that could work fine enough for most cases both with cycles and eevee. The conversion is not focused to be "exact" but rather to be "pleasant". An exact conversion is not possible because iray volumes can't be converted to plain sss.

1. MORE PRECISION FOR EEVEE. For this method to work fine some more precision is required for eevee. Below the settings required for contact shadows and subsurface scattering. Also two pictures show how the increased precision avoids some artifacts.

contact shadow distance = 0.01 m
contact shadow bias = 0.01

sss samples = 16
sss jitter threshold = 0.5

2. THE REVISED EQUATIONS. Below the revised equations. The main differences are the radius color for the thin walled case and the gamma node for the translucency color. The idea was to give more "saturation" to the translucency texture so to avoid the pale skins effect, and also to get a color for the thin walled transmission so to avoid the white translucency effect. We'll see a comparison later so this will become more clear.

NOTE. I did some more advanced tests on the sss radius, but the results lead to nodes that are not compatible with eevee. So I feel the simple equations below work fine enough, and eventually we can improve them if we find something better.

edit IMPORTANT. With the new global bsdf + global principled material options as revised in #154, the bsdf sss case is used in the DAZ Translucent custom group.

# for principled sss
# a 2.5 gamma for the translucency texture is used to avoid the "white skin" effect
principled sss color = gamma(iray translucency color, 2.5)
principled sss scale = iray translucency weight

# NOTE this is used in the DAZ Translucent group with the new material options in #154
# for bsdf sss
# here the mix factor is used instead of the scale to match the principled shader
bsdf sss color = gamma(iray translucency color, 2.5)
bsdf sss scale = 1
bsdf sss mix = iray translucency weight

# for eevee the sss translucency must be anabled and better shadow precision is required
# the transmitted color is responsible for translucency so it is added to the sss color
# a 0.02 sss factor is used because it works fine for the average figure size

# if there's no volume we use the sss to make translucency
# please note that here we only use the iray base translucency color with no textures
# as for blender 2.8x eevee doesn't support nodes in the radius channel so we deal with it
if thin walled == on
    blender sss radius = iray base translucency color

# white or black colors disable transmission as well as scattering
# please note that the iray sss amount is "normalized" to better work with the 0.02 factor
if thin walled == off
    if iray transmitted color == white then iray transmitted color = black
    if iray chromatic mode
        if iray sss color == white then iray sss color = black
        blender sss radius = (iray sss color + iray transmitted color) * 0.02
    if iray mono mode
        if iray sss amount > 1 then iray sss amount = 1
        blender sss radius = (iray sss amount + iray transmitted color) * 0.02

Below an example of the new setup.

3. COMPARISON TESTS. I included the test scene for G8F, you can then test any character you wish by replacing the G8F figure. The test scene is specifically designed to test sss and translucency. There's a low ambience light and a couple of strong backlights in strategic areas behind the fingers and ears.

Below there's a comparison with some characters that get quite different skins so I chose them for the skin variations. I also tested them with thin walled off and on to show how the thin walled case works. There are three pictures for each figure. First iray with thin walled off and on, then the new setup with cycles and eevee, then the old setup with cycles and eevee.

Comments (28)

  1. Alessandro Padovani reporter

    Genesis 8 Female, that’s iray with thin walled off then on.

    New setup, on the left we have cycles + eevee with thin walled off, on the right we have cycles + eevee with thin walled on. Please note that with the same setup eevee tends to expose sss effects more than cycles, but since this is most visible for thin walled on I feel this is acceptable.

    Old setup.

  2. Alessandro Padovani reporter

    Victoria 7

    New setup. Please note that Victoria 7 gets an unusual “olive” tint on the skin, but this is the same in iray so I believe we’re fine.

    Old setup.

  3. Thomas Larsson repo owner

    The new equations should be implemented now. Overall very nice, but in my test renders the shadows are still jagged, though not so much.

  4. Alessandro Padovani reporter

    Thomas, commit 9ea2f15 seems great. As for the jagged shadows I checked it and the only parameter that is not used by the plugin seems to be the soft shadows. I’d advise to add it to the minimum requirements. In my tests I don’t get jags though even without soft shadows.

    edit. Ok I got it. Since this is a screen space effect it also depends on the camera angle. So if the hand is very much close or almost touches the shoulder in the viewport projection, then you get jagges. In your example the hand is much closer to the shoulder than in my examples.

    edit. After some tests I found that we can fix this issue with some more eevee precision, by setting the thickness to 0.1 rather than the default 0.2.

  5. Alessandro Padovani reporter

    @sc As for lowering the sss effect it is not so obvious. That is, cycles is actually less than iray on average, while eevee tends to be more than cycles with the same setup. I tried to stay on the middle. Also this is heavily affected by the sss tints that the equations are just approximating very roughly.

    Believe me it could be much worse, and we’re lucky that it tends to work fine enough with most characters. We’re very much far away from “perfect”. If one wants something good then he has to use the volumetric skin, that matches fine with iray almost always, but it is cycles only doesn’t work with eevee.

  6. Alessandro Padovani reporter

    UPDATE. BLENDER 3.0 SSS

    daz studio 4.15.0.30, blender 3.0, diffeomorphic 1.6.1.0785

    It seems something is changed with sss in blender 3.0, so the 2.9 factors are not good anymore. Below the same scene in blender 2.93 and 3.0, it’s the sss-g8f.duf test scene provided above. We see that 3.0 gets a much more intense sss effect than 2.93. Luckily for us the way we use sss it is enough to fix the radius factor to get back what we want.

    Please note that "random walk fixed radius" is the old random walk in 2.93, while "random walk" is the new random walk in 3.0. I still believe burley is better for daz figures since random walk gets artifacts with non-closed meshes, as also reported in the blender docs. Then ior = 1.4 and anisotropy = 0.8 are the recommended settings for the human skin.

    https://docs.blender.org/manual/en/latest/render/shader_nodes/shader/sss.html

    # blender 3.0 factors, they also apply to the thin walled radius
    if sss == burley
        sss radius *= 0.25
    else if sss == random walk fixed
        sss radius *= 0.5
        sss ior = 1.4
        sss anisotropy = 0.8
    else if sss == random walk
        sss radius *= 0.1
        sss ior = 1.4
        sss anisotropy = 0.8
    

    Below an example with Victoria 8 in blender 3.0 with random walk, first iray then cycles then the fix

  7. Thomas Larsson repo owner

    I implemented the radius corrections, both for the bsdf and principled workflows. However, I do not understand what sss ior and anisotropy are. The glossy node has anisotropy, and ior too through the fresnel node, but that is not directly connected to any sss node. What am I missing here?

  8. Alessandro Padovani reporter

    Thomas look at the link I provided above, the new sss in blender 3.0 gets ior and anisotropy for random walk for a more realistic skin. Both for bsdf and principled. Those parameters are not implemented in blender 2.9 and before.

    edit. Commit 11ecb05 works fine for the radius.

  9. Thomas Larsson repo owner

    Fixed in last commit. I only had access to Blender 2.92 before and didn’t see the new sockets.

  10. Log in to comment