Tritonio

PS1 Warped textures

Dec 24th, 2018
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!

PS1 didn't have perspective correct textures, and you wrote code to do your own transformation from 3d -> screen space.

Here's a slide that shows the impact of textures not being perspective correct: http://graphics.stanford.edu/courses/cs248-98-fall/Lectures/lecture18/slides/walk014.html

The way games generally got around this problem is to cut up their geometry into small enough triangles that the perspective correction error isn't that big. But it still exists, and is especially noticable on flat planes near the camera (probably like the road in Driver 2?)

When the triangles intersect the near plane, the game has to clip the triangles so that you don't get artifacts like this: http://stackoverflow.com/questions/7378632/frustum-plane-calculus

That clipping is in 3d space, so the resultant vertices generally have correct texture coordinates. As the clipped vertices get closer to the real triangle vertices, the perspective errors go to zero. This is likely what causes the 'snap to grid' effect you are seeing.

It's also possible that some of the artifacts are from game code optimized to use low precision fixed point math instead of floating point math, or using floating point math incorrectly in ways that lead to large-enough-to-be-noticable errors.


It was an issue with the graphics hardware in the PS1.

It didn't have floating point precision so vertices would jump around due to lack of precision.

It also had no texture filtering which caused the textures to warp when viewed from some angles.


It was actually 4.12 fixed point. That means that 4 bits of the number represent the whole number part with the first bit being a sign bit, and 12 bits represent the fractional part. This limits the precision to -7 to 7 and the fraction precision to 0.0002. This meant the entire 3D scene width was compressed into 15 units with 4096 divisions in each unit. This is not bad close up, but as depth increases you eventually run out of discreet x (and y) positions.

Fixed point math is also more susceptible to rounding errors, than floating point.

And in racing games, for example, they didn't have the processing power to use stuff like geomipmapping to reduce edge seams.

The same problem can be seen in early 3D PC games that used software rendering.

Add Comment
Please, Sign In to add comment