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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

► Subsurface Scattering Shader ◄

Discussion in 'Assets and Asset Store' started by Arkhivrag, Sep 20, 2014.

  1. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Try changing all unity_ObjectToWorld variables inside shader to _Object2World.



    VacuumShaders - Facebook Twitter YouTube
     
  2. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    Hi @Arkhivrag!

    I'm considering buying this shader for a VR project. Does it support the single-pass stereo rendering method?
     
  3. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Currently can not test myself, but do not see the reason why it should not.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Feb 18, 2017
  4. nickpettit

    nickpettit

    Joined:
    Dec 31, 2013
    Posts:
    33
    Update: Purchased and I can confirm this works with single-pass stereo in VR. And it performs really well, too!
     
    Ony and Arkhivrag like this.
  5. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,423
    Hi.

    @Arkhivrag

    Does it come with shader source code? I want to try on the consoles and it is too risky to buy/use assets that doesn't come with the source.

    Also can you let us know how well does it perform? Some simple comparison to other types of shader would be fine. For example it is more or less 2x slower than standard Unity shader etc.

    Thanks! you work is awesome!
     
  6. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Shader source code is included.
    Performance is excellent. Package includes more than 200 shaders with various optional features. Even mobile compatible.




    VacuumShaders - Facebook Twitter YouTube
     
  7. castor76

    castor76

    Joined:
    Dec 5, 2011
    Posts:
    2,423
    Thanks for the reply.

    Are they any other additional setups going on with this shader? For example, some other additional camera rendering per object with scattering shader etc.? So if I have 3 objects in the scene that uses the shader, there is another camera rendering from say.. light point of view etc?

    How many different kinds of lights does it support and how many lights? Does it work in deferred mode?
     
  8. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    No additional setup is required.
    SSS shaders are rendered and have same behavior (supported light types and their count) as Unity built-in Legacy shaders.
    SSS shaders use Forward rendering even if camera is targeting Deferred mode.



    VacuumShaders - Facebook Twitter YouTube
     
  9. r3ndesigner

    r3ndesigner

    Joined:
    Mar 21, 2013
    Posts:
    143
    this shader works good for skin?
     
  10. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    443
    Does it work with any kind of 3d model and any mesh? Or does it have any kind of limitation in some way?
     
  11. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Depends what type of skin you need. Mostly - No.
    SSS shader was not developed for using as Skin shader.



    VacuumShaders - Facebook Twitter YouTube
     
  12. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    No limitations, works with all type of 3d models.
    If using mobile Per-Vertex shaders mesh with more vertices will produce better results.


    VacuumShaders - Facebook Twitter YouTube
     
  13. SpaceRay

    SpaceRay

    Joined:
    Feb 26, 2014
    Posts:
    443
    Thanks for your good news
     
  14. ryo0ka

    ryo0ka

    Joined:
    Sep 27, 2015
    Posts:
    37
    @Arkhivrag This seems a nice asset for only $10. Does it support PBR setup? Metalic map, Specular map, etc like the Standard Shader?
     
  15. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    SSS shader uses Lambert/BlinnPhong shading model.
    Metalic and Specular maps are not supported.



    VacuumShaders - Facebook Twitter YouTube
     
  16. Vel_1828

    Vel_1828

    Joined:
    Apr 12, 2014
    Posts:
    52
    Hello! I am aiming to but this asset for a Low Poly style environment. Do these shaders need any external work to be made (I read something about transparency maps etc.) or is it all calculated/baked in Unity editor or in realtime?

    Also, are SketchUp models fine to be used with this asset?
     
  17. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    No external work is needed. But as with all materials, more texture data you provide better final results will be.
    upload_2017-12-15_16-33-6.png

    If SketchUp models work with Unity materials, then no problem to use this shader.



    VacuumShaders - Facebook Twitter YouTube
     
  18. Vel_1828

    Vel_1828

    Joined:
    Apr 12, 2014
    Posts:
    52
    So if I understand correctly, if I had, for example, several low-poly buildings made in SketchUp (it's a simple tool for basic modeling, no real texturing or mapping inside), then I would have to manualy draw a map of translucency in Photoshop and then map it on the model somehow?

    Are there any tutorials of how to draw such a translucency map? (I mean the principles, as I assume it's just a black-while image where white means "translucent" and black means "solid"?)
    PS: Or simplier and less time consuming - are there any external tools which could calculate and save such a map automatically, instead of drawing it by hand for each building?
     
    arumiat likes this.
  19. AM-Dev

    AM-Dev

    Joined:
    Aug 5, 2015
    Posts:
    31
    @Arkhivrag, thanks for your awesome asset.
    We've got this prototype scene for an AR project. We use two cameras. The one inside the magnifier is using the global fog setting (red fog for now). It seems the shader doesn't support the global fog. We're using the "VertexLit (Mobile)/LightCount 2" shader

    2018-03-08_124048.jpg

    I read here that it can be added in Unity 5: https://answers.unity.com/questions/1068035/fog-not-working-in-my-own-vertext-shader.html
    Is it possible to add this to your shader? Can you help us implement it? Thanks
     
  20. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Update will be available tomorrow.



    VacuumShaders - Facebook Twitter YouTube
     
    AM-Dev likes this.
  21. AM-Dev

    AM-Dev

    Joined:
    Aug 5, 2015
    Posts:
    31
    Amazing, thanks for the fast reply and implementation!
    Have a nice weekend
     
  22. JenniB

    JenniB

    Joined:
    Feb 15, 2018
    Posts:
    62
    Hello :)
    I am new the world of shaders and want to know how to use your shaders correctly. In my folder I have the following shaders:

    upload_2018-7-13_16-13-35.png

    So this shaders i can use in my materials? And by applying these I can archieve this SSS effect?

    Thanks :D

    Jenni
     
  23. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Use materiel editor to change shader. Do not use drag-and-drop.



    VacuumShaders - Facebook Twitter YouTube
     
  24. JenniB

    JenniB

    Joined:
    Feb 15, 2018
    Posts:
    62
  25. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    333
  26. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
  27. hungrybelome

    hungrybelome

    Joined:
    Dec 31, 2014
    Posts:
    333
    Gotcha. I'm actually using the standard render pipeline, just with textures from that asset pack converted to SRP PBR formats. I'm using the Standard shader double sided cutout for my vegetation atm, but someone recommended a SSS shader for vegetation that can make use of a thickness map. Basically was just wondering if your SSS shaders take a thickness map as an input.
     
  28. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Thickness (translucency) map is supported.
    Shaders are not double sided, but you can add Cull Off manually.



    VacuumShaders - Facebook Twitter YouTube
     
  29. multimediamark

    multimediamark

    Joined:
    Mar 17, 2017
    Posts:
    30
    Quick question: Does it work on Oculus VR?
     
  30. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Yes.



    VacuumShaders - Facebook Twitter YouTube
     
    multimediamark likes this.
  31. multimediamark

    multimediamark

    Joined:
    Mar 17, 2017
    Posts:
    30
    I noticed that models that have this shader applied only receive shadows from directional lights, is it supposed to be like that?
     
  32. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Shader uses custom lighting model that can be constructed only in Forward rendering mode. In this mode Unity gives enough info in shader.
    In Forward rendering mode Unity generates only directional light shadow and SSS shader receives it.

    Point/Spot light shadows are generated in Deferred rendering mode, but Unity does not give enough info in shader to construct SSS lighting model. So Deferred shadows are not supported by SSS :(

    However, there is option to generate all shadows in Forward rendering mode. It makes shader heavier but you can try it yourself:
    1. Open shader file and find line with - #pragma surface surf TransPhong
    2. Add ' fullforwardshadows' at the end of that line.
    3. Save shader.

    Personally I'm not satisfied with such shadowing result and do not provide it in shaders, but you can give it a try.



    VacuumShaders - Facebook Twitter YouTube
     
  33. cosmologosaurusrex

    cosmologosaurusrex

    Joined:
    Jul 1, 2015
    Posts:
    49
    Great shader! Can I have transparency with this shader? I select Render Queue: Transparent and lower Main Color Alpha but nothing happens. Thx.
     
  34. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Package includes Transparent shaders.

    upload_2019-5-9_11-51-43.png



    VacuumShaders - Facebook Twitter YouTube
     
  35. cosmologosaurusrex

    cosmologosaurusrex

    Joined:
    Jul 1, 2015
    Posts:
    49
    Alright, thx! Its a small bummer that if I chooce transparent/reflective/specular then both the refStrGloss and Transparency are controlled by the same alpha value in the main texture.
     
  36. modjun8

    modjun8

    Joined:
    Apr 18, 2018
    Posts:
    2
    Hi, I got a weird issue :
    I made the scene using baked lightmaps and your shader. All looks perfect in the Scene and Game view.
    But when I build the game and play, all other materials are looks fine but just objects which Vaccum shader used are missing the lightmaps. somebody help me please
     

    Attached Files:

  37. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    SSS effects needs light position to calculate its normal direction and interaction vector with a mesh.
    Baked lightmap is just a texture and there is no info about light positions. Instead of regular lightmap try baking Indirect Lightmap.
    upload_2020-2-12_19-19-30.png




    VacuumShaders - Facebook Twitter YouTube
     
  38. AlexisDiStefano

    AlexisDiStefano

    Joined:
    Dec 31, 2016
    Posts:
    4
    Hello! is there a way to use a Metallic Roughness map? I must say that if not, this asset does not fit my project at all, I bought it because in the reviews you can find peoplestating that they used it for skin, but without metallic roughness enhanced properties, the skin looks flat and way unrealistic, thanks!
     
  39. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Metallic Roughness map is not supported.



    VacuumShaders - Facebook Twitter YouTube
     
  40. AlexisDiStefano

    AlexisDiStefano

    Joined:
    Dec 31, 2016
    Posts:
    4
    Can I get a refund? this asset is totally useless for my project. Bought it because the reviews stating it can be used for that, but actually not, thanks
     
  41. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Send me your asset purchase invoice to support@amazingassets.world



    VacuumShaders - Facebook Twitter YouTube
     
  42. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    78
    Hello Arkhivrag,

    Question about this asset. Want to use it in 2019.4 with UWRP.
    But somehow i cant get it working.

    Created a new project.
    imported VacuumShaders SSS
    opened scene 1. Torusknot
    verified working
    imported package UWRP
    created UniversalRenderPipelineAsset and UniversalRenderPipelineAsset_renderer
    assigned it to scriptable render pipeline settings in project settings/Graphics
    Edit/render pipeline/Universal Render Pipeline / Upgrade project materials ...
    Now everything is purple...


    Is 2019.4 supported (and what should i do to get it working) or if its not working, any plans / eta?

    Best regards.
     
  43. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    SSS does not support Universal and High Definition render pipelines.
    Shaders support only Standard render pipeline (as written in the description).

    Currently updating SSS for Scriptable render pipeline is not planed. Just very busy with similar updates for other assets.



    VacuumShaders - Facebook Twitter YouTube
     
    Last edited: Jul 1, 2020
  44. gpvd

    gpvd

    Joined:
    Nov 2, 2013
    Posts:
    78
    Ok. Thanks for your awnser.
    Best regards
     
  45. Vsion-Studio

    Vsion-Studio

    Joined:
    Oct 7, 2019
    Posts:
    3
    Hi! The asset looks awesome but is it compatible with skinned mesh renderer or only works with static meshes?
     
  46. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Any type of meshes are supported.
    Note, shader works only in builtin (Standard) render pipeline.



    Amazing Assets - YouTube Facebook Twitter
     
  47. anton88pro

    anton88pro

    Joined:
    Jul 20, 2017
    Posts:
    61
    Hello,
    I already own SSS and I'm also considering "Vertex Thickness" asset and wanted to know if SSS shaders can read the baked thickness from a mesh or do I have to use the "Convert Vertex Color To Texture" asset?
     
  48. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    SSS shader does not use mesh thickness data. Using it in texture format will not help either, unless you manually modify shader and make it to work the way you need.



    Amazing Assets - YouTube Facebook Twitter
     
    anton88pro likes this.
  49. alsomitra

    alsomitra

    Joined:
    Aug 31, 2017
    Posts:
    31
    Hey.
    I've already bought this.
    I want to use this in my mobile game.
    But this only has VertexLit(Mobile).
    Can you please add Cut out etc?
    Thank you.
     
  50. Arkhivrag

    Arkhivrag

    Joined:
    Apr 25, 2012
    Posts:
    2,830
    Bookmarked for the future updates.



    Amazing Assets - YouTube Facebook Twitter
     
unityunity