Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transmission TIR for rough glass #7

Open
xelatihy opened this issue Sep 5, 2019 · 2 comments
Open

Transmission TIR for rough glass #7

xelatihy opened this issue Sep 5, 2019 · 2 comments

Comments

@xelatihy
Copy link

xelatihy commented Sep 5, 2019

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
@iliyang
Copy link
Contributor

iliyang commented Oct 10, 2019

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!

@xelatihy
Copy link
Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants