Search Unity

Feedback Subsurface scattering not affected by shadows? Bug or setting issue?

Discussion in 'High Definition Render Pipeline' started by florianalexandru05, Jan 9, 2022.

  1. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,807
    As the title suggests, I'm probably having a hard time understanding subsurface scattering. I created a profile and played with all the sliders and made sure all the settings are checked and yet this is what it does for me, it glows from the front too and it's not affected by shadow casting at all. Also, does anyone have any idea how to make translucency in HDRP? I noticed in amplify shader you have that option but it's the same thing.

    HDRPmess_01.jpg hdrpmess_02.jpg
     
  2. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    For your general issue.
    The main problem I see is that your transmission mode should be set to thin for most vegetation, this is due to the fact that it will be a fallback for thick anyway, which tends to just ignore the thickness map for very thin objects like infinite planes, this would be opposite to that of skin for example.

    for pre and post scatter this related to an Albedo 'blur' added after the scatter pass, generally, a fair few layers of plants is actually completely transparent and does have the same blurry diffusion skin does, so you can use a post scatter only texturing mode for plant and pre and post for the skin.

    finally, the thickness remap, by default, if your world scale is 1 unit (1m) then your thickness level would be in mm, this is normalised 0-1 when reading the thickness map on the material. cellular walls and leaves of course vary, but you may be able to find some databases online about the actual thickness of many species



    The key components for Translucency authoring are using a Thickness map and having a decent Diffusion profile set up to average various materials together.

    To make a thickness map you can use
    - mesh baker under the name thickness or transmission in some cases
    - Scan it ( compare the average between the original scan and a scan with a measured light behind it.
    - fake it.
    there's a couple of ways of faking it with channel mixing, but probably the easiest is to process an AO channel with the Normal map inverted on all channels.
    in a way, it kinda looks like an Xray

    Unity only needs a single channel for it so you can make it a single red channel and isn't scale dependant so you can make it 512x512 and it should scale fine for the most part.

    Hope that helps
     

    Attached Files:

    sqallpl and Ruchir like this.
  3. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    a gif here to show the translucency working
     

    Attached Files:

    Ruchir likes this.
  4. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,807
    Ok, I figured it out! Thanks for all the feedback it helped, it's just as you said thin object, etc. I actually did switch from thick object to thin object and moved every slider I could see before making this thread and nothing changed, the reason for that was the HDRP procedural skybox, ambient light. Turns out the ambient light also affects the scattering so even if you have shadow it's going to glow like crazy. I finally understand how the translucency works now after some fiddling, I have to admit I'm not a huge fan of it while at the same time I want to say it's cool, it's very sensitive and fiddly for my taste but at least I know it works.
     
    HIBIKI_entertainment likes this.
  5. florianalexandru05

    florianalexandru05

    Joined:
    Mar 31, 2014
    Posts:
    1,807
    Thanks for the help again, that looks cool, I had super strong ambient light in my scene so it was glowing in shadow still.
     
    HIBIKI_entertainment likes this.
  6. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    You're most welcome as always.
    Great effort narrowing down the issue!
    HDRP has a global fallback ambient probe so yeah certainly can make changes without realising sometimes.

    i highly recommend checking out the render pipeline debugger
    LTS windows > render pipeline > render pipeline debugger
    TS '' '' > analysis > pipeline debugger ( i believe)
    under the lighting tab you can full screen debug many lighting scenarios.

    one of my favourite unity tools
     
    florianalexandru05 likes this.
  7. Ruchir

    Ruchir

    Joined:
    May 26, 2015
    Posts:
    934
    This kind of info should be posted in the official documentation :D
     
    HIBIKI_entertainment likes this.
  8. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Haha thanks.
    If Unity want it, by all means.
     
    florianalexandru05 likes this.