This piece of code is provided by @olivier.fx. I didn't came up with the logic myself, but for a far-field model the "normal" is always the incoming direction, not really a feature of the object…
For the current two enums yes, but named struct seems easier understandable. On the other hand, it introduces additional storage and is seen as a compromise for not having enum-typed sockets. I'm…
I don't see tooltips in any other shader nodes, so I'm not sure if there is a guideline here, and I also have no idea about UX. I thought it would be good to provide clear information here, so the…
In the original implementation the pdf involves sampling microfacets, it is as costly as evaluating the BSDF itself, and it is also just an approximation, so not sure if it's worth it and how to…
bsdf_util.h
identifier
instead of name
identifier
instead of name
microfacet_fresnel()
Such value seems quite arbitrary, I would lean towards assigning 1 to cos_theta
when isequal(bcone.axis, -point_to_centroid)
and comment that dot product doesn't necessarily returns 1 in such cases due to precision issue.