문제

So in popular games like Ratchet & Clank and Grand Theft Auto, when the player flies out of the map and keeps going further and further away, the character and all the vertices start to 'vibrate' more and more until the character is unrecognizable... Why does that happen?

도움이 되었습니까?

해결책

My guess would be that it is due to floating point inaccuracy. As the character goes further away from the origin of the map, the (x, y) coordinates of its vertices (that are most likely single-precision floating points), get bigger and bigger.

The issue here is that single-precision floating points are only able to represent correctly around 7 correct significant digits in decimal representation. Hence, if the x position of the character starts to approach 10,000,000, all the vertices that are between 10,000,000 and 10,000,001 will actually be snapped to the same x value (the closest value representable in single-precision floating-point). This "snapping" (or "rounding error") is what cause the vertices not to be displayed at the intended position, and hence creating artefact such as vibrating, or huge deformation that makes the character not recognizable anymore.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top