Search Unity

  1. Unity 2017.2 beta is now available for download.
    Dismiss Notice
  2. Unity 2017.1 is now released.
    Dismiss Notice
  3. Introducing the Unity Essentials Packs! Find out more.
    Dismiss Notice
  4. Check out all the fixes for 5.6 on the patch releases page.
    Dismiss Notice
  5. Help us improve the editor usability and artist workflows. Join our discussion to provide your feedback.
    Dismiss Notice

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

    40 vote(s)
    26.1%
  2. realism

    67 vote(s)
    43.8%
  3. ease of use

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

    40 vote(s)
    26.1%
  1. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
  2. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    267
    This is awesome you should include a video link and webpage demo on the asset store page also are there any special maps needed and any tutorials on how to create them if so?
     
    Last edited: Feb 26, 2013
  3. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    Thanks, i'll do so. Check the manual in the package it explains what's needed, though there are no tutorials on how to make them.

    Also there's an old test file that remained in the project "phong tessellation.shader", it wasn't supposed to be there in the initial upload. I'll delete it with the next update. Just to avoid confusion.
     
    Last edited: Feb 26, 2013
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Is there documentation with this...? This is EXACTLY what I am looking for in a skin shader... it looks REAL AS F**K...and for 20 bones, this is a steal

    Will this work in Unity 3.5 and above?

    EDIT: Never mind, it's Unity 4 only, would LOVE this for 3.5 :D
     
    Last edited: Feb 26, 2013
  5. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    267
    would be great if you had a cloth shader to complement it
     
    Last edited: Feb 27, 2013
  6. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    It works in Unity 3. We have uploaded update just now, it will be available in few days. The demo scene is now simplified, it won't look this good, but if you want I will post entire scene (without the shader of course) if you want. We have in plans hair and clothes shaders too, it will take some time so be patient. Video tutorial coming soon :)
     
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Well, my prayers are answered... will the skin shader detail look similar to the demo of the head...? And this is a STEAL... so I could buy this asset now, and it would be cool...? And I would definitely love to see what maps I need to paint and so forth
     
    Last edited: Feb 27, 2013
  8. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Skin shader looks the same, the difference you will notice between Unity 3 and 4 is in lighting and shadows quality.
    Unfortunately I had to remove all effects on camera, because it was causing incompatibility with Unity 4 pro effects. Importing asset, replaces all effects with older ones from package. This causes a lot of errors and warnings. So yeah it won't look this good, but as I said before if you want I will post demo scene with all effects on camera included. I asked my team mate to upload only shader and post 2 demo scenes separately for Unity 3 and 4 here, but he didn't agree with me. :-x
     
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Oh ok, that is cool... the only effects I will be using in my project are Bloom, HDR, and Motion Blur... you just made my bday weekend even more fun... The only thing now is to find out how many maps I will need... and it this shader simple to use
     
  10. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    We will try to make a video tutorial soon, so probably you will have a lot of fun when we post it. But do not overwork yourself on a bday, hahaha...
     
  11. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Well, it's on sunday, and I am about to purchase this asset now, hoping it will run...
     
  12. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Not sure if you can download it, because it was uploaded from Unity 4, if you wait about 2 days, you will be able to get it from unity 3. We are just waiting for unity guys to upload it to store. You should get 1.0.1 that is prepared for unity 3. I will post reply here when it is available. Be patient :)
     
  13. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    267
    Glad this works in unity 3 will be purchasing as soon as I put some money on my card
     
  14. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    New version is now available for Unity 3.5.
     
  15. thinksquirrel_josh

    thinksquirrel_josh

    Joined:
    Feb 8, 2011
    Posts:
    1,086
    Been using this shader for a project - it looks phenomenal! Great stuff =)
     
  16. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    That was quick ^_^
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Purchased! ^_^

    And I have a suggestion already, would it be possible to just use RGB for gloss and alpha for Specular... I really don't want to do damage to my already painted gloss maps...
     
    Last edited: Feb 28, 2013
  18. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    So, looks like everything works for the most part... would just have to repaint my textures for it to work... I think it would be better if we could have Spec as an RGB (a lot of my textures are like this) and the gloss set in the alpha channel...and a separate depth texture. Even though it save performance, I honestly feel more comfortable with more control...
     
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Here is my review of your shader: :)

    "I bought this shader on a whim after seeing a demo of it in action... I LOVE how good the shader results are and how quicky I was able to get realistic results, but I do not like that the channels that I need are embedded in R G B... and I know it is to save performance but it is a real pain to paint a very nice and detailed specular/gloss map only to paste all of it into a channel :(. I would make the gloss (RGB) and Specular (A), and the depth map put it in the alpha of the diffuse channel :)"

    Overall, I am super impressed...
     
  20. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    I too hate combining diffrent textures toghether, it's a tradeoff.
    I could make a variant with separate textures, though i'm not sure if it'll work on SM2 (instruction limit). I'll take a look when i'm back from work.
    So it would be:
    - diffuse (RGB)
    - specular level (RGB) + glossiness (A)
    - depth (R)
    That adds separate speculars too so i'll have to valuate how it fits in...

    Edit: by specular level and glossiness i mean what it usually means in 3d packages, unity folks call the former gloss. Or do you actually have glossiness per channel?
     
    Last edited: Feb 28, 2013
  21. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    I would set the depth texture in the alpha of the diffuse... and reserve that for SM 3.0-5.0. in my set up i have separate gloss and spec textures, since my gloss texture has the alpha channel set for local reflections... (i come from a CGI background and i rather take a small performance hit and have complete control of my models appearance.) The gloss and specular maps take longer to paint and i dont want my work ruined with combining textures. So i'll take the small hit on performance.
     
  22. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Actually I hate to have ANY map in alpha, it's a pain in a*s, to modify it in Photoshop. For me it was easier to put them in RGB channels, this way i just keep original textures and open sgd.png, when i do a little modification on any of them I just paste them into a correct channel, i think it's a fast workflow. I know it would be pretty nice to have all of them separated, but it takes a lot of performance hit.
    PS: Big thanks for a review, we are glad you like it :D
     
    Last edited: Feb 28, 2013
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    I really like how this works... as for the performance hit, in my unique situation, I definitely need the textures separate for complete control. do you think you could made a modified version for me? the gloss/spec setup works quite well since I copy the finished spec map into the alpha when I'm done. and the depth texture in diffuse is the only exception. I'm making a fighting game and performance will not be an issue.can u get the shader to work with deferred rendering? just found out it works in forward.
     
  24. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    It works fine with deferred lighting, but there is a huge bug in unity, when you use SM5 with tessellation (only in unity 4) some normals are flipped, and there are holes in object. At first we thought it was some driver bug, but then we tried it with different video cards and it persisted on both, ati and nvidia.
    And yes we can make another version with separate maps. It will take some time and testing, (maybe around the end of the weekend), but I can't promise it yet. Oh and I was thinking about specular COLOR map and not only specular and glossiness I will see what we can do :D
     
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Perfect! and I use colored gloss and spec maps with IBL. Your shader is cryengine 3 quality
     
  26. 3d_Artist1987

    3d_Artist1987

    Joined:
    Jul 9, 2012
    Posts:
    496
    very impressive!!
     
  27. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    We can't use it in deferred lighting ?
     
  28. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    128
    Hi,

    your skin shader is amazing ! i got realistic result very quickly.
    ( even if i'm not yet as realisitic as your demo scene, need more fine map tweaking...)

    +1 for specular color map !

    regarding the alpha channel subject, it does not bother me too.

    and you can have alpha channel in a png file and be able to update it easily :
    when opening a png with transparency in photoshop, go to layers / layer mask / from transparency; and your alpha channel is back in the layer mask.

    Responding to samson : you can't use the SM5 tesselated version of this shader in deferred lighting :(
    very disapointing, hope this can be resolved in the future.

    but i'm anyway very happy of my purchase :)
     
  29. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Just the SM5 ? What about SM2 and 3 ?
     
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    With SM 2 3 i don't think there are any issues... and I can't wait to see the next update. I am having these guys create a modified version of this shader specifically for my project... I would rather take a slight performance hit with complete detail control versus stuffing detail texture work into one file.
     
  31. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    Regarding deferred lighting:
    This shader is always rendered in forward mode. You can enable deferred lighting so the rest of the scene is rendered in deferred mode.

    The problem is, at the moment there's a bug in Unity's Direct3D11 renderer (or in the surface shader compilation process for DX11).
    The bug appears when following conditions are met:
    1. Direct3D11 is enabled in project settings.
    2. Deferred lighting is enabled in project settings.
    3. The object receives shadows.
    4. The shader has only forward lighting function, modifies vertex positions and is not disabled for shader model 5. Which is the case for tessellated version of this shader.
    I have yet to fill a proper bug report, in the meantime you have to give up on either tessellation, deferred lighting or shadows and join my whining here.

    tl;dr
    Shader Model 23 are not affected, even with DX11 and deffered enabled in project settings.


    I'm working on abstracting the textures channel setup with preprocessor defines, which allows to create variants with any desired setup. Included will be one with all the textures separately and maybe one described by Neptune_Imaging with RGB specularity map.
    Even if, in my not so humble opinion, RGB spec map doesn't make much sense.

    I did some rough benchmarking:
    The version with all textures separately is slower than the current setup by ~1.5% (w/o tessellation).
     
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    It is a habit of mine... when I used mental ray, I would always tint the specular a bit..to emulate skin. so you can leave out the coloured specular for the skin, no one is going to really notice. And a small hit, I can live with, in my game only the fighters will have skin shaders, NPCs will not... Is there a way in the shader to make the skin feel softer? I was messing with the diffuse bump and it looked REALLY nice... Is this shader derived from Uncharted 3?
     
    Last edited: Mar 2, 2013
  33. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    I already did the RGB spec part, so stay tuned.

    For the most part it's based on Eric Penner's homonymous method described in his presentation.
    Though I decided to use a depth map instead of the curvature calculated in the shader.
     
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    I remember this one... :) awesome presentation... is a depth map better?

    EDIT: And I am probably pushing my luck, but will this work with Beast? I am also using IBL and GI in my game...
     
    Last edited: Mar 2, 2013
  35. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Thank for you answer cican.

    Could you make a short tutorial on how you made the gloss/spec map in your 3D modeler software Photoshop ?

    Also, how to deal with a character with some part you don't to be rendered as skin ?
     
  36. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    Depthmap gives better control, but has it's disadvantages. Perhaps the biggest one is having to draw it in the first place. Second, it's not dynamic, which would be handy for facial expressions.
    I couldn't get the curvature approach to work good enough.
    It's main drawback is its flat per triangle, so it looks OK only on really smooth meshes. In theory there's ddx_fine instruction which shoud make it smooth, but it doesn't seem to work in surface shaders. Tessellation doesn't seem to help either. Maybe there's a way to make it do the magic, but I didn't want to depend on D3D11 anyway.
    Second, no fine control for the artist. This could be compensated by a mixed approach, but it kinda kills the purpose.

    As this is intended for dynamic objects I'm explicitly disabling static lightmaps, so the beast is left outside the fence. If I'm doing something wrong, let me know.

    As for IBL, there's nothing like that currently. Maybe in 1.1.
     
  37. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    Maybe, though I think there should be enough resources already on the net as this is the same thing you need for offline rendering. I'll consult the pixelophile of my bro~ that made the old-fart-head if there's any particular magic he added to his usual zbrush-fu other than adjusting brightness-contrast and combining everything to one texture.
    The documentation is lacking in regard so we'll likely extend it in a future update.

    One way is putting different materials per mesh or per polygon (see material id or similar for your 3D package). Though when you start optimizing stuff to avoid shader switches you probably should combine multiple shaders together. The thing is, to keep the shader general and slim I chose to do just the skin.
    Also the complexity executing this shader or branching in the shader could outweight benefits of batching, I'm not sure. You may want the cloths be rendered with deferred lighting, especially with a lot of lights.
    I'll play a bit with it and see.
     
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    No worries about static light maps... I use light probes :) and keeping the shader DX9 is good for me... i dont have unity 4 and plus there is no real visual difference... the depth maps can be edited anyway... just render the inverted AO map, bring it into photoshop, invert it, and paint. Thankfully my skin models are very smooth :)... and this shader will benefit...

    @Samsson: You paint your spec map/gloss map with shades of grey... the bright areas are shinier with a tighter high light, and dark spots do not register. And you just create a second material for the skin... one material for non skin, and a material for the areas of skin... :)
     
  39. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669

    Exactly this... this is how I work on my game models... my background is CG so this comes naturally
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    Okay, so I am reading through Penner's slides, and I saw the Diffusion Profile, would that be the Diffuse Bumpiness in this shader? So much great information to make your shader the most realistic one made in Unity.

    EDIT: A special tip for those using this shader... DO NOT USE MIP MAPS ON THE NORMAL MAP... THIS REQUIRES FULL DETAIL!! I just solved my pixelation issues.

    $Skin-Shader-Faceting.jpg This is the result of the normal mapping set to MipMap... turn this off and the faceting disappears... :)
     
    Last edited: Mar 3, 2013
  41. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    Part of the technique NEEDS mip maps active in the normal map. Otherwise weighted normals (the bumpiness sliders) won't work at all.

    You can try:
    1. Disable texture compression in the normal map importer settings. Select truecolor.
    2. Generate normal map with smoothing groups enabled
    3. If you're generating it in zbrush try smooth UVs checkbox

    $opcje normal mapow do unity.jpg
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    I'll try that... :) Nice icon btw, it looks cool. I've also been working on the gloss textures again in preparation for the new shader version... and i would like to offer my time to do a tutorial and help with the manual.


    EDIT: The pixelation is still there...
     
    Last edited: Mar 3, 2013
  43. sipon

    sipon

    Joined:
    Feb 8, 2009
    Posts:
    128
    hi Cician,

    have played further with your shader, and i'm totally in love with it !

    while i totaly agree with this, you can't separate everything, and in case of a head, you always want some hair on it ( even with some poly/transparent hair added over the head) , or eyebrow , barber...
    (i think about something like this :http://www.youtube.com/watch?v=i5syaXesYCc)

    Could be great to have a texture to mask rim lighting and avoid issue like this :

    $Tao_Skin_Rim.jpg

    Good luck for your work, can't wait to see more ! (particulary hair shader :) )
     
  44. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    I would model the hair onto the head, unless it's shaved... nice model btw... and I've also noticed that if you make your normal map crunchy, you will get a much better effect... I was reading a paper on Uncharted 2 and I saw how they did their skin, almost close to this shader... maybe you could glean ideas for that into your cloth and hair shaders...

    EDIT: Sorry Sipon, didn't see the mention of modelled hair :) I would love this too...
     
    Last edited: Mar 3, 2013
  45. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Some results :

    Before means use of bump specular shader et after use of skin shader :

    Skin Shader
    $SLVL1_After.jpg



    Bump Specular Shader
    $SLVL1_Before.jpg


    $SLVL1_SkinShader.jpg




    I have some trouble to make the gloss/spec/SSS map. This is why i would like a tutorial with the technique you explain a little in the documentation.
     
  46. napster

    napster

    Joined:
    Jun 15, 2012
    Posts:
    313
    Looks awesome Cician :)
     
  47. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    The gloss and spec maps are straightforward to create... you just paint them in photoshop onto the UV map. The Depth map is a bit more involved, and requires you to invert the normals on both the high and low poly models... You could also bake a regular AO map and paint depth using gray values, but it is better to bake it in a 3D app or xNormal

    Here is the depth map after the bake:

    $Depth-Map-Intial.jpg

    After inverting in Photoshop (And you can edit this depth map with a low opacity brush, making it darker):

    $Depth-Map-Proper.jpg

    Here is an example of a gloss map... in the current version of the shader, you would have to paste spec gloss and depth into one image... but in the new one, it should be more straightforward. You would have to use Apply Image in each channel... and I think placing the Depth map as it's own input, (keeping it about 1k should help)

    $Specularity-Map.jpg
     
  48. Samsson

    Samsson

    Joined:
    Oct 12, 2010
    Posts:
    165
    Thanks you neptune,


    In my case bake a high poly whith inversed normal is just a suicide, my model is composed of severals parts and the main body is more than 10 millions polys, so pretty hard to import the .obj into max and then flip normals, export it to xnormal and bake it. So as i said, i am more interested in the vray technique explained in the doc, wich looks more possible to be realised.

    I don't thing that in the exemple the spec gloss was totally paited, i personatly never "paint" a specular or gloss map. In this case of course you must do it for parts like lips and ears.

    What do you call "depth" map, a heigtmap ?
     
  49. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,669
    The depth map is just an AO map baked outside-in... are you using ZBrush? And that method is used in Xnormal, invert the high poly in Zbrush...and the spec map was painted using a detail map as a base...
     
  50. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    230
    The "depth" map is the thickness of the object at any given point.
    It decides how much scattering and translucency is applied.
    The common method to generate it is with ambient occlusion bakin with inverted normals as described above.
    Alternatively it can be approximated with mesh curvature.

    There are some resources already on the net, though I realize it's not that simple.
    http://colinbarrebrisebois.com/2011/04/04/approximating-translucency-part-ii-addendum-to-gdc-2011-talk-gpu-pro-2-article/

    K. is working on some video tutorials, though I hear some screaming and swearing from behind the wall so it may take some time.