Search Unity

Pre-Integrated Skin Shader - announcements and feedback

Discussion in 'Assets and Asset Store' started by cician, Feb 26, 2013.

?

What should I focus on for next releases

  1. optimizations and mobile

    43 vote(s)
    24.3%
  2. realism

    82 vote(s)
    46.3%
  3. ease of use

    8 vote(s)
    4.5%
  4. just fixes and compatibility, it's awesome as is and you better make a hair shader...

    44 vote(s)
    24.9%
  1. MegsTan

    MegsTan

    Joined:
    Oct 19, 2013
    Posts:
    55
    Hi,


    Sorry here are the image for comparison
     

    Attached Files:

  2. jellevda

    jellevda

    Joined:
    May 31, 2011
    Posts:
    3
    Hey there Cician,

    First off I want to say that I really love your shader, it looks beautifull. Recently we started porting our game to Xbox One and we've been getting some rather unpleasant warnings on PreIntegratedSkinShaderV2.0_combined. Unfortunately I'm not experienced in shader code, so I was wondering if this is something which can be resolved?

    Here's the log:
    Looking forward to your feedback. Cheers!
     
    Last edited: Jan 12, 2017
  3. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Although consoles are not officially supported as I don't have access to SDKs, I can probably make it work with a few tweaks.
    Could you please do the following:
    - Right click on the shader and click reimport
    - Check the console output. If there are any errors or warnings other than what you've already written, please tell me.
    - This one is a bit more of a hussle, but may help me quite a bit. Select the shader. In the inspector there's a dropdown "compile and show code". First click on the arrow and make sure the xbox one renderer is selected. Then click on the button. Copy the output from MonoDevelop/VS and send it to me in a private message.

    Thanks.
     
  4. looklzl

    looklzl

    Joined:
    Dec 23, 2015
    Posts:
    1
    Hey Cician;
    Does this shader work for MCS(morph 3d)? and unity 5.5?
     
  5. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    940
    Issue seems to have cropped up again, in 5.6.0b4. And same thing, goes away when switching Unity to Forward, even though this shader doesn't even render in deferred...
     
  6. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    940
    Fixed the problem @cician , You just need to change line 287 in "PreIntegratedSkinShaderCore" from:
    Code (CSharp):
    1. o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
    to:
    Code (CSharp):
    1. o.pos = UnityObjectToClipPos(v.vertex);
    Since they changed some things with how that worked. I guess a version check will need to be put there to choose which.
     
  7. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Thank you very much @Invertex. I incorporated this change. Not using the UnityObjectToClipPos (introduced in Unity5.4) was potential cause of other bugs as well, esp. in VR.
     
    Invertex likes this.
  8. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    It appears that for any forward-rendered shaders to make AO work correctly with the beta PostProcessing asset, you need to select "Force Forward Compatibility" . This is true even for default new surface shader created by Unity, if you force it to to forward path (by adding exclude_path:deferred).

    Do you have issues with built-in image effects as well?
     
  9. MegsTan

    MegsTan

    Joined:
    Oct 19, 2013
    Posts:
    55
    Hi Cician,


    Thanks for the tip :) I'll give it a try. Will test more to see if everything works ok :)




    Regards,
     
  10. aflatau

    aflatau

    Joined:
    Oct 7, 2015
    Posts:
    23
    Any idea how to fix this issue here: Any time I have a point light on character using this shader I get this:



    Any clues on how to address this issue?
     
  11. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Hi. I'll need some more information. I'm guessing the issue is the overall flat appearance of the skin.

    Please expand the internals part of the material inspector and check if there are any texture slots not plugged in. Also check if the Diffusion Profile slot is set. If in doubt, just select the default Caucasian profile.

    What is texture resolution in quality settings (full res/half res..)? There's currently a known issue with the shader when it's not set to full resolution (I'm working on it).
     
  12. aflatau

    aflatau

    Joined:
    Oct 7, 2015
    Posts:
    23
    Textures are at full resolution(4k)

    Here are screen shots of the material inspector:



     
  13. ppaneter1

    ppaneter1

    Joined:
    Feb 10, 2017
    Posts:
    1
    Hi!

    Shader PreIntegratedSkinShaderStandard fails to compile for ios with error: "
    Shader error in 'Skin/PreIntegratedSkinShaderV2.0_Standard': invalid subscript 'boxMax' at Assets/PreIntegratedSkinShader V2.0/PreIntegratedSkinShaderCore.cginc(925) (on glcore)

    Compiling Vertex program with DIRECTIONAL
    Platform defines: UNITY_NO_SCREENSPACE_SHADOWS UNITY_ENABLE_REFLECTION_BUFFERS UNITY_PBS_USE_BRDF2 SHADER_API_DESKTOP UNITY_HARDWARE_TIER3 UNITY_COLORSPACE_GAMMA"

    Unity version 5.5.1f1

    Workaround: in file PreIntegratedSkinShaderCore.cginc in line 885 replace #if UNITY_VERSION < 540 with #if 1.
    AFAIUI this code defines specular component only.
     
    Yamin-Hplus likes this.
  14. benjcooley

    benjcooley

    Joined:
    May 3, 2014
    Posts:
    45
    Hi..

    We've been using your shader for quite a while, and have a few questions and comments. However to start off with I'll post some pics from our project to give you an idea as to how well your awesome shader is working.

    Screenshot 2017-03-24 11.54.58 copy.jpg

    Screenshot 2017-03-24 11.54.06 copy.jpg Screenshot 2017-03-24 11.54.40 copy.jpg
    We are having some issues though and perhaps you can help us...

    1. There is no way to add wrinkle maps right now. We will probably go ahead and modify the shader to add this feature, but if you are already adding wrinkle map support let us know and we'll hold off.

    2. Energy conservation: It doesn't look like the shader conserves light energy in a way that matches the Unity standard shader - or possibly it is not getting all of the light inputs that Unity shaders are getting. Essentially this means that given different lighting situations, the skin in the scene will either be too bright or more frequently way way to dark compared to the "standard" shaders that are next to it (for example the shirt here).

    What this means for us is that we have to light the skin on a separate layer, and add about three point lights per character, and animate the intensity of the lights as the character moves through the scene to make the skin look realistic in an ordinary scene.

    We usually have issues here when characters go into strongly lit, or dimly lit environments.

    3. Very difficult to dial in the scattering, specular, translucency settings. Essentially we've done this above using just a very long process of trial and error. We don't know what the physically correct ranges are for each slider, and we have no idea beyond checking the demo model, and just moving things left/right until it starts to look better. The above shots look "good", but still not perfect. We are using photo reference to try to dial it in a bit closer.

    As for this character.. if anyone is interested:

    - Eye Advance for eyes (asset store).. This shader also takes some serious tweaking, and eye brightness has to be carefully animated in a scene to avoid cases where eyes are either "spooky" because they're too light or too dark.

    - NVidia Hairworks.. Obviously in these shots the hair has not yet been tuned, and there's no self/model shadowing yet, but we have some other shots of this model from a bit later where the hair is perfect. It's actually pretty remarkable you can do hair now in realtime like this. We've obviously taken the Japan Unity's hairworks repo, and actually fixed it to work in Unity 5.6.

    - SE Soft Shadows - For any photoreal rendering in Unity, you've got to replace the nasty unity shadows with this shader. In fact there's no reason IMO to not just use this shader everywhere on everything as it's awesone.

    4. Forward rendering with 8x MSAA and HDR (Unity 5.6) with the new postprocessing stack - in this case just a bit of color correction.
     
    neoshaman likes this.
  15. benjcooley

    benjcooley

    Joined:
    May 3, 2014
    Posts:
    45
    Just thought I'd also post a video..





     
    Last edited: Mar 31, 2017
    KRGraphics likes this.
  16. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    The fix for this is coming to the asset store, currently in review.
     
  17. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Thank you for sharing. Seeing your work encourages me to keep advancing this asset. I'll give high priority to fix any energy conservation related bugs, but I may need some help in reproducing the issues. I need to know some of your graphics settings and light setup. For starters:
    forward/deferred shading,
    linear/gamma rendering

    I'll write some more specific questions tomorrow. And again, thanks for feedback.
     
    neoshaman likes this.
  18. benjcooley

    benjcooley

    Joined:
    May 3, 2014
    Posts:
    45
    Forward Rendering
    Gamma Lighting (Though we're switching to Linear)

    Global illumination for BG scene
    Light probes
    Reflection probe (static - box)

    The thing we were thinking of doing was to place several simple geo (say a sphere) materials next to the same geo mapped with the skin, and just compare it's response to lighting under different circumstances (point, spot, directional - light probes, reflection probes, gi, ambient, etc).

    We're thinking it might be a combination of the features we're using in the scene.

    --------

    On another subject, these characters come with a full set of wrinkle maps that we'd really love to plug in. We were thinking of modifying the shader to add support, but you mentioned you might be working on that soon.
     
  19. benjcooley

    benjcooley

    Joined:
    May 3, 2014
    Posts:
    45
    We're getting better results with the new changes to the Eye-Advance shader for eyes in getting our eyes to more closely match the total energy of the surrounding rendered mesh. Any progress on looking at checking on how to make sure skin matches up in various lighting conditions?

    If you'd like we could privately send you some of our models for you to test with. This might be the best way to help you out.

    Thanks!
     
  20. ywj7931

    ywj7931

    Joined:
    Jun 24, 2015
    Posts:
    41
    Thank you very much for your shader!
    We want to render asian women's face, can you give some advice on how to prepare for the assets?
    We want asian face like following with smooth skin, bright skin, a little blush on the cheek,
    So We are thinking to make relativly flat depth map, and makeup on specular map, is there anything else we should optimize like diffusion map?
     
  21. dzodzu

    dzodzu

    Joined:
    Nov 25, 2012
    Posts:
    46
    Hello everyone. I've been asked many times how I make the depth maps for the skin shader, so I decided to make a small tutorial for Substance Painter to help you all.
    Here you go:
     
    KRGraphics, tryptic and twda like this.
  22. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    Hello!

    As I have already discussed with @cician in private, I would so much like support for transmission maps.
    The author of the popular and amazing Knald map baking application pointed out that he will not allow the creation of thickness and depth map.

    Here is what he said:


    I would therefore like to ask if the authors of pre-integrated skin shader (which I love sooooo much) would create an additional version that supports transmission maps instead of flawed thickness maps.

    @cician suggested using Knald's transmission map with some tweaks, but I never got it to work, it never looked realistic whereas I have produced great results with the old thickness maps.

    But I don't want to use an old technique, I would rather like to step forward and use Knald's transmission maps. They require no setup at all, they simply bake within less than a second. The above screenshot shows what it produces: A totally realistic view of transmission.

    The pre-integrated skin shader should be able to allow us using it.

    Thank you for your consideration.

    Maybe you can add this option to your poll.
     
    Last edited: May 25, 2017
  23. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,668
    What is teh result of knald? greyscale or sh map?
     
  24. Buquet

    Buquet

    Joined:
    Aug 13, 2015
    Posts:
    11

    a have some problem with reenabling spot light.
    translucency and specular not shadowed.
    switching light into mode "with shadow" and turn back temporary fixes bug.
     
  25. GeorgSchmidt1980

    GeorgSchmidt1980

    Joined:
    Oct 27, 2015
    Posts:
    13
    I would also like to use Knald transmission maps.
     
  26. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    What is an SH map?
     
  27. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,668
    SH = spherical harmonics, code low frequency directional contribution using 7 floats per point. Basically a gray scale has no concept of direction, but thickness can change depend on that. SH map are used in some game to code the directional data of light (see the last of us).
     
  28. Diegoale2000

    Diegoale2000

    Joined:
    Sep 16, 2008
    Posts:
    70
    Thank you so much for such a wonderful shader. Here's a WIP of our character using your shaders. (Also, this is a mobile project)
     
  29. tryptic

    tryptic

    Joined:
    Nov 13, 2012
    Posts:
    54
    Just wanted to say thanks creating this great set of shaders. They've really helped us on our game project. Please keep up the awesome work!

    Best regards, -Heinz
     
  30. ludddddd

    ludddddd

    Joined:
    Sep 10, 2015
    Posts:
    10
    Hi!

    Unity 2017.1 iOS with deferred rendering path:

    UnityObjectToClipPos function call was already added by unity on upgrade.
    Any idea what went wrong?
     

    Attached Files:

  31. Invertex

    Invertex

    Joined:
    Nov 7, 2013
    Posts:
    940
    Mobile platform doesn't support deferred pretty sure.
     
  32. ludddddd

    ludddddd

    Joined:
    Sep 10, 2015
    Posts:
    10
  33. ludddddd

    ludddddd

    Joined:
    Sep 10, 2015
    Posts:
    10
    I found a cause of my problem (few posts up).
    In deferred shading mode forward-rendered objects are rendered to depth texture with SHADOW_CASTER pass.
    This skin shader uses VertexLit shader shadow path. Which adds small shadow bias to geometry. And this leads to the bug.
    @cician, please replace vertex lit shadow caster pass reference with some simple copy of vertex shader.
     
    twda likes this.
  34. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    82
    When is this ever going to get the update with normal detail mapping? :p
     
    Jerome-P likes this.
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    Hey guys... so I haven't used the new version of this shader and I'm wondering what the new changes are? Are the controls the same as version 1? And is this physically based...
     
  36. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    This is impressive!!! I haven't used this shader in a long time (I use Amplify Shader Editor and Alloy), but I may go back to this if there is some way to customise it for use with Amplify. Possible, @cician @dzodzu?
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    You can bake a thickness map in Substance Painter and invert the results. I have a tutorial that goes in depth of making it
     
  38. twda

    twda

    Joined:
    Oct 25, 2012
    Posts:
    111
    I tried so long to automate the process of the map creations, and I nearly went crazy because I had to jump back and forth in different programs.

    I just wanted to tell everybody who's interested that I finally found a good solution.
    Knald 1.2.1 provides all the maps necessary to bake the required maps ultra-fast and in amazing quality. Not like waiting 2 days for xNormals to bake not-so-good maps.

    Knald is on sale (or he permanently lowered the price?, I don't know), so I bought it, and it works just great.

    For depth / thickness map (which Pre-Integrated Skin Shader requires) you can simply use Knald's transmission map (which is a more realistic version of Depth / Thickness).
     
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    I have a knald license and it bakes VERY FAST, especially for transmission maps. I also bake with Substance Painter and it bakes out a near perfect transmission maps that I can edit as needed.
     
  40. Abuthar

    Abuthar

    Joined:
    Jul 12, 2014
    Posts:
    91
    Would anyone here know if it is possible to get this shader working with SEGI? I am willing to pay for a solution, but nobody seems to have one!
     
    ksam2, Jerome-P and b_game_studios like this.
  41. b_game_studios

    b_game_studios

    Joined:
    Aug 16, 2017
    Posts:
    12
    Yes, SEGI compatibility, please!!!!!
     
    Abuthar likes this.
  42. Jerome-P

    Jerome-P

    Joined:
    Apr 14, 2015
    Posts:
    34
    @KRGraphics Kashif, could you show your faster way of creating a depth / thickness map with a YouTube video?? That would be a big help!
     
    KRGraphics likes this.
  43. Jerome-P

    Jerome-P

    Joined:
    Apr 14, 2015
    Posts:
    34
    Can the authors of Pre-Integrated Skin Shader support transmission so we can do everything in one baking program like Knald?
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    It's pretty straightforward in Substance Painter (if you have it). Just bake your map as normal and invert the results using a levels node. You can also paint on it too, and add veins and capillaries.

    @dzodzu made a short video on how this is done.
     
  45. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,975
    And same with Knald... it's brutally easy. Just import your high res, low res mesh, enable transmission, bake, enjoy
     
  46. neoshaman

    neoshaman

    Joined:
    Feb 11, 2011
    Posts:
    4,668
    The author has been responded in ages
     
  47. Alvarezmd90

    Alvarezmd90

    Joined:
    Jul 21, 2016
    Posts:
    82
    Yeah, guess he abandoned it.
     
  48. daliang2018

    daliang2018

    Joined:
    Aug 22, 2017
    Posts:
    10
    I read your discussion from the beginning.
    Can you tell me in detail how to make the textures needed with knald?@twda
    I tried to import the daz3d model into the unity, but they led poorly.
     
  49. d-ralph

    d-ralph

    Joined:
    Sep 11, 2017
    Posts:
    8
    If anybody is interested:
    The normal map of jijii to me didn't look like it's a "normal" normal.
    I had somebody investigate on it, and he confirmed that it's X+Y+Z+, so it's what Unity expects.
    Just in case anybody else wondered about it.
     
  50. daliang2018

    daliang2018

    Joined:
    Aug 22, 2017
    Posts:
    10
    KANLD can generate the following map:


    The texture required for the plugin is as follows:

    Diffuse Map(RGB)==Color map ??

    Depth / thickness map(R)==transmission?how to use?

    Normal Map==Normal Map

    Skin Mask(R)

    intensity Map(RGB)

    glossiness Map(R)

    Occlusion texture==AO?But, I get the AO map is more profound than the demo, can I use it directly?

    I have a closer look at the pdf document, but as an independent game producer who does not use the substance painter, it is very difficult to understand the meaning of these maps and make it out with a program.

    Can anyone tell me that I can use it directly on the basis of KNALD or use PS to make the map needed for this plugin?

    Detailed description or can google words, thanks!