mmp / pbrt-v4

Source code to pbrt, the ray tracer described in the forthcoming 4th edition of the "Physically Based Rendering: From Theory to Implementation" book.
https://pbrt.org
Apache License 2.0
2.8k stars 429 forks source link

Increasing iterations for Hair BSDF #379

Open Opioid opened 1 year ago

Opioid commented 1 year ago

I have a question about increasing the value of pMax in the Hair BSDF, especially with regards to sin2kAlpha/cos2kAlpha. Those arrays are sized accordingly, and all values are filled in a loop. But as far as I can tell only the indices 0 through 2 are used later, regardless of pMax. Is this a mistake, or am I not seeing something.

EDIT: I noticed that in pbrt those arrays have a constant size, despite the BSDF being almost the same.

In my experiments increasing pMax makes almost no difference, even for very bright hair, because the AP values get very small after just a few iterations. But this is with my own implementation, so there might be bugs. In the book the example on blonde hair is quite remarkable.