Visualizing floating point precision loss, or "why #gamedev stuff behaves badly far from the origin"
The blue dot is end of the desired vector. The black dot snaps to the closest representable point (in a simplified floating point grid with only 4 mantissa bits)pic.twitter.com/o1HKYByIbS
So I've been down this road before, but I get into trouble whenever I need to do something like magnitude of a vector. The intermediate values before the square root get so high I see truncation. Is there a good solution for that?
-
-
Why are you taking the size of a vector that points to an object from the origin? Why is that a useful thing? You usually want the vector from e.g. camera to object - feel free to do those in floating point. Because more precision near the camera is totally a useful thing.
-
The only time the size of vector from origin is used (that I know of) is BSPs. They have precision problems whatever units you do them in, and having that precision wobble is doubly evil.
- Näytä vastaukset
Uusi keskustelu -
Lataaminen näyttää kestävän hetken.
Twitter saattaa olla ruuhkautunut tai ongelma on muuten hetkellinen. Yritä uudelleen tai käy Twitterin tilasivulla saadaksesi lisätietoja.