Skip to content

Implementing SpongeCake BSDF: Sampling half-vectors correctly. #1167

Closed Answered by Vrroom
Vrroom asked this question in Q&A
Discussion options

You must be logged in to vote

Thanks Ziyi. I found the answer to my question but forgot to post it. This is slightly different from your comment. Let me write it here for anyone stumbling into this in the future.

In the case of the SpongeCake BSDF, the phase function f(wi, wo) to be sampled is the specular phase function from the SGGX microflake (See Eq 24 in the linked in the paper). The algorithm sampling from this phase function requires constructing an orthonormal basis around wi (See Algorithm 1 in the SGGX paper). This is why, the correct frame to pass to sggx_sample is sh_frame = mi.Frame3f(si.wi) as in my code above.

In this case, I have erroneously named the orthonormal basis as sh_frame. It is not a shading …

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@Vrroom
Comment options

Answer selected by Vrroom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants