Page 1 of 2

Thin translucence

Posted: Thu May 11, 2006 4:00 am
by casey
Question: is adding an SSS layer the only way to do translucence, or is there some more expedient method for "infinitely thin" surfaces such as the geometry for leaves or ricepaper and such?

SSS seems like overkill for this purpose because it is really just a two-sided lighting situation, and doesn't involve actual reflection inside the object. However, due to the way Maxwell samples things, maybe it wouldn't be a speed increase to treat these objects specially anyway... but I thought I'd check.

- Casey

Posted: Thu May 11, 2006 5:04 am
by Mihai
I think translucence is a more difficult effect to achieve than people believe. The light must not only shine through to the other side, but it has to also "flow" into the surface so you get a really big light spill effect. Currently there are some issues with sss, but it Maxwells implementation might be good enough for good translucence effects.

But you could also use a frosty glass approach, especially if the light shining on the thin surface comes from everywhere, like sun shining through a curtain. It would be interesting to make a test when sss is improved between frosty glass approach and real sss to compare the render times.

Posted: Thu May 11, 2006 5:10 am
by casey
Mihai wrote:I think translucence is a more difficult effect to achieve than people believe. The light must not only shine through to the other side, but it has to also "flow" into the surface so you get a really big light spill effect. Currently there are some issues with sss, but it Maxwells implementation might be good enough for good translucence effects.
Actually, translucence is extremely simple (which is not the same as inexpensive to compute, but point being, it is not complicated). If you have a triangle, when you hit the triangle, an opaque result comes from sampling the light incident on the hemisphere that's on the side from which you're sampling (ie., the side the camera is on). With a translucent triangle, you just sample the whole sphere instead of just the hemisphere. Typically you have a different BSDF for the back hemisphere than for the front, but that's all there is to it. It's very simple.

But I don't think Maxwell allows you to do this (a "two sided bsdf"), so you have to go with full-blown SSS as far as I can tell, which I would think is more computationally expensive, and at the very least implies the presence of more geometry since you need a front and back side to every object that employs it.

- Casey

Posted: Thu May 11, 2006 5:16 am
by Mihai
Strange, I don't remember seeing any nice convincing translucence renders, say for example an object fairly close behind a curtain, and the light behind the curtain making a pretty accurate shadow on the curtain from the object, and also illuminating the curtain a bit.

Would sampling a whole sphere take into account the scattering, and a nice area shadow, would you get kind of the same effect?

Posted: Thu May 11, 2006 5:33 am
by casey
Mihai wrote:Strange, I don't remember seeing any nice convincing translucence renders, say for example an object fairly close behind a curtain, and the light behind the curtain making a pretty accurate shadow on the curtain from the object, and also illuminating the curtain a bit.

Would sampling a whole sphere take into account the scattering, and a nice area shadow, would you get kind of the same effect?
First of all, I agree with you that it's hard to find good translucence renderers, but that's because renderers don't ever seem to directly support thin translucence, which seems like a big oversight since supporting good SSS is harder and they all do that nowadays.

Second, yes, whole sphere does all that. Just think of it this way: when you look at a global illumination lit surface from the front, you see what you want to see from behind, right? Direct shadows for sharp lights, soft light levels elsewhere that are proportional to how much light is coming in, etc. For thin translucence, all you want to do is see this same stuff, but from the other side too. So whatever your renderer currently does for the front of objects, doing that on the backside and providing a way to add that together with the frontside calculation is a really simple way to get good translucence without adding complexity to the renderer. But, obviously, it isn't "free", because you're presumably going to have to sample twice as many directions on average to sample the whole sphere as you will for the hemisphere, right...

- Casey

Posted: Thu May 11, 2006 6:13 am
by Mihai
I was thinking of this multilayer sss presentation, if you read on page 6:
A piece of parchment illuminated from behind. Note,
how the dipole model (left) underestimates the amount of transmitted
light, while the multipole model (middle) matches the reference
image computed using Monte Carlo photon tracing (right).
I suppose by dipole he is refering to sphere sampling?

http://graphics.ucsd.edu/papers/layered/layered.pdf

There is a huge difference there in illumination between dipole and Monte Carlo raytracing method. His method looks almost exactly like the Monte Carlo render only ofcourse faster.

Posted: Thu May 11, 2006 7:35 am
by casey
Mihai wrote:I suppose by dipole he is refering to sphere sampling?
I think by "dipole method" they're referring to the BSSRDF, which isn't really related to what I was saying.

The full SSS in Maxwell already (obviously) has to sample the full sphere when it hits an SSS surface, because it has to consider the light that comes from the other side of the triangle. All I'm saying is that in cases where you have thin objects of a constant thickness, it's likely that good results could be obtained without the extra work of scattering inside the object. Perhaps it is an irrelevant optimization and the noise wouldn't improve, but I just have a hunch that it would be cleaner, if you know it's a thin translucent thing, to remove the randomness added by inside-object scattering.

- Casey

Posted: Thu May 11, 2006 7:59 am
by Kabe
casey wrote:All I'm saying is that in cases where you have thin objects of a constant thickness, it's likely that good results could be obtained without the extra work of scattering inside the object.
Absolutely, though I wouldn't call this an SSS shader, but an backlight shader.
This would be very useful indeed, and there are some good example for this ,
the Cinema 4D "Backlight" shader for example.

Such a shader would be a great addition for curtains, leaves, matted glas.

Kabe

Posted: Thu May 11, 2006 9:42 am
by casey
Kabe wrote:Absolutely, though I wouldn't call this an SSS shader, but an backlight shader.
Agreed. SSS should be reserved for when there actually is light activity inside the object, ie. when the object has real volume in its geometric representation.

- Casey

Posted: Thu May 11, 2006 10:06 am
by Mihai
If you don't need scattering then i think a two bsdf material, one "ghost", the other a standard lambert should do it.....with the weighting of the two you can have it more or less translucent...it should also keep noise to a minimum since there's no refraction envolved (as long as you keep nd at 1 for both bsdf's).

Posted: Thu May 11, 2006 11:22 am
by casey
Mihai wrote:one "ghost"
What are you suggesting the settings be for this BSDF?

- Casey

Posted: Thu May 11, 2006 12:45 pm
by Mihai
transmittance white, nd 1, refl 0. This will make it a clipmap layer, but since you're not using a clipmap in transmittance, it will be completely transparent.

If you do a search for AGS glass you will see it's one of the layers of that glass.

Posted: Thu May 11, 2006 2:35 pm
by marten
Hi casey and Mihai. Very interesting thread. Did either of you test if this actually works?
I tried to create a material with 2 BSDF layers (following Mihai's description), but I can't get the translucent effect.
/MÃ¥rten

Posted: Thu May 11, 2006 2:55 pm
by Kabe
A standard lambert won't do it, because it samples at the wrong "side",
on the front instead of the back.

So, I would really be surprised if Mihai's solution would work...

Kabe

Posted: Thu May 11, 2006 9:43 pm
by casey
Kabe wrote:A standard lambert won't do it, because it samples at the wrong "side",
on the front instead of the back.

So, I would really be surprised if Mihai's solution would work...
This was my thinking exactly, although I haven't tried Mihai's solution yet. I'm assuming that the completely-transparent layer will not do the back-hemisphere sampling, which is what you need.

- Casey