Planetside Software Forums

General => Image Sharing => Topic started by: KyL on October 17, 2019, 08:45:53 PM

Title: Skin shader
Post by: KyL on October 17, 2019, 08:45:53 PM
Okay so here is a new topic to talk about human skin. I am sure there will be some discussion around the subject so let's start with a few pictures:

Here is a pure glass shader I adjusted to mimic skin subsurface:
tgout-001 21m11s v4.4.38.1.jpg
There is no bump or displacement, this is a high resolution model.

Here is a couple of examples with lower resolution models. I mixed the above subsurface shader with a default shader:
tgout-004 34m30s v4.4.38.1.jpgtgout-001 17m41s v4.4.38.1.jpg

And here are the same in another lighting condition:
tgout-010 22m26s v4.4.38.1.jpgtgout-002 19m05s v4.4.38.1.jpg


So it's possible to achieve the subsurface aspect of the skin.
The issue at the moment is how to mix it with texture. Currently it looks like mapping a color image on the object UVs doesn't work with the volume color function. However it does work with the volume density function. Could that be a bug? ???

Anyway, in the above examples, I used a glass shader only for the subsurface effect, with reflection and caustics turned off. I then merged it to a default shader taking care of the diffuse, reflections and bump. Because of the two shaders are merged in ADD, I am pretty sure this breaks energy conservation and it is not physically accurate. But with a bit of work and proper geometry/textures, this should be doable.

Speaking of models, one is the courtesy of Lee Perry Smith, which can be found on the Arnold guide to skin shading (https://docs.arnoldrenderer.com/display/AFMUG/Guide+to+Rendering+Realistic+Skin). I found the other model here (http://www.sampleandhold.co.uk/downloads)
Title: Re: Skin shader
Post by: bobbystahr on October 17, 2019, 11:20:54 PM
Wow Kyl...a major step forward in skin...to this colourblind old pensioner it looks in the last iteration of the models, like you nailed it.
Thanks for the links as well!
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 01:34:34 AM
Quote from: KyL on October 17, 2019, 08:45:53 PMCurrently it looks like mapping a color image on the object UVs doesn't work with the volume color function.
That's what I noticed as well. Great you found, that it works with the density function. Thanks for your exploration. Looks fantastic!!
And thanks for the links as well!
Title: Re: Skin shader
Post by: Dune on October 18, 2019, 02:14:21 AM
Thanks very much, KyL. That answered my question at my thread. Off to explore again. It looks really good!
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 02:49:57 AM
I downloaded the Robert Harris model and tried to recreate your image, but it doesn't look right here. May I ask you about your pure glass shader render? Did you rescale the model, and what are your settings for the glass shader? I tried to apply an image map shader with the texture (Object UV) to the density function slot, but it doesn't seem to fit.
Title: Re: Skin shader
Post by: KyL on October 18, 2019, 08:56:45 AM
Thanks for the comments guys.

@Hannes, the glass shader is using a short decay, something like 2cm and density at 1. And yes, I had to adjust the model. It came in the wrong orientation and scale. Also some vertex and UVs were not merged properly. Oh and you need to rotate the texture upside down too. ::)
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 09:04:29 AM
Ah thanks, Kyl!

Quote from: KyL on October 18, 2019, 08:56:45 AMOh and you need to rotate the texture upside down too. ::)
Yes, I just realised that. ;)
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 09:17:06 AM
This is weird. No matter what I do, I can't get this smooth and natural look you had in your pure glass shader render. I tried to match your lighting, and I have the same model. I used a density of 1 (a bright fleshy color) and a decay distance of 0.02 (a more reddish color).
At the moment I'm rendering an animation with the decay distance animated from 0.01 to 0.5 just to see, if there's the right value somewhere in between.
Title: Re: Skin shader
Post by: KyL on October 18, 2019, 09:30:06 AM
This should help you:

<terragen_clip>
<glass_shader
name = "skin_subsurface_sh"
gui_use_node_pos = "1"
gui_node_pos = "880 1740 0"
gui_group = ""
enable = "1"
input_node = ""
gui_use_preview_patch_size = "0"
gui_preview_patch_size = "1000 1000"
double-sided_surface = "0"
reflectivity = "1 1 1"
reflection_tint = "1 1 1"
transparency = "1 1 1"
index_of_refraction = "1.33"
highlight_intensity = "0"
caustic_intensity = "0"
specular_roughness = "0.4"
specular_roughness_function = ""
decay_distance = "0.02"
decay_tint = "1 0.2158000022 0.2158000022"
volume_1_density = "1"
volume_1_colour = "1 0.8122000098 0.6941000223"
volume_1_density_function = ""
volume_1_colour_function = ""
volume_method_in_path_tracer = "2"
>
</glass_shader>
</terragen_clip>
Title: Re: Skin shader
Post by: KyL on October 18, 2019, 09:31:30 AM
Quote from: Hannes on October 18, 2019, 09:17:06 AMAt the moment I'm rendering an animation with the decay distance animated from 0.01 to 0.5 just to see, if there's the right value somewhere in between
I'm quite curious to see that actually! Also don't forget to increase detail as Matt mentionned in Dune's post. I rendered my tests at detail 0.5 with a ray detail multiplier of 0.5.
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 09:55:45 AM
Thanks a lot, KyL!!!! :) :) :) :)


Quote from: KyL on October 18, 2019, 09:31:30 AMAlso don't forget to increase detail as Matt mentionned in Dune's post. I rendered my tests at detail 0.5 with a ray detail multiplier of 0.5.

Oh, I missed that. That may be the problem. I'll post the animation asap. Probably it's worthless, since I hadn't set detail and RDM to these values.
Title: Re: Skin shader
Post by: Hannes on October 18, 2019, 10:32:40 AM
Workiiiiiing!!!!!! Thank you so much!!!!!
Title: Re: Skin shader
Post by: j meyer on October 18, 2019, 12:20:21 PM
Yay, cool experiments, keep it up guys.
Title: Re: Skin shader
Post by: KyL on October 23, 2019, 01:14:46 AM
Quote from: Hannes on October 18, 2019, 10:32:40 AMWorkiiiiiing!!!!!! Thank you so much!!!!!
You're welcome!

Here is an update with a high res mesh and a proper subsurface-only shader.
The color texture works when plugged into the volume color function, thanks to the changes in build .40!
Title: Re: Skin shader
Post by: KyL on October 23, 2019, 10:32:26 AM
Here is a first take on Digital Emily (http://gl.ict.usc.edu/Research/DigitalEmily2/)

After the early experiments above, I wanted to take things a step further and for this I needed better source data. Some of you might remember of this (https://youtu.be/piJ4Zke7EUw). This workflow has now been refined and developed by many VFX studios, always pushing the limits in terms of accuracy and fidelity toward realistic digital humans.

Anyway, this project shares its sources files for research purpose, and even though most digital doubles now rely on much better model and textures, this is still a solid base to work on. So here are a couple of renders with the same lighting scenarios as the previous tests.
digitalEmily_lookdev_v01.0001.jpgdigitalEmily_lookdev_v01.0002.jpg

Render times were between 2h30-3h for a 2k frame. What bugs me the most at the moment is that I cannot get a nice clean terminator when the light is a glazing angle. I will have to investigate that. Also  the ray depth is too short to have subsurface in the eyes, so I had to resort on diffuse for the eyeball. Lots of noise in the eyes too, which is sad considering how nice the caustics look! I will have to find a better way to control the specular roughness too.
Title: Re: Skin shader
Post by: Dune on October 23, 2019, 12:22:06 PM
Awesome!
Title: Re: Skin shader
Post by: WAS on October 23, 2019, 12:49:25 PM
Quote from: KyL on October 23, 2019, 10:32:26 AMHere is a first take on Digital Emily (http://gl.ict.usc.edu/Research/DigitalEmily2/)

After the early experiments above, I wanted to take things a step further and for this I needed better source data. Some of you might remember of this (https://youtu.be/piJ4Zke7EUw). This workflow has now been refined and developed by many VFX studios, always pushing the limits in terms of accuracy and fidelity toward realistic digital humans.

Anyway, this project shares its sources files for research purpose, and even though most digital doubles now rely on much better model and textures, this is still a solid base to work on. So here are a couple of renders with the same lighting scenarios as the previous tests.
digitalEmily_lookdev_v01.0001.jpgdigitalEmily_lookdev_v01.0002.jpg

Render times were between 2h30-3h for a 2k frame. What bugs me the most at the moment is that I cannot get a nice clean terminator when the light is a glazing angle. I will have to investigate that. Also  the ray depth is too short to have subsurface in the eyes, so I had to resort on diffuse for the eyeball. Lots of noise in the eyes too, which is sad considering how nice the caustics look! I will have to find a better way to control the specular roughness too.

I was using her yesterday but couldn't fix her eyes. Can you share how you did that?  Also mine doesn't have hair on her head from obj version and textures? O.o
Title: Re: Skin shader
Post by: KyL on October 23, 2019, 01:00:19 PM
Yeah the eyes are a pain... I had to offset in V the image map shader to get the iris and the eyeball textures at the proper size, then use a merge shader to merge both with a ramp and get the right iris size...  :-\ I wish I could have better eyes textures/models.

The hairs are in the raw color map, I realized they are here by mistake. They are probably less distracting than a bald head so I will leaves them here!
Title: Re: Skin shader
Post by: WAS on October 23, 2019, 01:14:05 PM
Quote from: KyL on October 23, 2019, 01:00:19 PMYeah the eyes are a pain... I had to offset in V the image map shader to get the iris and the eyeball textures at the proper size, then use a merge shader to merge both with a ramp and get the right iris size...  :-\ I wish I could have better eyes textures/models.

The hairs are in the raw color map, I realized they are here by mistake. They are probably less distracting than a bald head so I will leaves them here!

Offset in V the image map? I think I'm confused.
Title: Re: Skin shader
Post by: KyL on October 23, 2019, 01:17:40 PM
Yes, instead of moving the UVs of the mesh. I think they did this to have easy control over the iris size. This way you can animate the pupils too, which is quite clever
Title: Re: Skin shader
Post by: Oshyan on October 23, 2019, 02:22:48 PM
Wow, not bad at all! What Max Paths and AA/pixel noise threshold values were you using?

- Oshyan
Title: Re: Skin shader
Post by: KyL on October 23, 2019, 03:30:02 PM
Thanks. This was rendered at 10AA with the robust sampler at 1/16. Noise threshold 0.03 and 36 paths limit.
Title: Re: Skin shader
Post by: sboerner on October 23, 2019, 08:19:48 PM
Amazing! Keeping an eye on this, for sure.
Title: Re: Skin shader
Post by: Oshyan on October 24, 2019, 12:56:32 PM
Ah ok, interesting. If you get a chance, try AA8, 1/64, same PNT or 0.025, and a higher path limit, maybe 100. Just curious if it would improve the noise levels without increasing render time (due to higher adaptivity). I am personally finding that increasing max paths doesn't increase render time as much as I would think, for a greater corresponding increase in quality.

- Oshyan
Title: Re: Skin shader
Post by: WAS on October 24, 2019, 01:10:15 PM
Quote from: Oshyan on October 24, 2019, 12:56:32 PMAh ok, interesting. If you get a chance, try AA8, 1/64, same PNT or 0.025, and a higher path limit, maybe 100. Just curious if it would improve the noise levels without increasing render time (due to higher adaptivity). I am personally finding that increasing max paths doesn't increase render time as much as I would think, for a greater corresponding increase in quality.

- Oshyan


Speaking of that are paths in TG representative of larger numbers? I've read up a lot of documentation on PT and most scenarios fires soooo many more paths than TG. Thousands.
Title: Re: Skin shader
Post by: KyL on October 24, 2019, 02:22:16 PM
Quote from: WAS on October 24, 2019, 01:10:15 PMSpeaking of that are paths in TG representative of larger numbers?
Don't forget that this is the number of paths per primary rays. So at 10AA 36 path you are giving a maximum budget of 10*10*36=3600 rays


I aksed the same question a while ago :)


Quote from: Oshyan on October 24, 2019, 12:56:32 PMtry AA8, 1/64, same PNT or 0.025, and a higher path limit, maybe 100
I usually use more path as well and less AA. However in this case I probably went the opposite direction for the eyes, the caustics being hard to sample. I will try your suggestion though!
Title: Re: Skin shader
Post by: Oshyan on October 24, 2019, 04:02:00 PM
I think it may work the reverse of what your intuition was telling you, i.e. for hard to sample caustics, you want more paths not (I think) more AA. At least that's been what my tests have shown me so far.

- Oshyan
Title: Re: Skin shader
Post by: DocCharly65 on October 25, 2019, 03:04:30 AM
Awesome Digital Emily renders!
Title: Re: Skin shader
Post by: KyL on October 27, 2019, 10:46:49 PM
Quote from: Oshyan on October 24, 2019, 04:02:00 PMI think it may work the reverse of what your intuition was telling you, i.e. for hard to sample caustics, you want more paths not (I think) more AA. At least that's been what my tests have shown me so far.

- Oshyan


Here is a render with 6AA, 1/65@0.025 and 100 paths. It is a little bit cleaner and it rendered twice as fast! Caustics aren't better though but still, great rendertime/quality ratio!
Title: Re: Skin shader
Post by: Dune on October 28, 2019, 02:46:10 AM
Terrific, and indeed very fast.
Title: Re: Skin shader
Post by: DocCharly65 on October 28, 2019, 03:44:25 AM
Crazy cool and realistic!
Title: Re: Skin shader
Post by: Oshyan on October 28, 2019, 04:17:43 PM
Quote from: KyL on October 27, 2019, 10:46:49 PMHere is a render with 6AA, 1/65@0.025 and 100 paths. It is a little bit cleaner and it rendered twice as fast! Caustics aren't better though but still, great rendertime/quality ratio!
Not bad! Matt may have a better idea about this with the caustics, but I would guess that AA6 is just too low to give enough samples in that difficult to sample area. You could test it in a small crop with "max samples" (non-adaptive). This might mean that lowering the PNT (pixel noise threshold) any further would increase render time unnecessarily (for other areas) without being able to solve that problem if indeed the max number of samples at AA6 could not resolve it. In that case try AA8 or even 12 with same adaptivity and adjusting PNT as-needed. If the Robust Adaptive Sampler is doing its job well, it shouldn't increase render time a crazy amount, only allowing for concentrating more samples in that eye area while not oversampling the rest of the scene that's already fairly low noise.

- Oshyan
Title: Re: Skin shader
Post by: Mid-Knight Acchan on March 18, 2020, 01:27:25 PM
Hello. I am exploring the images in this article.

Plugging the Image Map Shade into the "volume color function" does not get the effect of skin wrinkles (Displacement). The same goes for using Default Shader. I spent a few days on this question but could not get an answer.

Are there any necessary procedures?
Title: Re: Skin shader
Post by: Hannes on March 18, 2020, 01:53:28 PM
Just take a surface layer with your texture used for displacement, uncheck "Apply color", and put it behind the glass shader. Thus you have SSS and the displacement of your surface layer. It's not possible to apply displacement to the glass shader alone.
Title: Re: Skin shader
Post by: Mid-Knight Acchan on March 19, 2020, 01:04:20 AM
Thank you very much. understood. :-*
Title: Re: Skin shader
Post by: WAS on March 21, 2020, 03:47:24 AM
Quote from: Hannes on March 18, 2020, 01:53:28 PMJust take a surface layer with your texture used for displacement, uncheck "Apply color", and put it behind the glass shader. Thus you have SSS and the displacement of your surface layer. It's not possible to apply displacement to the glass shader alone.

Doesn't main input of glass feed displacement? That's what I always do. For example taking his default to main input of his glass?
Title: Re: Skin shader
Post by: Hannes on March 21, 2020, 04:31:07 AM
Quote from: WAS on March 21, 2020, 03:47:24 AMDoesn't main input of glass feed displacement? That's what I always do. For example taking his default to main input of his glass?
Could be. Haven't tested it. I think there are probably several ways to get to the same result.