Planetside Software Forums

General => Image Sharing => Topic started by: Dune on October 11, 2019, 10:39:45 AM

Title: Subsurface scattering
Post by: Dune on October 11, 2019, 10:39:45 AM
Not a very good render, but I used the new SSS feature in the water shader of a build to come soon. I wanted the 1.5cm top layer of the mud to have some subsurface scattering, but I don't know if this was very succesful. Maybe I should do this completely different, but here it is anyway.
Title: Re: Subsurface scattering
Post by: Hannes on October 11, 2019, 11:08:08 AM
Maybe you should increase the decay distance to see an effect.
Title: Re: Subsurface scattering
Post by: bobbystahr on October 11, 2019, 11:32:48 AM
just gotta find the cash to upgrade...been waiting for this for a long while.
Title: Re: Subsurface scattering
Post by: Dune on October 11, 2019, 11:34:48 AM
Well, maybe I'm a bit dimwitted at the moment, but if I do that it'd be just water with a color, I'd say.
Title: Re: Subsurface scattering
Post by: Hannes on October 11, 2019, 12:19:57 PM
It's quite tricky to find the right balance between density and decay distance. The effect you want, might already be there, but I'm not sure, if this kind of mud sss is much noticeable in nature.
Title: Re: Subsurface scattering
Post by: Dune on October 12, 2019, 01:48:46 AM
Yes, that's probably right. I need something else to test SSS.
Title: Re: Subsurface scattering
Post by: sjefen on October 12, 2019, 09:53:37 AM
Very difficult to see the effect here. 
How about trying this on leafs on some trees?  :)


- Terje
Title: Re: Subsurface scattering
Post by: WAS on October 12, 2019, 05:50:10 PM
Why not try the flesh/meat shaders shared in the material library? Try to make them more "realistic"?

Leaves as mentioned would be a nice use, not sure how that'd go over with card-based leaves.

Water scum is another example that comes to mind. Algea on water, etc.

Are these features in Alpha or something? I haven't noticed them in current Frontier builds to even compare results.
Title: Re: Subsurface scattering
Post by: Dune on October 13, 2019, 09:17:06 AM
I'll think of something, but meat would be awesome. And it's the newest alpha/frontier, so not yet available.
Title: Re: Subsurface scattering
Post by: Dune on October 14, 2019, 09:02:39 AM
Okay, here's another imperfect PT SSS test. Eggwhite and egg yolk are 2 glass shaders with their individual SSS settings, onto shaders sitting on the planet (the pan has just been sunk into the globe a bit). It's a bit grainy (AA6), and I can't get rid of the yolk 'shadow'.
Title: Re: Subsurface scattering
Post by: Hannes on October 14, 2019, 11:33:55 AM
;D ;D ;D ;D  Fantastic!!!!
Strange shadow indeed!
Title: Re: Subsurface scattering
Post by: Dune on October 14, 2019, 12:18:42 PM
Yes, just tried again and made some changes (taken out the blackened butter), rendering now.
Title: Re: Subsurface scattering
Post by: WAS on October 14, 2019, 01:15:14 PM
Maybe try without any image post settings? I recently had to get a heightmap from a skull and found GISD in defer all or standard caused bizzare wrong shadows along the mesh normals (despite fixing normals or going to extreme mesh resolution from 28mb to 1.4gb and totally smooth.) Definitely a interp issue.
Title: Re: Subsurface scattering
Post by: Dune on October 15, 2019, 02:20:21 AM
There's a difference between defer and PT, as you can see here. Updated butter in pan.
Title: Re: Subsurface scattering
Post by: René on October 15, 2019, 02:46:03 AM
So I take it SSS only works on liquids? It probably only shows when the light really comes from behind like in a silouette (glowing ears). Ice and snow could be a good way to test it.
Now we have to invent another abbreviation for the simple shape shader.
Title: Re: Subsurface scattering
Post by: KyL on October 15, 2019, 07:09:46 PM
looks quite tasty actually!

"Updated butter in pan." This is the kind of thing that always makes me laugh :)
Title: Re: Subsurface scattering
Post by: Dune on October 16, 2019, 02:23:58 AM
Well, I now updated the whole cooking area :P  But perhaps this egg hasn't much to do with SSS, as I rendered this in an older version (in PT mode) and there wasn't much difference. Furthermore, I still can't get rid of the grain in the egg, whatever settings I change, and in PT the shadow is really dark; can't change that either.
So I will let the egg cool off a bit, before attempting another SSS breakfast.

BTW. I put the egg on a disc and lowered planet a bit here.
Title: Re: Subsurface scattering
Post by: Dune on October 16, 2019, 07:22:33 AM
Tried it on a person. Glass shader before default shader with bump and textures. That doesn't work in defer all mode. It does in PT (best visible in nose), but with vitiligo >:( on some parts of the skin. It bleaches the skin considerably, so in the complete PT render I decreased default color from 0.5 to 0.3. Still rather light.
Other duties call, so I'll leave this to be crystalized a bit....
Title: Re: Subsurface scattering
Post by: KyL on October 16, 2019, 11:17:57 AM
Yes, it's not working that great on humans. I tried a bit and came up with not-so-great results:
tgout-014 03m18s v4.4.38.1.jpg

The whole setup is totally physically inaccurate, and the actual "scatter" we see comes more from rough refractions than anything else... I think we will need a proper skin shader, or a separate section in the default shader to really have convincing skin.
Title: Re: Subsurface scattering
Post by: Dune on October 16, 2019, 11:56:34 AM
Yes, actually I'm glad you couldn't get proper results either (so it's not my fault :P  ) And yes, I can't imagine we have to add glass shaders to everything we need to have some subsurface scattering to. Would be great if that could be added in a default shader indeed.

Would you mind sharing your settings for the buddha? Als AA and such? I seem to get quite some white grain in PT renders using the new glass.
Title: Re: Subsurface scattering
Post by: KyL on October 16, 2019, 12:08:57 PM
Sure!

Glass shader:
-Decay Distance 0.1
-Volume density 2
-Caustics intensity: 0

Render node:
-detail 0.5
-AA 6, default robust adaptive sampler (1/64 with a 0.05 treshold)
-max paths: 64


Disabling the caustics and increasing the max paths should give you much cleaner/faster result than just increasing the AA in this kind of scenario!
Title: Re: Subsurface scattering
Post by: Dune on October 16, 2019, 12:15:50 PM
Thanks!
Title: Re: Subsurface scattering
Post by: WAS on October 16, 2019, 02:17:43 PM
Quote from: KyL on October 16, 2019, 11:17:57 AMYes, it's not working that great on humans. I tried a bit and came up with not-so-great results:
tgout-014 03m18s v4.4.38.1.jpg

The whole setup is totally physically inaccurate, and the actual "scatter" we see comes more from rough refractions than anything else... I think we will need a proper skin shader, or a separate section in the default shader to really have convincing skin.

What are you using as a basis for comparison? I've seen this model used before, and when I see SSS demos, those are highly inaccurate and exaggerated for effect (like in games).



vs



It's possible your reflections are just too high, and masking some effect (he's in the open with bright ambiance in 360 degrees), because the effect on yours is more accurate than other peoples "true" results which glow in the lobe more than actual thin cartilage which is inaccurate and reversed on the same model.
Title: Re: Subsurface scattering
Post by: KyL on October 16, 2019, 02:35:21 PM
Wow, those examples are extreme! :o

Actually I used this model for years as a benchmark for skin shading. It was one of the early head scans with proper displacement and reflectance captured.
Here is how it looked in Arnold, back in 2012:
visage_arnoldRender_44min.jpg

We're far from it!
But keep in mind we are using a *glass* shader, which is meant to reproduce a completely different phenomenon.

What's funny is that it is now really easy to achieve a mix between transmission and subsurface in Terragen, something that can be quite tricky in other renderers!

Quote from: Dune on October 16, 2019, 12:15:50 PMThanks!
You're welcome. Sorry to pollute your thread with all those heads  :)
Title: Re: Subsurface scattering
Post by: Oshyan on October 16, 2019, 03:53:25 PM
Dune, Defer All doesn't do the same subsurface scattering that PT does. Just so you know. 

- Oshyan
Title: Re: Subsurface scattering
Post by: Dune on October 17, 2019, 01:45:50 AM
I know, Oshyan. Thanks. It was merely to show the difference between skin darkness. I think it's better suited for models without bump and additional shaders, but it needs more experimentation.
Title: Re: Subsurface scattering
Post by: WAS on October 17, 2019, 02:07:42 PM
Is it possible that mesh depth isn't correctly being interpreted for SSS? Looking at Dune's examples, and Kyls, some areas have a apparent SSS effect, and other areas, at the same depths (and light exposure, or similar) randomly don't, creating a blotchy "SSS" effect across the model.

Hannes larger, smoother object seems to give better results. Additionally I wonder how it would look on native TG assets. Glaciers, waves, crystal, etc. I have a lot of crystal type shaders to test eventually. We'll see.
Title: Re: Subsurface scattering
Post by: Matt on October 17, 2019, 02:39:44 PM
KyL and Dune, what are your Micropoly Detail and Ray Detail Multiplier? Very short rays will fall back to the "surface point approximation" to avoid artifacts on displaceable surfaces, but at the moment this also applies to non-displaceable objects. So the Micropoly detail matters (and so does Ray Detail Multiplier if you change that from the default).
Title: Re: Subsurface scattering
Post by: KyL on October 17, 2019, 02:47:39 PM
Quote from: Matt on October 17, 2019, 02:39:44 PMVery short rays will fall back to the "surface point approximation" to avoid artifacts on displaceable surfaces, but at the moment this also applies to non-displaceable objects

Ooooh! Interesting.
My tests were using 0.1 detail and 0.25 detail multiplier. I'll look into it.
Title: Re: Subsurface scattering
Post by: Matt on October 17, 2019, 02:51:31 PM
OK, try it with micropoly detail 1 and an exaggerated decay distance. In the mean time I will try to make non-displaceable surfaces independent of the detail settings.
Title: Re: Subsurface scattering
Post by: KyL on October 17, 2019, 04:26:18 PM
Got it working! ;D

tgout-001 06m51s v4.4.38.1.jpg

I will post further experiments later!
Title: Re: Subsurface scattering
Post by: Hannes on October 17, 2019, 04:29:14 PM
Whoah! That looks amazing! I couldn't create some decent skin shader so far, but that looks really promising!
Title: Re: Subsurface scattering
Post by: Hannes on October 17, 2019, 04:30:15 PM
Cool model by the way...
Title: Re: Subsurface scattering
Post by: KyL on October 17, 2019, 08:46:44 PM
Okay I started a new thread to specifically talk about skin.

I also posted the link to the models I used ;)
Title: Re: Subsurface scattering
Post by: WAS on October 17, 2019, 09:58:36 PM
Great work. It seems working with the models more like the comparisons you're using helped?

What seems to come off immediately to me is all this is highly dependent on the scale of your model and settings and may not scale up or down with different objects?

Also, is arnolds SSS Screen-space subsurface scattering? The exaggerated examples of their "correct" setup are most certainly not anatomically correct in where light is going. Different angles in the model seem to entirely block light with no transmission of glows.
Title: Re: Subsurface scattering
Post by: Dune on October 18, 2019, 02:02:35 AM
Thanks for chimimg in Matt. I used 0.5 and AA6, but subdiv at default. I realized that the grain comes from the max paths settings, which I kept at 'exterior' (outdoor camping :P ).
Here's another test on a geode I made earlier, with higher max path settings (49, I believe). I really like this effect.
@KyL ; did you have the skin textures before or after the glass shader? I had them after the glass, but it seems like its effect is diffused quite a bit by the previous glass shader. Still need to get the hang of this, obviously.
Title: Re: Subsurface scattering
Post by: Hannes on October 18, 2019, 02:07:28 AM
Cool and creepy! ;D
Title: Re: Subsurface scattering
Post by: DocCharly65 on October 18, 2019, 05:43:22 AM
Quote from: Hannes on October 18, 2019, 02:07:28 AMCool and creepy! ;D
Echo ! :)
Title: Re: Subsurface scattering
Post by: Dune on October 18, 2019, 06:32:48 AM
Some small tests (don't have time for large renders) on a person. What I did is in the title.
Title: Re: Subsurface scattering
Post by: KyL on October 18, 2019, 08:50:33 AM
Quote from: Dune on October 18, 2019, 02:02:35 AMdid you have the skin textures before or after the glass shader?

Same level. I used a merge shader to mix default and glass shader. I like the geode thing. It feels this kind of things will look much more convincing with proper subsurface scattering!
Title: Re: Subsurface scattering
Post by: Dune on October 18, 2019, 09:56:56 AM
If you look at the two most right tests, there's hardly any (or none at all) difference between merge add and using glass first and then default. So it seems any shader after the glass is added anyway.
My problem is that I can't keep the dark skin tone and have the SSS as well.
Title: Re: Subsurface scattering
Post by: j meyer on October 18, 2019, 12:14:13 PM
Interesting stuff going on here.
The geode is really cool.
Keep experimenting!
Title: Re: Subsurface scattering
Post by: KyL on October 18, 2019, 03:20:12 PM
Quote from: WAS on October 17, 2019, 09:58:36 PMAlso, is arnolds SSS Screen-space subsurface scattering?

No. I remember it was first a point-based subsurface, but now it is ray traced using a dipole model, or maybe even something newer.

There was an interesting article (https://www.fxguide.com/fxfeatured/pixar-deep-dive-on-sss-siggraph-preview/) published a while ago about this.
Title: Re: Subsurface scattering
Post by: WAS on October 19, 2019, 01:39:01 AM
Quote from: Dune on October 18, 2019, 09:56:56 AMIf you look at the two most right tests, there's hardly any (or none at all) difference between merge add and using glass first and then default. So it seems any shader after the glass is added anyway.
My problem is that I can't keep the dark skin tone and have the SSS as well.
That's strange theres such a jump in lightness of the textures with the SSS. I wonder if you could multiply the diffuse?
Title: Re: Subsurface scattering
Post by: Matt on October 19, 2019, 02:23:07 AM
I'm not sure if you can merge the shaders like that. It looks like you're just getting non-SSS result. Do you need diffuse at all? I would think you can achieve a lot with just the glass shader with an appropriate amount of roughness.
Title: Re: Subsurface scattering
Post by: Dune on October 19, 2019, 03:06:55 AM
It's only a small part of the face, but the SSS-part can be seen in the light through the left (her right) nose hole wing (or whatever that's called), so it's there alright. I had to do this very subtly or it would have been too light. Decay depth is 0.017 I believe and density 2 with an unvaried medium reddish as color.

I believe the diffuse is also needed to give e.g. the lips its color. And I have added patches of dirt, skin variation, scratches and pimples, and such, and sometimes may even need body paint. Some procedural, some by image map. I also need bump maps for these low poly objects. I don't know if that really works now.
One can achieve a lot with just glass and roughness for variation (and maybe the skintone can be altered by using a darker reddish (blood) color), but I think there needs to be a way to add diffuse textures to the glass.
Also for things like icebergs; like (fake) rocks caught in/on the ice, strata lines (though the latter can probably be done through color input).
Title: Re: Subsurface scattering
Post by: Dune on October 19, 2019, 05:41:20 AM
Some more experiments. Bump is obviously not taken well. Understandable, but a pity.
Title: Re: Subsurface scattering
Post by: Matt on October 19, 2019, 11:56:41 AM
One of the useful characteristics of a shader that supports SSS is that the bump mapping can have a strong visible effect on the specular/glossy component while simultaneously having a much softer effect on the diffuse component (because the diffuse is caused by subsurface scattering instead of surface scattering). If you mix in a separate diffuse layer it stops looking like skin because the bump on the diffuse is hard. I would let SSS do its thing to soften the bumps and let the bumps show in the gloss instead.

In your tests there appears to be blueish light leaking through the model. If this is caused by SSS then then a reddish "decay colour" is needed to make this more realistic.

Changing the "Lighting method in PT" to "Subsurface scatter in all directions (BETA)" will do a better job of transmitting light through thin parts of the model. This will allow you to use smaller decay distances (or higher volume densities) and get a more realistic result.
Title: Re: Subsurface scattering
Post by: Dune on October 19, 2019, 12:20:10 PM
I understand that you are saying that the total of diffuse and bump in the preceding shaders both act upon the glass shader. So the only thing that needs to be done is matching the colors in the glass to what I had in the pure PT render (dark skinned). How about the reflection settings from the default shader, are they passed on or should I mimic them in the glass shader?
And what about say red lips (especially in female models' face textures), will that be passed on?
Title: Re: Subsurface scattering
Post by: Matt on October 19, 2019, 01:04:04 PM
Quote from: Dune on October 19, 2019, 12:20:10 PMI understand that you are saying that the total of diffuse and bump in the preceding shaders both act upon the glass shader.

Bump does, but figuring out how the diffuse comes through is more complicated.

I think it is going to be more complicated than it needs to be if you try to use a Default Shader and a Glass Shader together. For the skin and lips I would try to do everything with the Glass Shader, and follow it with a Displacement Shader (or Image Map Shader with displacement) to add the bump mapping. The face colour map should go into the "volume colour" input of the Glass Shader.

Dirt and body paint could be a separate layer that follows the Glass Shader, appropriately masked to not cover up the Glass Shader.
Title: Re: Subsurface scattering
Post by: KyL on October 19, 2019, 01:13:57 PM
Quote from: Matt on October 19, 2019, 01:04:04 PMThe face colour map should go into the "volume colour" input of the Glass Shader
Actually this is the first thing I tried. However this doesn't seem to work. I plugged an image map shader set to Object UVs in the volume Colour function but it ends up black! Volume density does work though.
Title: Re: Subsurface scattering
Post by: Matt on October 19, 2019, 01:39:05 PM
Quote from: KyL on October 19, 2019, 01:13:57 PM
Quote from: Matt on October 19, 2019, 01:04:04 PMThe face colour map should go into the "volume colour" input of the Glass Shader
Actually this is the first thing I tried. However this doesn't seem to work. I plugged an image map shader set to Object UVs in the volume Colour function but it ends up black! Volume density does work though.

OK, I'll take a look.
Title: Re: Subsurface scattering
Post by: KyL on October 19, 2019, 01:52:39 PM
Thanks Matt
Title: Re: Subsurface scattering
Post by: Dune on October 20, 2019, 02:46:49 AM
Thanks from me too, Matt. Off to try again...
Title: Re: Subsurface scattering
Post by: Dune on October 21, 2019, 10:56:52 AM
Tried to do some bubbles in ice. The bubbles themselves are a bit grainy (samples 49 at AA6), but the effect is nice. I also tried to get bubbles only in the ice, and not on the ice surface (the hard white dots), so I masked them by a surface shader with max altitude. But that doesn't work. They are probably calculated starting from the top, and if that isn't there....
Too bad I don't have an X thread Threadripper (yet), as this took 1 hour.

The ice around the pole is a flattened sphere, btw. Iced too.
Title: Re: Subsurface scattering
Post by: WAS on October 21, 2019, 01:04:10 PM
Quote from: Dune on October 21, 2019, 10:56:52 AMTried to do some bubbles in ice. The bubbles themselves are a bit grainy (samples 49 at AA6), but the effect is nice. I also tried to get bubbles only in the ice, and not on the ice surface (the hard white dots), so I masked them by a surface shader with max altitude. But that doesn't work. They are probably calculated starting from the top, and if that isn't there....
Too bad I don't have an X thread Threadripper (yet), as this took 1 hour.

The ice around the pole is a flattened sphere, btw. Iced too.

I like that effect a lot actually. Even looks like they were trapped in motion. Maybe they're grainy due to noise roughness? Seems everything else is fairly smooth.
Title: Re: Subsurface scattering
Post by: Matt on October 21, 2019, 05:27:57 PM
Quote from: KyL on October 16, 2019, 11:17:57 AMtgout-014 03m18s v4.4.38.1.jpg

Do you have a version of the Lee Perry Smith head with vertex normals? I downloaded it from the source but it's faceted. I think it expects me to the use the normal map but Terragen doesn't support that yet.
Title: Re: Subsurface scattering
Post by: digitalguru on October 21, 2019, 06:21:58 PM
Quote from: Matt on October 21, 2019, 05:27:57 PMDo you have a version of the Lee Perry Smith head with vertex normals?
Here you go
Title: Re: Subsurface scattering
Post by: Dune on October 22, 2019, 01:56:35 AM
Another experiment; glass with bubbly. Forgot to set RDM to 1 though. It's not (yet) what I expected.
Title: Re: Subsurface scattering
Post by: Matt on October 22, 2019, 03:19:06 AM
Quote from: digitalguru on October 21, 2019, 06:21:58 PM
Quote from: Matt on October 21, 2019, 05:27:57 PMDo you have a version of the Lee Perry Smith head with vertex normals?
Here you go

Thanks. I used this model to test and fix a bump mapping bug and also fix the UV texture mapping problem. You can grab the fixes in 4.4.40 frontier build which is available on Windows and Linux now. Mac version coming in a day or two.
Title: Re: Subsurface scattering
Post by: Dune on October 22, 2019, 08:53:38 AM
Where is the 4.4.40 frontier build? Can't find it...
Title: Re: Subsurface scattering
Post by: KlausK on October 22, 2019, 09:26:54 AM
If you do a "Check for update" from within TG it is there.
CHeers, Klaus.
Title: Re: Subsurface scattering
Post by: Dune on October 22, 2019, 09:48:32 AM
Thanks Klaus, but I'm always offline with my TG, and always get the newest test builds from here.`I'll just be patient....
Title: Re: Subsurface scattering
Post by: Dune on November 03, 2019, 11:54:18 AM
Another (new) guy tested with the glass-sss, and without, and updated model. Glass version took 24 mins.
Title: Re: Subsurface scattering
Post by: Dune on November 04, 2019, 02:15:14 AM
Some more tests, but not with SSS.
Title: Re: Subsurface scattering
Post by: Hannes on November 04, 2019, 03:59:57 AM
Cool guy! I guess from a certain distance you wouldn't need subsurface scattering, but in closeups it looks better.
Title: Re: Subsurface scattering
Post by: DocCharly65 on November 04, 2019, 09:07:44 AM
Quote from: Hannes on November 04, 2019, 03:59:57 AMCool guy! I guess from a certain distance you wouldn't need subsurface scattering, but in closeups it looks better.
Echo this!
Great character creations!
Would on the distance a very carefully used reflective shader add a little bit realism? I have good experiences so far by doing that.
Title: Re: Subsurface scattering
Post by: Dune on November 04, 2019, 09:48:20 AM
My characters are mostly for non-close-up (luckily). And I do use some subtle no-RT (default shader) reflection, but maybe it's not always enough. Something to experiment with. It also depends on what this character is doing ;)
Title: Re: Subsurface scattering
Post by: Dune on November 05, 2019, 03:58:07 AM
Another character, and difference between PT and PT with SSS (decay depth at 5cm, which is too much, but well...). PT takes a few minutes, SSS unfortunately 19mins, but the effect is great.
Oh, decay color a light reddish, density = 5, color = 2.
Title: Re: Subsurface scattering
Post by: Hannes on November 05, 2019, 06:53:14 AM
Quite a difference. Maybe a little specularity would be nice.
Title: Re: Subsurface scattering
Post by: Dune on November 05, 2019, 07:41:43 AM
Yes, I thought so too. Had it in the default shader, but got (partly?) lost in the glass shader (no reflection set).
Title: Re: Subsurface scattering
Post by: j meyer on November 05, 2019, 11:41:25 AM
Is the difference of the shadows only due to the SSS of the glass shader?
Title: Re: Subsurface scattering
Post by: WAS on November 05, 2019, 01:47:23 PM
The refraction highlights on her nostrils and lips coming from below are... interesting... but she looks better with the SSS, shadow smoothness is much more natural. I agree on some skin spec.
Title: Re: Subsurface scattering
Post by: Dune on November 06, 2019, 02:22:31 AM
Yes, the glass' decay depth makes the soft shadows even softer, as the shadows 'sinks' into the skin. Decay depth was too much though (5cm), whereas Hannes used 3cm, which would probably also enhance this simple (morphed) DAZ model, and get rid of the strange highlights. Only thing I don't understand is that Hannes uses color of 1, and I had to use 2 to keep it from being far too dark.
Title: Re: Subsurface scattering
Post by: Hannes on November 06, 2019, 08:06:29 AM
You'll have to increase the volume density. However in my tests I had to brighten up the textures as well. According to Matt a color value of more than 1 wouldn't be physically correct.
Title: Re: Subsurface scattering
Post by: Dune on November 06, 2019, 11:34:28 AM
I'll test that one of these days. The only thing (about the color) I refer to is the no-SSS lightness, and to get that, I had to increase it, correct or not (sorry Matt ;) ).