-
Hello Everyone, I'm implementing the SpongeCake BSDF. This is a BSDF that has a symmetric reflecting and transmitting Normal Distribution Function (NDF). I want to ensure that I'm sampling the half vector correctly. This is what I have so far: alpha = dr.maximum(0.0001, self.alpha)
S = dr.diag(mi.Vector3f(alpha * alpha, alpha * alpha, 1)) # surface type matrix. Later we'll rotate it and all that.
sh_frame = mi.Frame3f(si.wi)
# https://mitsuba.readthedocs.io/en/latest/src/api_reference.html#sggx_sample, it seems that
# the sh_frame is constructed as mi.Frame3f(si.wi). I checked via PDB that this is different from si.sh_frame
# even if this is correct, the question remains whether the h is in the correct space
h = sggx_sample(sh_frame, sample2, S)
wo = mi.reflect(si.wi, h) My questions are whether I'm using:
Happy to provide more information. Hope my question is clear. Thanks everyone. Sumit. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi, |
Beta Was this translation helpful? Give feedback.
-
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 In this case, I have erroneously named the orthonormal basis as |
Beta Was this translation helpful? Give feedback.
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 aroundwi
(See Algorithm 1 in the SGGX paper). This is why, the correct frame to pass tosggx_sample
issh_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 …