ChameleonRT icon indicating copy to clipboard operation
ChameleonRT copied to clipboard

Possible bug in gtr2 sampling

Open theartful opened this issue 1 year ago • 0 comments

First of all, thanks for the amazing project. I've learned a lot going through it.

I was wondering about this section of the code https://github.com/Twinklebear/ChameleonRT/blob/a148d2e4ee5906fb7e9b5d8023d64bba29ff3529/backends/vulkan/disney_bsdf.glsl#L142-L149

Specifically: https://github.com/Twinklebear/ChameleonRT/blob/a148d2e4ee5906fb7e9b5d8023d64bba29ff3529/backends/vulkan/disney_bsdf.glsl#L145-L146

Shouldn't it be:

	float cos_theta_h = sqrt(cos_theta_h_sqr);
	float sin_theta_h = sqrt(1.f - cos_theta_h_sqr);

I've checked other implementations, and the sqrt is used, and it also makes sense.

theartful avatar May 17 '24 19:05 theartful