Resources for the new Principle Node 4.0

Issue #1830 duplicate
CookItOff created an issue

@Thomas Larsson

These two videos do a great dive into the changes and settings for the principle node for IOR in the first and SSS in the second. The instructor is very thorough with is demonstration.

https://www.youtube.com/watch?v=7ucxCoa7jq0&t=622s

https://www.youtube.com/watch?v=9i-gqWbcS3Q

Comments (12)

  1. Alessandro Padovani

    Thank you for the links, unfortunately the videos don’t talk about the main feature change. That’s refraction and reflection are now driven by the same ior thus no more independent. And in my opinion this is a big mistake in 4.0.

    Of course it is possible to modulate reflection over refraction, but then converting from 3.6 becomes complex.

    For example in 3.6 we may have a material with 1.8 ior refraction and 0.8 reflection. In 4.0 we can set 1.8 ior refraction as before but then we don’t know what’s the equivalent for the 0.8 reflection, because reflection in 4.0 modulates from 1.5 refraction to have the same value as 3.6.

    That said we did a fair conversion in #1764. Feel free to propose changes if you find anything better.

    p.s. One possible change from #1764, is to use ior = 1.5 and specular copied from 3.6 for non refractive materials, instead in #1764 we always convert the ior and leave specular to 0.5. The final result is the same.

    @Thomas Larsson let us know if you can implement the change below compared to #1764. Again this is optional as the result is the same, but perhaps it’s a more clean conversion.

    # principled v2 ior
    # the new principled use the same ior for specular and transmission, so we have to choose
    if transmission weight == 0
        ior = 1.5
        specular ior level = v1 specular
    else
        ior = v1 ior
        specular ior level = 0.5
    

  2. Alessandro Padovani

    @Thomas Larsson The second video is also useful because it shows the sss conversion from 3.6 to 4.0. Basically 4.0 just renames the sss types. Thank you CookItOff for pointing this out.

    IIRC we use different sss factors for the various sss types, so this conversion table comes in handy.

    # sss conversion 3.6 to 4.0
    burley > burley
    random walk (fixed radius) > random walk
    random walk > random walk (skin)
    

    p.s. The video also advises to use the sss scale to normalize the rgb radius. That doesn’t change anything as a final result, but gives the rgb radius more the “color“ meaning that could be a cleaner conversion. In #1764 we keep the scale to 1.0 to mimic 3.6. Again this is optional.

    The video also reveals the human skin anisotropy that we already use for conversion, but we may want to only use it for “random walk (skin)” and not for “random walk“.

    # sss conversion from 3.6 to 4.0
    4.0 sss scale = max(3.6 sss radius)
    4.0 sss radius = 3.6 sss radius / 4.0 sss scale
    
    # human skin anisotropy
    if sss = "random walk (skin)"
      sss anisotropy = 0.8
    else
      sss anisotropy = 0
    

    p.p.s. Christopher is wrong when he says we can use the 4.0 radius instead of the 3.6 sss color, since the 3.6 sss factor is a mix with diffuse so we need a mix to mimic that, as implemented in #1764. Also textures on radius don’t work with eevee that only refers to the scalar rgb values.

  3. Thomas Larsson repo owner

    I have implemented the sss part. You can look at the code of fixSSSRadius at cycles.py, line 1438 and around 282 in pbr.py. I had a look at the ior code but afaiu those formulas are already implemented.

  4. Alessandro Padovani

    Commit 30b4d33.

    The code only works for the principled shader and not for the daz ssss group, it would be consistent to deal with both since the 4.0 changes are the same for the principled shader and the sss shader.

    steps for blender 4.0:

    1. in global settings set “sss skin“
    2. import G8F as bsdf
    3. check the skin material, the sss rgb radius is not normalized and the scale is 1.0

    The code doesn’t set anisotropy 0.8 for random walk skin.

    steps for blender 4.0:

    1. in global settings set sss to “random walk skin”
    2. import G8F as extended principled
    3. check the skin material, sss anisotropy is zero

    If it’s not a burden it would be nice to also implement the changes for specularity so we use ior for refraction and specular for reflection that’s a clean conversion. There’s also a bug reported at the daz forum that ior is not handled fine with textures, switching to the specular conversion would fix that.

    https://www.daz3d.com/forums/discussion/659696/

  5. Thomas Larsson repo owner

    The sss stuff should be fixed now, but I am confused about specularity. The specular map now goes to specular ior level while ior is left at the default value.

  6. Alessandro Padovani

    Commit dac73c5.

    Yes sss works fine thank you for the fix. As for specularity I see there's some confusion, below the equations for blender 4. Test scene included glossy.duf.

    # principled specularity for blender 4.x
    if iray refraction weight == 0
        principled ior = 1.5
        principled specular ior level = iray glossy layered weight * iray glossy reflectivity
        principled specular tint = iray glossy color
    

  7. Thomas Larsson repo owner

    Fixed in last commit, I think. I notice that in Blender 3 the product of glossy layered weight and reflectivity is multiplied with a factor 1.25. Also, this formula for the product is only used for iray and the metallic/roughness base mix.

  8. Alessandro Padovani

    Commit 46a86d4 works fine thank you for the fix, if there’s nothing to add we can close as resolved.

    As for the difference with 3.x, as explained above 4.x use ior as base for the ior level, while in 3.x ior and specularity are independent, that personally I like better. Also 3.x doesn’t have the tint texture so we multiply the main channel. The 1.25 factor is something I eyeballed to better match iray but the iray and principled fresnels are different anyway, so this is empiric and could be omitted.

    # principled specularity for blender 2.x 3.x
    # the 1.25 factor is empiric and could be omitted
    if iray refraction weight == 0
        principled specular = iray glossy layered weight * iray glossy reflectivity * iray glossy color * 1.25
    

    As for the specular glossiness conversion we have the following equations.

    # iray pbr specular glossiness coversion:
    iray glossy reflectivity = iray glossy specular / 0.078
    iray glossy roughness = 1 - iray glossiness
    

  9. Log in to comment