Sub-surface in images

Started by treddie, March 22, 2012, 04:47:08 PM

Previous topic - Next topic

treddie

Hey,

I was wondering how many people out there are using sub-surface scattering in the leaves of plants and trees for highly populated scenes?  If not, is it due to a performance hit?

Hannes

It seems you are confusing sub surface scattering with translucency. At the moment there is no real SSS yet in TG.

jo

Hi treddie,

As Hannes mentioned TG2 doesn't have SSS yet. Translucency is the nearest thing.

I suspect a lot of people don't use it simply because models might not be set up to use it. It can really make a difference. Check out this message:

http://forums.planetside.co.uk/index.php?topic=13350.msg131946#msg131946

and compare the image there to the ones posted earlier in the thread. I really think it can make a big difference when used appropriately. Enough difference that to me I would have it on regardless of the performance impact, for a final render at least.

Regards,

Jo

treddie

That's EXACTLY what I was expecting!  There was one thing about TG renders that has bothered me for a long time...Too dark in the shadow areas of plants giving the overall images a too contrasty feel.  Then it finally dawned on me that it might be because there was no allowance for light bounce due to translucency (or SSS for that matter).  That example looks sweet!  Is there much of a performance hit with translucency on?

Many years ago, Planetside showed examples of sub-surface that was to be incorporated into TG2.  I'm surprised it is not available yet.

jo

Hi treddie,

I don't have a good idea about the performance impact but I suspect it is pretty minor. It's not really trying to do anything too clever. As I said I think it makes such a positive difference it's worth any performance impact.

We did show an example of SSS a long time ago but that was a bit of a hack really. It was very slow, didn't generalise well and that implementation wasn't worth pursuing. I think Matt probably regrets ever showing that image! I'm not sure it's something which is really useful. There are definitely situations where it would make a difference, icebergs being the one that immediately springs to mind. However for something like the leaf translucency it would probably be total overkill except for real closeups. Although SSS would perhaps be a more correct way of doing it when you can get a similar effect much more cheaply, as with translucency, then that's often the most practical way to go. I'm sure if we had SSS people would complain about how slow it was. It is something I would like to see in the future, but there's many other things with higher priorities.

Regards,

Jo

treddie


King Mango

While SSS is complicated to implement, there is a 'cheap' workaround for objects like leaves. I mean workaround for the programmer not for users unfortunately.
It involves a 2d planar polygon. Say a leaf. This leaf polygon (we'll say a square consisting of two triangles for sake of simplicity) has a normal direction. That is, one side of the poly is always considered to be 'front' in its local space orientation. A vector check to determine which side of the poly is facing more towards the sun will render the diffuse texture as you would expect, but the back side facing more away from the sun gets its expected shadow calculation but then can use a new shader operation called a transmission mask which determines how to modify that shadow's brightness per pixel. The transmission mask is a grey scale texture that the artist creates along with the asset texture set and multiplies with the shadow calculation and then is applied to the diffuse. This is how real-time games fake sub-surface scattering. I don't think it's particularly good on "solid" objects just yet, but it works quite well for plant leaves.

Matt

#7
King Mango, this is exactly what the translucency setting does in TG's Default Shader :) It does not need to be greyscale either. It is an RGB multiplier, so you can tint the backside.

Matt
Just because milk is white doesn't mean that clouds are made of milk.

King Mango

super! I thought by way of the name that it was simply an opacity modification. This is good to know.

Matt

Translucency, transparency, transmission... they are easy to mix up, because they all refer to light passing through objects. For sub-surface scattering, the word 'translucency' is quite appropriate I think. 'Transmission' makes me think of transparency as in glass.

From the Compendium of All Human Knowledge (Wikipedia):

"In the field of optics, transparency (also called pellucidity or diaphaneity) is the physical property of allowing light to pass through a material. On a macroscopic scale (one where the dimensions investigated are much, much larger than the wavelength of the photons in question), the photons can be said to follow Snell's Law. Translucency (also called translucence or translucidity), is a super-set of transparency, allows light to pass through; but, does not necessarily (again, on the macroscopic scale) follow Snell's law; the photons can be scattered at either of the two interfaces where there is a change in index of refraction, or internally. In other words, a translucent medium allows the transport of light while a transparent medium not only allows the transport of light but allows for the image formation. The opposite property of translucency is opacity."

http://en.wikipedia.org/wiki/Transparency_and_translucency

I had to check because you got me wondering if I was using the wrong term. This has got me worried about the word 'opacity' now! If opacity is the opposite of translucency, as it says above, then it's different from how we use the term opacity in TG. In TG, opacity is the opposite of transparency, i.e. preventing image formation (to use the same language as above).

Matt
Just because milk is white doesn't mean that clouds are made of milk.

King Mango

That was surprisingly easy to understand. :D

I always just associated translucency with opacity in terms of game textures. And I just always assumed that translucency and transparency were synonyms. You learn something new every day (pronounced late night).

FlynnAD

Quote from: Matt on April 01, 2012, 04:32:52 AM
This has got me worried about the word 'opacity' now! If opacity is the opposite of translucency, as it says above, then it's different from how we use the term opacity in TG. In TG, opacity is the opposite of transparency, i.e. preventing image formation

Matt

Matt,

You (TG2) are using "opacity" and "translucency" just fine as is. TG2 works just like terminology in other 3d software. No need to modify these and potentially confuse new people like the words "feature scale" or "lead-in scale" do (i.e., main scale and largest scale). The "opacity" portion of a default shader makes things more or less transparent (clear), while translucency is separate and allows light to filter through without "clearness" being required.

Matt

#12
Thanks. I won't be changing it. Didn't mean to alarm anyone :)
Just because milk is white doesn't mean that clouds are made of milk.