jalberse / shimmer

Physically based rendering in Rust
Apache License 2.0
33 stars 0 forks source link

Fix dpdx, dpdy approximations resulting in NaN in some cases. #41

Closed jalberse closed 8 months ago

jalberse commented 9 months ago

approximate_dp_dxy() will sometimes return NaNs for dpdx and dpdy.

These are used for texture filtering; I've disabled the texture filtering option for now, since we're not actually doing anything with it atm.

The issue is when n_down_z.z is 0, which propagates out to NaN after some operations.

jalberse commented 8 months ago

This appears to be fixed now.