Autodesk/standard-surface

Transmission TIR for rough glass

xelatihy opened this issue · 2 comments

In the OSL implementation, I am sure that I correctly understand how total internal reflection is handled. One possibility is that the fresnel term for specular takes care of that since it goes to 1 in the case of TIR, thus not issuing a transmission btdf at all. If that is the case, I have two questions

  1. how do you handle rough glass, that should have a btdf that depends on 1 - fresnel(w_h)
  2. how do you decide whether to "flip" eta depending on inside-out test

Thanks for the question! And sorry for the delayed response.

The answer is that currently the shader does not have a well-defined behavior when the surface is hit from the inside. When the surface is hit from the inside, by default all closures are emitted and weighted against each other as if hit from the outside, with the difference that the medium IORs are obeyed for refraction to work properly. The transmission closure handles TIR, per microfacet.

There's an active discussion about this on the mailing list. Specifying the behavior in a physically meaningful and practically useful way is a high priority now. The layering definition from Figure 1 in the white paper will likely need to be adjusted, as discussed on the mailing list.

Hope this helps!

Thanks you for the reply. I'll look into the discussion.

We worked quite a bit to try to get this right for our own tiny research renderer. But we did not get anywhere. We managed to get all cases "right" except TIR with rough glass where the sampling and pdf code suggest that a layer stack in this case is hard to define correctly. Mostly we got stuck in the split between specular and transmission that make perfect sense when hitting from outside but not from inside.

BTW, in our case a lot of things worked better just because our path tracer does not sample direct illumination with shadow rays but only via MIS. Without this, the backside of surfaces would have been really hard to get right.