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

    45 vote(s)
    24.9%
  2. realism

    83 vote(s)
    45.9%
  3. ease of use

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

    45 vote(s)
    24.9%
  1. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Hello guys, been busy... I had problems with recording video, 3dsmax causes me crashes of a recording program. I've been trying all day long and damn it. To make it simpler you can use ZBrush, when you have your tool selected go to Display properties in right shelf and check Flip. Then go to masking and mask Ambient Occlusion. Now you can just fill with black color, invert mask and fill with white of course you can blur mask to make it smoother before filling. Then you can flip normals back, and paint to tweak it. So basically you can do all barely moving from ZBrush. For specular intensity map i use values around 60 of gray, on lips around 150, for glossiness I use around 200 for skin and white for lips. You can paint them in ZB too, mask cavity, blur it and paint over for good results.
     
    KWaldt likes this.
  2. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I need some feedback, would you prefer the following change?

    As default make all textures separeated as this
    $separated.jpg
    Plus a tutorial (with example) on how to make a customized version with combined channels for a final optimized version to put in your game.

    Pluses:
    - a lot easier to start
    - easy tweaking
    - more future flexibility
    - less files, see below...
    - just makes sense

    Minuses:
    - approximately 1.5% performance drop (take with a grain of salt, also tessellated version adds a bigger overhead which makes it unnoticeable)
    - breaks existing material setup for people who already downloaded the asset
    - more documentation to write for me :rolleyes:

    Otherwise I was going to keep current shaders compatible and add more shader variants.

    Explanation: almost all the logic resides in the PreIntegratedSkinShaderCommon.cginc file and I can make shell shaders referring with some precompiler defines. Thing is, it's a bit of a pain to maintain too many files. Just think:
    (SM2,SM21DIR,SM3,SM5) x (spec/gloss/depth, all separate, spec/glos+depth in diffuse and what not).
    More shaders, MOORE SHADERS, TOO MANY SHADERS!
    Don't get me wrong, I'll do it if you say it's worth.
     
  3. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    I did a video how to create a depth map in vray
    https://www.dropbox.com/sh/bjmnxafz5qr6sv8/7Yhts6ynPM/depth map - vray method.avi?m
    there is a problem with cursor, when i tried with it, application just crashed, so better without than nothing :(
    Download the file so you can see a full resolution video.
    I will try to do a Zbrush method later, but for now i see there is a bug, when i flip normals in display it destroys my UV map, i think it didn't happen in older ZB, anyway i will try with reprojection and do a video if it works well.
    After this I will do videos for specular and glossiness maps, and maybe for MR depth map generation method, for those who don't know how to do that. Oh and for Samsson's information, example model was done 100% in ZB. Model was done from a sphere, retopologised and all painted by hand. And finally Depth map was rendered in Vray.
     
    Last edited: Mar 3, 2013
  4. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That is EXACTLY my work flow, minus the invert faces of ZB
     
  5. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Go for it... separate textures for me... I do a lot of detail texture work...this is TOTALLY worth it... also I notice that the models don't self shadow with point lights on the shader... but that is okay... and I will be more than glad to help you with documentation :)

    EDIT: I would make the gloss RGB as well and the depth looks good... it will register even when you paint.
     
    Last edited: Mar 3, 2013
  6. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Ok, I did a video how to make depth map in mental ray, two notes though, if you have 3ds max 2011 or below, you must apply "normal" modifier on object, because there is no option for inverted occlusion in occlusion map. And you should use very dark gray instead of black, because mental ray occlusion is darker.

    Mental Ray Depth Map generation
    https://www.dropbox.com/sh/bjmnxafz5qr6sv8/jHKGCAbjyb/depth map - mentalray method.avi?m
    Vray Depth Map generation
    https://www.dropbox.com/sh/bjmnxafz5qr6sv8/7Yhts6ynPM/depth map - vray method.avi?m
     
  7. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I may change the ranges to floats... the range sliders are very touchy
     
  8. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    The only problem with floats is that there are no limits. So we would need to add min and max values for each parameter in manual.
    Maybe we will add info in comments in shader itself of what you can change by yourself, without breaking it.
    We did some testing yesterday with all separated maps and it's almost ready. So in few days there will be an update so stay tuned :)

    EDIT: Finished videos for specular, glossiness and depth maps. Grab them if you need help.

    https://dl.dropbox.com/u/87428148/depth map - mentalray method.avi
    https://dl.dropbox.com/u/87428148/depth map - vray method.avi
    https://dl.dropbox.com/u/87428148/painting glossiness map.avi
    https://dl.dropbox.com/u/87428148/painting specular map.avi

    Final results should look like this:

    $maps.jpg

    Few notes:
    When I export maps from ZBrush I don't have to flip them vertically, because I use goZ and not standard import-export to obj method. This way object's scale, orientation and UVs are always preserved. When I'm done with maps I export model from ZB using goz to 3ds max, rig it and export to .fbx. Model should have smooth modifier added with correct smoothing groups, because ZB don't use them and you might get some strange edges on model. Normal map should be in 24bit png to avoid unity black splotches bug. That's it for now.
     
    Last edited: Mar 4, 2013
  9. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Definitely...the reason why i was asking about floats, is because in my other shaders, I have a float constant that is set to 1 for my maps, and i can just paint away... looking forward to the new changes. Also the sliders for specular intensity and roughness would be negated anyway in the image texture. Like have a FloatConstant of 2 (keeping it private) and letting the texture do it's job, it makes my life easier. :) And my offer to help on the manual is still open
     
    Last edited: Mar 4, 2013
  10. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hmm, I use tga normally, and I haven't had any weird issues... but I will try this out :)
     
  11. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    tga should work fine, important is the moment when you export them from zbrush, you can use all formats available but do not use jpg EVER. Basically i use png because I can use them directly in Unity, without any conversion. One thing though, you have to select truecolor in Unity to take full advantage of it, otherwise it will get compressed with lossy quality.
     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467

    That is what i do :D I am ALL about quality
     
  13. SevenBits

    SevenBits

    Joined:
    Dec 26, 2011
    Posts:
    1,953
    Wow, that's a kick ass shader dude.
     
  14. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Do you still have this problem? If so, make sure you dont't have texture interpolation set to nearest (or point or however they call it in unity) for any of textures.
    Also the shader kind of expects a high resolution normal map.
     
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I think i still do... i will test this out...

    EDIT: That was it :). Don't use Point filtering
     
    Last edited: Mar 5, 2013
  16. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    I'm glad you resolved that problem :) We didn't have much time to upload new version yesterday, hopefully we will make it today although manual is incomplete. Do any of you need a tutorial of how to combine textures for spec-gloss-depth (sgd.png) map?
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I will not be doing any kind of combining... I want to keep them separate... I am working on damage textures and I need the maps separate, but yes go ahead with the tutorial, I may do this in the future... and if you guys would like a demo model I will be happy to provide one :). I will probably show how to edit the depth map.

    EDIT: And I hope you don't mind that I change some of the parameters in the shader... I need floats on some of these settings. I HATE RANGE SLIDERS :p

    EDIT 2: Nevermind lol... I think you have an internal clamp already set
     
    Last edited: Mar 5, 2013
  18. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I hate range properties for their imprecision, and I hate float properties because you can't limit them to a range.
    Seems I'm not the only one of this opinion and a future update of unity will feature a number box beside range sliders. See here (and yes, it's a skin shader made by Unity devs).

    Anyway I'm not convinced of changing to floats by default. To make things easy for starting with the shader I'm going to:
    1. keep range properties
    2. separate all the textures

    The manual will have a section on how to personalize the shader. It should be almost-understandable for non programmers and will include instructions for
    changing properties to floats,
    remapping the texture channels,
    enabling/disabling features (rims, translucency,RGB specular).

    And I may throw a rim mask into the mix.
     
    Last edited: Mar 5, 2013
  19. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Very nice man... and that shader looks incredible... and I would welcome numbers near the range. This setup reminds me of mentalray :). Is that in Unity 4? I would love to be able to use all of those maps if you are getting ideas :)... and Unity better fixed the deferred lighting bug, because i have a model that looks so ODD with glasses that don't self shadow :(


    https://dl.dropbox.com/u/158971/Blade/Blade Test Render/Head-Shader.jpg

    edit: Where is your icon from... it looks familiar but I can't put my finger on it

    EDIT: Will the separate gloss/spec textures override the specular and roughness values?
    View attachment 45840 $Head-Shader.jpg
     
    Last edited: Mar 5, 2013
  20. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    For those who want to control what will have scattering and what won't, if you add dark locations on your depth map, like hairs, freckles, follicles, you will get more realistic scattering...

    And for 2.0, I would love to have the epidermal, subdermal maps... and use the depth map for back scattering and choose the scattering colour...
     
  21. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Just to make things clear: the shader in the image is NOT mine, it's made by Unity developers and I found the image on a blogpost. It's the shader they made for the butterfly effect demo. It's using Texture Space Diffusion approach, which should give better results than Penner's method, but at a cost of performance.
    Also the number box is a feature of unity itself and will hopefully come to us in Unity4.1 or later (same for property categories). I edited the previous post to add missing words that may have led to confusion.

    tl;dr

    Who votes for subdermal map?

    Oh, good to know it works well on black skin too :)
     
  22. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Yup, i had a lot of fun working on this... and creating textures for brown skin has its own challenges.

    I would love a subdermal map... the main texture is for epidermal, and the depth map is for back scatter... and you can paint areas like hair that you don't want to have scattering at all... would solve stuff like that...

    I would welcome that... and I can't wait to see your new release...
     
  23. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    302
    Yes I would love a tutorial for combing the maps
     
  24. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    +1
     
  25. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    in your shader have some reflection property?
     
  26. TAGGEDGAMES

    TAGGEDGAMES

    Joined:
    Mar 6, 2013
    Posts:
    43
    Wow this looks amazing.
     
  27. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Unfortunately no reflections for now, maybe in future we will consider skyboxes. For now we have specular and glossiness only.
    I'm putting together tutorials on youtube channel.
    I will ask my bro to put the link in the first post.
    More vids are coming soon.

    http://www.youtube.com/channel/UCFTQkwfBWoNsM73YLq_Lv8w/feed?filter=2
     
  28. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    oh happy day :) And nice videos on combining the textures, it was easier than i thought... I will be honest, the gloss and spec maps could use some more detail :)
     
    Last edited: Mar 6, 2013
  29. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    thanks for your reply.
     
  30. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Any update on this?
     
  31. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I was pretty busy with my day job. Hopefully I'll be uploading a new version today.
     
  32. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Sweeet man... i spent a whole weekend doing newer textures just to play around :)
     
  33. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
  34. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey guys, still playing around with the skin shader... I think I got pretty close to being able to control the gloss and specular, and I am definitely awaiting your new version to test this further... And I have some feedback for you as well:

    1) The specular intensity and roughness sliders shouldn't be a necessity when the textures themselves should dictate how the surface will appear... I would keep the specular bump since that is a useful feature. In the specular and gloss input, when the texture is removed, it will render black (there is no specular)

    2) I am guessing you will want to set the depth map into a R channel, which is good, because you can just paint on it all of the little things that you don't want to scatter, like hair, eyebrows, freckles, etc.

    3) And for a future update, I would add a subdermal map which will compliment the diffuse (I'm calling it Epidermal)

    Here is a screenshot of the shader in action...at this stage the depth map was not edited, and it would be great to add stuff like blemishes and spots that will not scatter... more to come.


    https://dl.dropbox.com/u/158971/Blade/SkinShaderTest2.jpg
    $SkinShaderTest2.jpg $SkinShaderTest2.jpg
     
    Last edited: Mar 13, 2013
  35. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    It was just brought to my attention that you guys cut and paste into a final texture... you don't have to do that either... In photoshop just create layer groups call them, spec, gloss, and depth, and set the spec group to display the R channel, the gloss to the G channel, and the Depth to display the B channel...

    And just save out the texture with the groups visible :), and voila!! Special thanks to gsokol for this trick...

    EDIT: I also fixed the specular slider too :) range was set too high...
     
    Last edited: Mar 13, 2013
    KWaldt likes this.
  36. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Sorry that i was absent for a week, i had horrible problems with my pc. It started crashing all of sudden, i had to replace my RAM and set it all in BIOS because my motherboard didn't recognize them, and now i'm running prime95 to make sure it runs ok. But strange thing is that always one of the CPU cores were failing in prime and every time a different one, so it drove me nuts to nail what the problem was.

    Now back to topic... Your image looks pretty good, incredibly sweaty.

    Reason why i put maps to channels was for simplicity, in GIMP for example you can use another approach, just open all textures and go to menu colors - components - compose. You can use this method as you mentioned in GIMP too.

    And yeah you are right about the specular slider. We will fix that.

    Depth map will remain in a red channel, and we are working on a mask map, but it's not that simple to implement, because we have to apply a different material to masked places (not sure we will go with this approach in the end).

    We were just about to release update with separate maps, but we came up with another feature, we added translucency color map, so you can paint some veins and other creepy stuff on ears and other parts. Strength of it works with depth map, but for now it's not looking exactly like I'd like it to be so it's again in alpha stage.

    From now on I think we will add version number in shader list, and we will be including previous versions, so people who will do update won't be obligated to redo all textures.
     
  37. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    That sounds good... I already fixed the slider and set it's max to two... it looks very sweaty at max... take your time on the update... I got the shader working now :)

    And I feel your pain about the computer problems... I was having the same problems myself...

    EDIT: I also noticed that when you use Beast with this shader, the skin looks a HELL of a lot more softer and realistic :)
     
    Last edited: Mar 13, 2013
  38. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Hey guys... I am bumping this topic hoping that all is well... I think the idea of doing a separate gloss and specular version, I think you should keep it as a single texture (it is working as it is supposed to) and proceed to add things like a subdermal map... I have already fixed up the shader to my needs a bit, such as increasing the skin bump detail... and hair should be the next step :)
     
  39. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233

    Would you like to join testing?

    I have a few smaller things on my todo list and then maybe later I'll start hair. Considering the complexity of the subject I may go bald before it's done though.
     
  40. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    I will be more than happy to join testing... I am building models for my game which will look realistic... and I will build a new model to test the shader... since I learned how to use channels in photoshop, this has been easy for me :) I also have an old man model which I can use for testing...
     
  41. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I'll PM you later.
     
  42. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
  43. scarletsnake

    scarletsnake

    Joined:
    Nov 27, 2009
    Posts:
    106
    Hi;

    I'm on the verge of purchasing this shader, but I'm using Unity Free, and I would really appreciate it if you could post a screenshot of how the same scene looks in Unity 4 Free. I can't bring myself to buy it yet without seeing how it would look.
     
  44. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
  45. scarletsnake

    scarletsnake

    Joined:
    Nov 27, 2009
    Posts:
    106
    Looking pretty good! Waiting for dropbox to process the demo.

    Edit: Just went through the demo. Very nice, proceeding to the asset store. One last question, is there a seperate license for commercial usage, or does the purchase cover all licenses?
     
    Last edited: Mar 25, 2013
  46. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    Use it at your will :)... and hello @cician
     
  47. lilymontoute

    lilymontoute

    Joined:
    Feb 8, 2011
    Posts:
    1,181
    Just wanted to say that this shader is quite awesome.

    Here are some screenshots of some muscle tissue using the DX11 shader (currently adjusting the depth map some more):


     
    Last edited: Mar 26, 2013
  48. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    4,467
    This is EPIC...
     
  49. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    You're free to use it in commercial products under standard asset store EULA
     
  50. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233

    Lol. New use for the skin shader, though I’m not too surprised after seeing nice cloths made with it ;)