Join Nostr
2026-05-09 18:13:32 UTC
in reply to

Tom Forsyth on Nostr: nprofile1q…s26t9 With regular integer Z buffers which store (1/Z) as an integer, ...

With regular integer Z buffers which store (1/Z) as an integer, the problem is that the precision is all bunched up by the near clip plane.

Switching to floating point solves nothing - I get even more precision at the near plane, where I already had too much precision

But if you store "inverse Z" i.e. 1-(1/Z), so that 0.0 is at the far clip plane and 1.0 is at the near, then the two cancel out. My extra precision from using float32 is out where I want it - in the distance.