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. Rtyper

    Rtyper

    Joined:
    Aug 7, 2010
    Posts:
    416
    I love how nice this shader looks, it even works well on non-human skin colours (with some changes to the lookup images). I'm having a weird Unity 5 bug though, I know you're working on a full Unity 5 update, so maybe this will be fixed then, but using the new full deferred renderer, I get this artefact on the shading (By the chin):
    Bob Head Problem.PNG
    But it goes away if I switch to the Legacy deferred renderer:
    Bob problem Legacy.PNG
    Do you know what might be causing this? Is there anyway I can fix it, or do I just need to wait for the update? :p
    Thanks!
     
  2. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    You'll love the diffusion profile feature in 2.0 then :)
    profiles.png

    I don't know. Can try a few things to pinpoint the issue?
    1. Does it happen in forward rendering as well?
    2. Are there any artefacts without rim lighting? Or without specular?

    If anything fails, would you mind trying 2.0 beta?
     
    KRGraphics likes this.
  3. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    508
    I am waiting eagerly for the update. Your asset really is the best that I have ever purchased.
     
  4. ikemen_blueD

    ikemen_blueD

    Joined:
    Jan 19, 2013
    Posts:
    313
    any news on the Mobile support yet?
     
  5. OfficialHermie

    OfficialHermie

    Joined:
    Oct 12, 2012
    Posts:
    508
  6. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I gave it a try today. They use the same underlying principle based on Eric Penner's Pre-integrated Skin Shading Siggraph presentation, but our implementations differ considerably since I've implemented some features only vaguely described or mentioned in that presentation and mixed in some other techniques, like back scattering. I consider my shader quite a bit better, especially if comparing the still unreleased 2.0, but I may be a bit biased here :p
    The thought of donating the shader or collaborating with U.T. crossed my mind at least once. The asset is covering my beer and coffee expenses at least, so I'd love to make it available for everyone, but maybe not for free.
    And I assure you I consumed way too much beer and coffee while looking at these virtual baldies over the weekends, to the point my mum started to make jokes about it :eek:

    Since I'm writing here I can as well write a little update, but I'm lazy so here's just a screenshot.
    I'm almost done feature wise and need some more testers.

    pss2_material_inspector.png
     
  7. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    While mobile is not officially supported as part of 2.0 update I'm working on making the shader more scalable. The thing is, for a mobile version I need to cut many features, and with each cut, my heart bleeds.
    Depending on the target platform you can use it already, especially if you make a good use of light probes and limit real time lights to bare minimum.
    New devices come with GLES3.x, where full featured shader can run. Though you may want to limit shader features anyway for acceptable frame rates.
    Older hardware use GLES2.0, where I can either display a very limited shader, like current Shader Model 2 fallback, or go multi-pass and make the performance even worse. I'm currently working on precisely this so depending on how it goes it may look almost as good as V1.1 Shader Model 3 or far far worse with about three passes per light.
    Also I'll probably never have resources to test dozens of mobile GPUs floating around. I only own a Galaxy S3neo (Aderno GLES3) and an old Tegra2 based tablet. Buying i* devices seem to involve selling kidneys so I stop at ensuring it compiles for metal and assume it's good:rolleyes:
     
  8. Gerschill

    Gerschill

    Joined:
    Jun 12, 2015
    Posts:
    29
    I would so much like to get an update! Thanks!
     
  9. Gerschill

    Gerschill

    Joined:
    Jun 12, 2015
    Posts:
    29
    I would even purchase it again and pay 50 dollars for it. Your skin shader is just amazing.
     
  10. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    @cician,
    do you have an ETA for version 2 stable?
    Thanks in advance.
     
  11. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    I would also like to chime in and say here here to that!

    I cant really look at any other skin shader yours is just so good...
     
  12. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    I am digging this diffusion profile... although I am using Alloy, I would love to test this out
     
  13. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    Well, hit me up man... I have plenty of high detail assets to test out on this thing... and if this is PBR, I would also make a shader for programs like Substance Painter
     
  14. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    +1 on the substance painter shader... since unity is now targeting parity with substance designer in the next dot release... love this shader... itching to try it out!
     
    KRGraphics likes this.
  15. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    the only reason I am not using this shader in my work because the development halted... and stopped working. Now I have a chance to use it again. I wish and hope this shader can work in a deferred pipeline...
     
    Licarell likes this.
  16. Licarell

    Licarell

    Joined:
    Sep 5, 2012
    Posts:
    434
    I'm hoping it will work with any pipeline frankly....o_O
     
  17. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    And I have alloy. I'll still use this shader especially if it looks THIS good
     
  18. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Actually I'm finally on vacation from my day job for three weeks starting from yesterday. I'm doing some slight refactoring, final touches and bug squashing, lots of, bug squashing. I'll be pushing significant changes to beta testers during this week, so depending on feedback I may submit to Asset Store in a week or two.
    I know I went out of the radar for a while, but this time I'm dedicated to finish it. Future releases should be less disruptive and more timely.

    Hi again! If you want to try the beta, you're more than welcome. Keep in mind though, there are some known issues with brightness and see-through that I fixed, but haven't gotten to push into the repo yet.
    The shader to use is Skin/PreIntegratedSkinShaderV2.0_Standard, others are empty stubs and V1.1 just for comparision.
     
    Licarell, KRGraphics and mkgm like this.
  19. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
    Wow!!!
    Version 2.0 released.
    Thanks so much!
     
  20. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I wanted to reupload a small fix before announcing officially, but yep, it's 2.0. It's there.
    If you download and the version is 2.0 (as opposed to 2.0.1) uncheck /StandardAssets and /Editor folders on import, otherwise Unity may misbehave. It stopped compiling scripts altogether in our testing, when downloaded from the asset store. So I'll resubmit without image effects.

    One note regarding 2.0: there's no tessellation for now. I'm taking my time to decide what to do with it, since the way it worked in 1.x was pretty bad for performnce.
     
    richardvertigo likes this.
  21. richardvertigo

    richardvertigo

    Joined:
    Dec 19, 2012
    Posts:
    12
    It was a long wait but definitely worth it!! Shader looks really nice! Great work.
     
  22. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    2.0.1 is available on the Asset Store.
     
  23. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    Nice. Is this shader physically based? I'd love to use this with Substance Painter
     
  24. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Yes. It's energy conserving and the specular model is GGX. The workflow is similar to the standard shader (the specular setup version).
     
  25. KRGraphics

    KRGraphics

    Joined:
    Jan 5, 2010
    Posts:
    3,990
    Nice. Now you just need non skin and eye shaders
     
  26. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
  27. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I've downloaded the blacksmith character pack and played around a bit. It's refreshing to change the head once in a while, enough with baldies!
    Found a bug in the process and fixed it. You may notice some spurious light that shouldn't be there in some cases. The fix will go into 2.0.2 and into the repo later today.
    pss_blacksmith3.png pss_blacksmith2.png pss_blacksmith5.png

    Also looked a bit into the their wrinkle map thing. Sadly it won't work with PSS. I wasn't expecting it to work in the first place, but just wanted to let you know. The pre-integrated technique, and in particular the classic forward shading approach has its limits.

    On the top of the head:
    - Just activating tessellation shader stages, without actually tessellating has a pretty heavy performance hit. In deferred you incur it once, so it's acceptable, but in forward it's per light.
    - Penumbra scattering is pretty hard to get right in forward and requires high quality shadow maps. In other techniques (TSD, SSSSS) it's implicit so you "get it for free".
    - Detail and wrinkle maps are incompatible with reliance on mip-maps for blurring, which I do it heavily. Also just the cost of sampling all the stuff per-light is prohibitive.
    - It took me a looong time to get the Spherical Harminics scattering right. Again, not necessary with other techniques, as you just blur the result of lambertian SH.

    So in name of transparency there aren't many new features I can squeeze in this asset. I'll may add some specular related features. At least a secondary specular lobe. Haven't looked much into flow maps yet, but that would be nice as well. I planned to reintroduce tessellation as well, but I'm still not sure if it makes sense, since the performance can be better with just a higher poly mesh compared to plain tessellation in forward shading.

    In other words, to get anywhere near the other side of uncanny valley requires a different approach. And that would mean a separate, more pricey asset, because if I decide to do it at all, it would chug years of my weekends in never-ending R&D.
     
    Last edited: Sep 13, 2015
    ThunderTruck likes this.
  28. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    Thank you or testing it out anyway!
    Do you have any different ideas on how to integrate Wrinkle Maps?
    I love how your shader looks, especially compared to the Unity one, but convincing facial animation still relies on Wrinkle Maps, I'm afraid.

    Also, is there a way to use RenderTextures as a Normal Map replacement temporarily?
    We talked about this, and you said that it's problematic since the shader uses mipmaps to blur things and RTs don't use mipmaps by default. I tried activating them, but it didn't quit work out.
    (This is for a character creation system - I generate the temporary textures in a shader to make the game respond faster, and only save the real textures after the user confirms the character. In the meanwhile, the camera creates a RenderTexture from a plane with the mixed texture on it, and this RenderTexture is used in the shader. Works for everything aside from the Normal Map, as it can not be marked as Normal Map and thus cannot use UnpackNormal.)

    I'd also pay for that "seperate, more pricey asset" since you create convincing quality content, but I guess multiple years are a bit much and sound pretty frustrating for you. I wish Unity would start to support you in a way so that you could spend more paid time on this.

    Thank you for your hard work!
    - KW
     
  29. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Some limited wrinkle maps *can* be done. Simply weighting between two or three complete normal maps could probably be an acceptable cost for some (remember, per-light). Not feasible on SM2/GLES2.0.
    I'll study more the requirements to decide.

    @KWaldt
    In general case one wouldn't want to create temporary textures, unless going all-out with a "Texture Space Diffusion" approach.
    In your case it shouldn't be an issue. The missing piece is to atcually generate the mip maps, as marely enabling mips on the RT won't do that for you.
    I don't know if you can do it in real time with built-in functions, bu certainly possible with shaders.

    Have to go now.
     
    KWaldt likes this.
  30. jaelove

    jaelove

    Joined:
    Jul 5, 2012
    Posts:
    300
    The wrinkle maps feature would be excellent especially if you can find a way to implement it for characters with facial rigs
     
  31. KWaldt

    KWaldt

    Joined:
    Nov 1, 2013
    Posts:
    122
    A wrinkle map implementation with two to three maps would be great, especially if one could mark zones (left eyebrow, right eyebrow etc.) with mask textures!
    Personally, as the consumer, I'd like something like the attached sketch--two mask textures with RGBA used (though I personally would be fine with one, and have the second one be flipped horizontally), and a corresponding slider for each channel. This would make it flexible enough for most people to use, since they can manipulate the sliders from a script and thus make it fit their facial rig (by either writing the wrinkle logic in Unity, or implementing it in the rigging software [e.g. make unskinned bones in Maya that are animated and limited accordingly and will act as drivers in the script (by using their rotation value as slider value)]).
    However, I believe you have more experience and that you will find the best solution for this problem, so I look forward to it!

    Concerning the RT problem:
    Hmmm.. But wouldn't want one to use temporary textures in the case of character creation? Maybe I'm doing it wrong, but I combined the textures using ReadPixels(), which did it's job, but with a slight lag [maybe there's a faster method?]. Which is fine for saving, but pretty annoying when the user needs immediate feedback as he's dragging a slider.
    But thank you for the thumbs up, I'll try to see what I can do about RT mipmaps.

    - KW
     

    Attached Files:

  32. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    ReadPixels can be slow since it does a round trip from from GPU to main memory and then back to the GPU in order to render the texture. The fastest way is to use the RenderTexture directly in the material. Then, for the actual gameplay you can convert the RT to a plain texture in order to take advantage of texture compression (see Texture2D.Compress, beware though as calling it can halt for several seconds, I assume).
    Frankly I thought you ware already using the RenderTexture directly, since ReadPixels() does generate mip maps by default. So something different can be at play. How does the problem manifest?

    Note that there's one requirement for normal maps (and since 2.0 for spec,gloss and occlusion maps as well) that is not documented: you need trilinear filtering for proper results. Unity's default is bilinear. Otherwise the blur level will pop and band, instead of interpolating nicely. I'll write this in the wiki later.
     
  33. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    Hi there,

    I am having a noob question :)

    I am trying to import some daz figures into unity and noticed that not all possible maps are available. Next to the diffuse map there is the normalmap and a bumpmap/heightmap, which I guess have to combine into a single normalmap?

    Additionally, there is also a specular map. Are this enough maps to produce realistic looking skin? ;)
     
  34. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Hi! If you haven't yet, please take a look at this section of the manual: https://gitlab.com/jbrothers/pre-in...public-wiki/wikis/preparing-necessary-content.
    For diffuse, normal, specular, glossiness and ambient occlusion maps, the requirements are similar to what you'd need for Unity's build-in standard shader (the specular setup), with some quirks to keep in mind for best results: uv density, texture import setting and amount of detail that should go into normal map vs into the mesh.
    The thing that is not so standard is the depth/thickness map.

    I don't know how Daz normal maps look like, but I guess you're right that you'll have to combine them. This skin shader currently only supports a single normal map, that should contain features from (loosely defined) medium-level details to wrinkles and up to skin pores, if desired. I recommend you try using just the main normal map first and try to get a grip on things, then proceed with how to deal with details.

    Let me know if you need more help.
     
  35. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    Thanks for the fast answer!

    Yes, I saw that section... that was why I was asking how the end result would look like as I don't have the ambient occlusion and glossiness maps, so I guess I could not generate the depth map either.
     
  36. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Glossiness map is pretty important (for specular) and there's no escaping it. Doesn't Daz use one? What resolution is the bump(height) map? If it's 16k by 16k or more, it's possible they derive glossiness from it. I'll try asking my brother, he may know.
    Ambient Occlusion map is completely optional, though it helps quite a lot to emulate soft shadowing and compensates for lack of shadowing from ambient lighting.
    Both AO and depth maps can be generated from geometry in xnormal or a DCC package like maya/max/blender (vray appears to be the weapon of choice).
     
  37. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    Glossiness map: I thought the specular map from DAZ might be used for this. Bump map has only 4k resolution... so I dunno yet how to get a good gloss map.

    Depth map: I think they have sub-surface scatter maps for this, which might work
     
  38. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    Dan_lala, sub-surface scatter maps are exactly what you need, but you will have to add a little more contrast to the textures. Those have TL in file names. Problem is with normal maps, you will need third party software to render model with bump map applied as displacement and render it out to normal map textures, it can be done, but it's a lot of work since DAZ uses multiple textures with overlapping UV, so each texture must be rendered separately. Don't take me for a word, but I think there are some texture packs with normal maps available on DAZ store.
     
  39. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    Thanks for the answer! Yes, they all have usually normal maps but they also have a bump map for extra detail. The conversion might not be thaat complicated, going to use their texture atlas to get the multiple textures into one.

    I am more worried about the gloss map. I could try to get it by myself from diffuse, but I guess this won't end so well... I might also have a roughness map somewhere from those models wich I could invert maybe. Any better solutions for this?
     
  40. K-JBrothers

    K-JBrothers

    Joined:
    Feb 27, 2013
    Posts:
    43
    I was thinking, maybe try to blur quite a bit and add brightness to bump maps, since those look close to what you need for glossiness.
    EDIT:
    To make lips glossy you would have to marque lips with lasso and add brightness to make it close to white.
    Anyway there is no escape from editing textures...
     
    Last edited: Oct 6, 2015
  41. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    I will see and experiment with your bump map idea in the next days. Will get back to you when I have results/questions! :)
     
  42. dzodzu

    dzodzu

    Joined:
    Nov 25, 2012
    Posts:
    46
    mkgm likes this.
  43. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    I played around with the shader and my sources for the face and now I don't know how to improve. Please recommend, here are some pics (just ignore everything else except the face).

    2.PNG

    1.PNG

    3.PNG

    4.PNG

    5.PNG
     
  44. mkgm

    mkgm

    Joined:
    Apr 10, 2015
    Posts:
    134
  45. Dan_lala

    Dan_lala

    Joined:
    May 14, 2015
    Posts:
    42
    Hi, thanks for pointing me to the youtube tutorials, I must have missed them before. Going to work on the maps in the next days, just wanted to know in wich direction as some of my current maps might need improvement too.
     
  46. ThunderTruck

    ThunderTruck

    Joined:
    Sep 25, 2013
    Posts:
    61
    @cician
    Hi,
    First of all your shader is amazing and I would use it in daz studio or Morp3D character in but,
    the there is a problem that only you can solve:
    It would be easy for you to add another mask to cut out parts of the body skin. This is because when you add other skinned mesh (clothes) often in animation the skin overlaps the clothes.
    the skin body mask is the solution that they use in Morph3d Shader (which it is a modification of Volund shader) but it's not comparable to your...
    And also...
    Can you re-add a tessellation versions so we can choose, even if they are under-performing?

    Greetins!
     
  47. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I can't tell much about the textures themselves from small thumbnails and final render, but so far they seem good to me.

    The most important thing now is the depth/thickness map.
    As mentioned earlier, you should have a texture from DAZ with TL in its name. Try putting it as depth map. You'll need to tweak brightness/contrast at least. Use the one in the manual as reference.
    Otherwise you can bake it.

    One you have the depth map in place you can setup translucency/backscattering.
    Usually you should leave translucency tint color white and tweak other sliders instead.

    To check if the normal map is good and to find best shader settings I suggest you disable temporarily diffuse texture and set tint color to grey/skin-orange-ish.
    This way you can better see the effect of blur range and adjust accordingly.

    Once you're satisfied with the results you may want to experiment with occlusion map, especially if you rely on IBL/probes.
    Getting it right may not be easy, but pretty rewarding. Try playing with brightness/contrast a bit. See the blacksmith character screenshots a few posts earlier for an example of how much it helps.

    You shouldn't have a need for skin mask in your case and don't bother with translucency tint map either.
     
  48. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    I'm guessing that what you mean by skin body mask is basically cut-out.
    Adding cut-out is relatively simple. What stopped me from adding support for similar smaller features 'till now is that I haven't found a good solution to manage optional features without shader variant explosion. I didn't want to count on the shader keywords feature because of an engine limitation that could result in support nightmare. I'll rethink of doing it anyway or maybe overcoming the limitation with a hack: switching shader ad-hoc from the custom material editor.

    Yeah, I understand there's value in tessellation for the workflow, like with subdivisions in off-line rendering. So,
    SHALL THERE BE TESSELLATION! That is.. it's planned for a 2.x point release. Maybe not 2.1 though, I'll see.


    p.s.: Frankly I took a break from the development since the moment I shopped 2.0 to focus on something else and regain some mental sanity (try working on one feature for two years straight :eek:), but I'll be resuming work on 2.1 soon.
     
  49. u3gt6o8

    u3gt6o8

    Joined:
    Jun 9, 2014
    Posts:
    17
    Hi,

    I recently bought the Shader and it really looks great. I having a small problem. To light my character in my scene, I am using 3 spot lights - one for key light, one for fill light and one for back light (which only highlight my character outline). For some reason the back light somehow effect the front face of the character (even though it is directed to the back of the character), giving it an extra light with a pinkish hue.

    Can someone tell me please what may cause this effect (or what am I doing wrong)?

    Thanks
     
  50. cician

    cician

    Joined:
    Dec 10, 2012
    Posts:
    233
    Welcome. If you switch to the standard shader does the problem disappear? Just to confirm if the problem is specific to the skin shader.
     
unityunity