Planetside Software Forums

General => Terragen Discussion => Topic started by: WAS on October 19, 2019, 09:33:50 PM

Title: Subsurface Scattering in All Directions
Post by: WAS on October 19, 2019, 09:33:50 PM
Is this to produce subsurface scattering in all directions, for example, for objects? When I try the feature it seems to be a "top-down" effect to decay. I don't think I'm understanding the feature correctly maybe, or just beta issue stuff??

Additionally, will there be a way to have a soft continuity of the decay distance? It seems to now more "suddenly" dropping off near the end, rather than gradual along the distance defined.
Title: Re: Subsurface Scattering in All Directions
Post by: Hannes on October 20, 2019, 05:17:13 AM
I think, in your example the density is just not high enough. The light comes from somewhere above, so the decay effect is more visible at the upper parts of the objects.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 20, 2019, 12:48:40 PM
The main spotlight is actually at a 90 degree angle on the side of the crystal pointing at it at about 2.5x intensity of overhead spotlight. Main spotlight is blue to see subsurface. Density is red. Decay distance is hard, and clearly vertical?

So basically it looks like while yes, we have subsurface, it only works where your density is, and your density is only Vertical (Maybe using Y) despite "All Directions" subsurface. When using this feature, this is how the decay distance should also operate, you'd think.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 20, 2019, 01:46:54 PM
Now there is only the spotlight at 0 degrees (not 90, my mistake, the other was at -90)

The spotlight circle encompasses the object within it's main intensity region, and density was ramped to 10, so no the base the object isn't clear, but black (due to decay distance going to 0)

You can clearly see the Subsurface Scattering only follows the density, which is on Y. I could see this being a problem for a lot of stuff.

Also definitely notice with objects you need basically perfect normals and high res surface or you'll get abnormalities (with subsurface and shadows).
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 20, 2019, 03:09:59 PM
I'm sorry, I don't understand what you're saying about density and Y. Can you say it in another way?
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 20, 2019, 11:21:07 PM
Vertical/top-down density. This is accurate for water, but not objects/glass.

The density starts at the top of the object 2m high, and decays at 1m. So the bottom is black at 10 density basically.

For objects we'd want this blackness/decay in the center of objects. Maybe this also explains the weird subsurface lighting on different angles of geometry with no transmission.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 12:01:26 AM
Ah, I see. Both the decay and the SSS use the length of ray and they should work on any object in any orientation. There isn't any Y-based calculation.

I guess what you're seeing is reflections drowning out the relatively dark subsurface effect. And in the very first image you posted, the brightness of the surface being hit by the spotlight and seen through the glass is much higher than the dark red volume, so you see the strong gradient of the spot-lit surface.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 02:40:47 AM
Quote from: Matt on October 21, 2019, 12:01:26 AMAh, I see. Both the decay and the SSS use the length of ray and they should work on any object in any orientation. There isn't any Y-based calculation.

I guess what you're seeing is reflections drowning out the relatively dark subsurface effect. And in the very first image you posted, the brightness of the surface being hit by the spotlight and seen through the glass is much higher than the dark red volume, so you see the strong gradient of the spot-lit surface.

But in the first image with density 1, allows for non densities glass to be transparent, you can clearly see the vertical falloff and transition to glass in uniform with the object. That's no trick of light...

Even on a displaced surface with peaks higher than 3m and decay of 1m its just densitified peaks like a Surface Shadows alt rather than surrounding the peak 360 with hollow center.

The density should be coming from all directions of the objects surfaces, therefore you'd see no transparency of glass from decay distance, as it's masked in the center by density.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 03:06:19 AM
Quote from: WAS on October 21, 2019, 02:40:47 AM
Quote from: Matt on October 21, 2019, 12:01:26 AMAh, I see. Both the decay and the SSS use the length of ray and they should work on any object in any orientation. There isn't any Y-based calculation.

I guess what you're seeing is reflections drowning out the relatively dark subsurface effect. And in the very first image you posted, the brightness of the surface being hit by the spotlight and seen through the glass is much higher than the dark red volume, so you see the strong gradient of the spot-lit surface.

But in the first image with density 1, allows for non densities glass to be transparent, you can clearly see the vertical falloff and transition to glass in uniform with the object. That's no trick of light...

In the first image, the gradient you see is mostly caused by the gradient in the background. You can test this by replacing the background with a solid luminous colour.

QuoteEven on a displaced surface with peaks higher than 3m and decay of 1m its just densitified peaks like a Surface Shadows alt rather than surrounding the peak 360 with hollow center.

Without seeing this rendered I am not sure what the problem is.

Clear crystals (and clear but coloured crystals like rubies) should have volume density 0 or very close to 0. The colour should all come from the decay colour, not the volume colour. The volume density and volume colour are for cloudy materials like skin, porcelain, milk, water that has suspended particles, ice with suspended air bubbles or imperfections, etc.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 12:45:50 PM
Clarity of gems is something afforded to the rich. Ruby for example are often found imperfect, slightly opaque, and appear textured due to all the internal fault work.

The first image is very clearly just transparent... You can see the spotlights arc diffusing, the bottom of the object, and it's farside...

And Subsurface Scattering, again, should be working with the density, which should be 360 degrees of the object... Here we have a 2m object with 1m decay, which is clearly visible as a top-down effect like on a water shader. This is still visible in second images with top spotlight disabled, though transparency is now black due to 10 density.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 04:46:12 PM
Quote from: WAS on October 21, 2019, 12:45:50 PMClarity of gems is something afforded to the rich. Ruby for example are often found imperfect, slightly opaque, and appear textured due to all the internal fault work.

Yeah I guess that's true now I look at some photos. Still, the decay colour should be red for ruby, even if you also add some volume density for imperfections.

QuoteThe first image is very clearly just transparent... You can see the spotlights arc diffusing, the bottom of the object, and it's farside...

That is my point exactly. The "top to bottom" gradient that you can see is simply what's being refracted and reflected. It's not a mistake in the shader. If your decay distance was shorter, you'll see that the decay and density effects are truly 3D. As I said, you can test this by replacing the background with a single luminous colour. But you'll need a shorter decay distance to see the decay working.

QuoteAnd Subsurface Scattering, again, should be working with the density, which should be 360 degrees of the object... Here we have a 2m object with 1m decay, which is clearly visible as a top-down effect like on a water shader. This is still visible in second images with top spotlight disabled, though transparency is now black due to 10 density.

It is working correctly, but you probably need a shorter decay distance. The reason your images look the way they do is because of your reflections and refractions, not because of the volumetric effects. Have you tried replacing the environment with something simpler to test this?
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 10:05:03 PM
Well yes there is reflection, but also transparency, otherwise how is this a glass shader?

The point is the density that masks this transparency is top down, not coming from 360 degrees of the objects surfaces.

In the example image we have a luminous floor with lines, so we can distinguish actual features. I'm not sure a solid luminous floor would allow that.

You can plainly see the lines following Z go through the object perfectly aligning to the lines behind the object (as they're the same lines). If they were a reflection, they would lean the opposite way and not aligning with the lines behind the object (wouldn't they? These surfaces aren't straight), as they would be mirrored reflections. No, we're seeing the line through the object, because the density is only from the top of the object down to the bottom, and the glass is producing glass transparency.

In a side note, it's very concerning that a "shadow" can dampen a "luminous" shader (the spotlight is still on from above)....... o.O
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:09:23 PM
Quote from: WAS on October 21, 2019, 10:05:03 PMWell yes there is reflection, but also transparency, otherwise how is this a glass shader?

Yes, I said reflection and refraction (a.k.a. transparency).


QuoteThe point is the density that masks this transparency is top down, not coming from 360 degrees of the objects surfaces.

I'm afraid you are wrong.

QuoteIn the example image we have a luminous floor with lines, so we can distinguish actual features. I'm not sure a solid luminous floor would allow that.

You can plainly see the lines following Z go through the object perfectly aligning to the lines behind the object (as they're the same lines). If they were a reflection, they would lean the opposite way and not aligning with the lines behind the object, as they would be mirrored reflections. No, we're seeing the line through the object, because the density is only from the top of the object down to the bottom, and the glass is producing glass transparency.

I think in this last render I'm not sure whether we're looking at reflections or transparency. Reflections could also line up with the lines if the face is perpendicular to the lines.


QuoteIn a side note, it's very concerning that a "shadow" can dampen a "luminous" shader (the spotlight is still on from above)....... o.O

Perhaps you have some diffuse colour in there too.

Matt
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:14:02 PM
What is your index of refraction? Can you send me a TGD?
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 10:23:54 PM
Quote from: Matt on October 21, 2019, 10:09:23 PM
Quote from: WAS on October 21, 2019, 10:05:03 PMWell yes there is reflection, but also transparency, otherwise how is this a glass shader?

Yes, I said reflection and refraction (a.k.a. transparency).


Quote from: undefinedThe point is the density that masks this transparency is top down, not coming from 360 degrees of the objects surfaces.

I'm afraid you are wrong.

Quote from: undefinedIn the example image we have a luminous floor with lines, so we can distinguish actual features. I'm not sure a solid luminous floor would allow that.

You can plainly see the lines following Z go through the object perfectly aligning to the lines behind the object (as they're the same lines). If they were a reflection, they would lean the opposite way and not aligning with the lines behind the object, as they would be mirrored reflections. No, we're seeing the line through the object, because the density is only from the top of the object down to the bottom, and the glass is producing glass transparency.

I think in this last render I'm not sure whether we're looking at reflections or transparency. Reflections could also line up with the lines if the face is perpendicular to the lines.


Quote from: undefinedIn a side note, it's very concerning that a "shadow" can dampen a "luminous" shader (the spotlight is still on from above)....... o.O

Perhaps you have some diffuse colour in there too.

Matt

It seems you are right, and the conditions of my scene were wrong giving this impression, though both those faces are slightly angled in opposite directions away the camera so not sure how we'd get perfect reflections.

Also using the Decay Tint is nice for the "Ruby" colour, however I notice that the blue spotlight looses it's colour intensity in the SSS. Also, are we suppose to "ramp" up the translucency to capture light (gem brightness lets say)? I remember odd effects with doing this. When using the decay tint things get dark.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:28:23 PM
Here is an example that only uses decay, no volume/SSS.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 10:38:24 PM
Thank you, I just actually just did this resetting the shader to default.

I am curious about thicker objects, it can get rather dark under sun, and from my experience gems seem to light up due to the internal refracting and bouncing focusing the light.

Do we turn up transparency? Or ramp the colour beyond 1?

I wanted to simulated gem clarity and brightness in a gem case.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:43:45 PM
More examples showing different combinations of decay and volume colours:
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:46:54 PM
Quote from: WAS on October 21, 2019, 10:38:24 PMThank you, I just actually just did this resetting the shader to default.

I am curious about thicker objects, it can get rather dark under sun, and from my experience gems seem to light up due to the internal refracting and bouncing focusing the light.

Do we turn up transparency? Or ramp the colour beyond 1?

I wanted to simulated gem clarity and brightness in a gem case.

Reflectivity and Transparency should both be 1. If the decay is too short for the object then you will lose some intensity, but it isn't realistic to boost the transparency above 1. For brightly coloured gems I would suggest keeping the decay distance higher than the size of the object and then you can make the decay colour as saturated as you want (although desaturated colours sometimes work better, I think).

An important part of what allows the light to bounce around inside the object is the "caustic intensity". I would leave this at 1. However, volumes with high density (lots of SSS) don't need this because the lighting is mostly due to SSS, and that is calculated separately.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 10:49:53 PM
Quote from: Matt on October 21, 2019, 10:46:54 PM
Quote from: WAS on October 21, 2019, 10:38:24 PMThank you, I just actually just did this resetting the shader to default.

I am curious about thicker objects, it can get rather dark under sun, and from my experience gems seem to light up due to the internal refracting and bouncing focusing the light.

Do we turn up transparency? Or ramp the colour beyond 1?

I wanted to simulated gem clarity and brightness in a gem case.

Reflectivity and Transparency should both be 1. If the decay is too short for the object then you will lose some intensity, but it isn't realistic to boost the transparency above 1. For brightly coloured gems I would suggest keeping the decay distance higher than the size of the object and then you can make the decay colour as saturated as you want (although desaturated colours sometimes work better, I think).

An important part of what allows the light to bounce around inside the object is the "caustic intensity". I would leave this at 1.

Alright that makes sense. I'll just have to fiddle with the decay on each of the gems. Thanks for the input and sorry for the frustration. Thanks for that last bit. Was just messing with the caustic and it also does strange things above 1.
Title: Re: Subsurface Scattering in All Directions
Post by: Matt on October 21, 2019, 10:54:29 PM
Quote from: WAS on October 21, 2019, 10:49:53 PMAlright that makes sense. I'll just have to fiddle with the decay on each of the gems. Thanks for the input and sorry for the frustration. Thanks for that last bit. Was just messing with the caustic and it also does strange things above 1.

Thanks for saying that. I think we were both getting confused by the reflections, thinking they were transparency. So my original recommendation to reduce the decay distance probably didn't help at all.
Title: Re: Subsurface Scattering in All Directions
Post by: WAS on October 21, 2019, 10:56:33 PM
Quote from: Matt on October 21, 2019, 10:54:29 PM
Quote from: WAS on October 21, 2019, 10:49:53 PMAlright that makes sense. I'll just have to fiddle with the decay on each of the gems. Thanks for the input and sorry for the frustration. Thanks for that last bit. Was just messing with the caustic and it also does strange things above 1.

Thanks for saying that. I think we were both getting confused by the reflections, thinking they were transparency. So my original recommendation to reduce the decay distance probably didn't help at all.

Yeah, additionally I think trying to setup my SSS under simulated spotlight conditions of the box and light was premature. Sometimes the Sun in the default scene makes all the difference.