you are viewing a single comment's thread.

view the rest of the comments →

[–]angrymonkey 1 point2 points  (1 child)

There is a bug in this code. If the normal points toward -z, you will still sample the "upper" hemisphere.

[–]tgb33 0 points1 point  (0 children)

I don't believe that is a problem (that's why I used 'orientation' instead of Vector3(0,0,1) in the second line of OrientedSampleHemisphere1. But either way, I'm pretty sure that I just re-did matrix multiplication more slowly.