Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

[WIP] Advanced Skin shader

Discussion in 'Works In Progress - Archive' started by MaT227, Mar 23, 2016.

  1. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hey everyone,

    I wanted to share the current state of my advanced skin shader for Unity. Here you can only see the transmittance and the subsurface scattering (which are a bit exaggerated). I am currently working on those effects and the rest will come after.

    Hope you like it. :)

     
  2. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Great Job, i'll keep an eye of this thread.
    The noise is gif compression right? and is this in deferred or forward only?
    Just curious since haven't find a way to make the transmittance work.
     
  3. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    @rea Thanks, as this is work in progress there are several things to do.
    For the moment, lighting is calculated per vertex and not per pixel and there are still some noise on the edge of the light which needs some tweaks :)
    This is forward rendering for the moment but there shouldn't be any problem to convert it to deferred.
     
  4. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi there,

    I've just made a rapid test with simple PBR lighting. Here is the result. Quite happy with the normal details and how it behaves with the SSS. :)

    test.jpg
     
  5. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I'm pretty curious of what technique you're using (Jimenez' SSSS?) and, more importantly, about ways you hook into Unity's rendering pipeline as I'm struggling to do that myself. Disclaimer: I'm author of PreIntegratedSkinShader, so there may be some conflict of interest if you plan to sell it on the asset store. Feel free to keep your secret sauce secret ;)
    I'm experimenting many things myself: grabpass, commandbuffers on lights, deferred with interleaved pixels. All with it's pros and cons (read hacks). If only we had source like with Unreal Engine or CryEngine :rolleyes:
     
  6. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi @cician,

    First, I would like to thank you for your disclaimer this is nice from you even if I already know you and your work on the PreIntegrated Skin Shader, which is really great ! ;)

    To answer your question, I am using the Jimenez SSSSS method and there are no secret sauce, I am only following the method.
    But as you say, there are pros and cons and for the moment there is still a lot of work to achieve something user friendly. There are also a lot of issues which needs solutions even if the screenshot is encouraging.

    I am mainly doing this to learn and, depending on the result, I don't know if I am going to make it open source or sell it on the asset store. Anyway, I'll be glad to continue talking with you about the SSS topic. :)

    And yes this would be cool to have access to sources :p even if I find the Unity engine really open and highly customizable.
     
  7. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Oooh and did you manage to make the diffusion profile to work? I don't really get that part on how to render multiple diffusion profile in screen space (or it seems that i missunderstood that part)
     
  8. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    No particular problem about making the diffusion profile to work, the hard part is as you said to make multiple diffusion for different materials but I have some ideas about that ;)
     
  9. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hey everyone,
    Here is a very early result with specular and sss. Still a lot to do. :)

    skin.jpg
     
  10. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Looking good man.
    i'm still wondering how you manage to get the transmittance from separable sss to work in unity
     
  11. etaxi341

    etaxi341

    Joined:
    Oct 4, 2013
    Posts:
    64
    Wow man that looks amazing! :) Keep working on it! :) Will you sell it on Assets Store?
     
  12. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I have some questions. Sorry if it seems like some police questioning, but I can't help it :p
    Are you implementing it in a pixel shader or compute?
    Do you use a fixed blur kernel or some weighted sampling like explained here.
    Do you hard-code the diffusion profile in the shader?
    For translucency, do you access Unity's shadowmaps? I thought it's only possible to get the real shadow depth on select platforms (like D3D11), correct me if I'm wrong.
    How many blur levels do you use? Btw, I think the bumps are too sharp in the last screenshot.

    Myself I'm experimenting with SSS in Sparse Voxel Octrees, but it may not result in anything practical in the end, unlike what you're doing here.
    If you're going to release it on Asset Store, it'll probably be more popular than my shader. Otherwise, if you decide to make it open source then I'll happily contribute. Don't except too much from me though, I'm not exactly a shader guru despite how it may appear ;)
    Anyways congrats. The results are pretty promising so far.
     
  13. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Thanks, I don't know if I make it open-source or release it on the Asset Store.

    No problem @cician, thank you for your kind words. :)
    Pixel shader wit a fixed blur kernel for the moment.
    Nop.
    Yes, only DX11 for the moment :( but I have some ideas about making it available for DX9.

    I would be glad to see the results of your SVO research. For the moment I am not convinced by my port the effect because this is currently not practicable too but it's not complete and there's still a lot to do.
    For the moment I am thinking about making it open-source but if I can achieve something reliable and stable I'll think about releasing it on the Asset Store. It's too early to decide.

    BTW : I really like your pre-integrated shader because it's a very good balance between performances and quality. :)
     
    Last edited: Apr 4, 2016
    looki666 likes this.
  14. DxStd_IgnatPribylov

    DxStd_IgnatPribylov

    Joined:
    Sep 24, 2015
    Posts:
    30
    Hello! Any news?
     
  15. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    Hi @DxStd_IgnatPribylov,
    Thank you for your interest but I currently don't have time to work on it but I'll go back to this project very soon :)
     
  16. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628
    I am slowly coming back to this project and here is the next thing I've added.

    New shadow system from nvidia PCSS. It provides valuable cues about the relationships between objects, with shadows becoming sharper as objects contact each other and more blurry (softer) the further they are apart.

    unitypccs.gif
     
    Last edited: Dec 21, 2016
    id0, ikazrima, punk and 3 others like this.
  17. Reanimate_L

    Reanimate_L

    Joined:
    Oct 10, 2009
    Posts:
    2,785
    Lol, i just see this on PC.
    Very nice man
     
  18. MaT227

    MaT227

    Joined:
    Jul 3, 2012
    Posts:
    628