# How did most fifth-generation consoles avoid wobbly graphics?

According to Why do 3D models on the PlayStation 1 “wobble” so much? the PlayStation had a problem with wobbly graphics because

Filling a triangle involves visiting every pixel within it and deciding which colour to put there. To paint a texture that properly obeys perspective you'd need to perform a divide stemming from that 1/z operation for every pixel.

Divides are expensive so the original Playstation doesn't do them. It just squeezes the texture to fit, disregarding any consideration of perspective. That's only mathematically correct if 1/z is constant over the entire triangle, so you tend to see greater problems with geometry as it gets to a greater angle and as it gets closer to the camera.

This makes sense. Division is expensive relative to other arithmetic operators, so it's not surprising the PlayStation graphics chip couldn't afford to do it for every pixel.

But then how come the Saturn and the Nintendo 64 could? Did they actually carry out a division for every pixel? Or some approximation thereof that was good enough to avoid wobble? Or some other solution?

• I don't know the Saturn actually was able to avoid the problems of the PlayStation, given that its even more primitive 3D capabilities. The Nintendo 64 avoided them simply by coming out over a year later with more sophisticated hardware. That was back when Moore's Law was in full effect and being exploited very effectively.
– user722
Jan 31, 2020 at 11:59

The Nintendo 64 not only has full-perspective texturing, it can afford bilinear filtering — for each output pixel the PS1 samples the input texture exactly once. The N64 samples it four times and linearly interpolates according to how close it is to each (in two dimensions, hence bilinear).

The Saturn has a couple of tricks up its sleeve:

• the primitive is a rectangle, not a triangle; and
• it can do multilayer 2d backgrounds and Mode 7-type floor effects.

The Saturn gets to 3d by extending its sprite blitter so that they can be distorted into any quad. Which is a slightly tortured route, so the good Saturn games tend to have relatively simple geometry constructed from quads, and very low-resolution textures are common because you can't tile them without using multiple quads. So although the middles of each quad still shift around in a perspective-incorrect fashion it's usually less obvious due to the lower internal detail, and the lack of an obvious diagonal strut across each quad.

A disadvantage is that the machine has significant issues with clipping — check out any video of Duke Nukem 3d or Quake where the player walks along a corridor close to the wall. Quite a few PS1 games do a similar thing where rather than determining exactly where a polygon intersects z=1 it's cheaper just to push any vertices that should be behind z=1 forward a bit, but on the Saturn it's even more pervasive because even if you're lucky and a quad is trimmed so that it's still a quad, you can't adjust texture coordinates.

Sega themselves adopted a very low-contrast texturing scheme partly to hide that; if you watch something like Sega Rally then you can see the geometry distorting as it meets the camera, but since each quad on the floor is just different shades of brown, each hills is just different shades of green, etc, it's not obvious.

The Saturn also has an advantage for some kinds of game because of its support for Mode 7-style background layers, i.e. tile-based content that is distorted as the raster runs without ever being in a frame buffer, much like the Super Nintendo a generation before. As long as the camera doesn't roll, you can get perspective-correct drawing of floors and ceilings, correctly clipped. That's how Virtua Fighter 2 and all of the other fighting games that follow it do their arenas. So the backgrounds in those games are essentially free, and are never really rasterised in the framebuffer sense.

Two issues... the wobble was because the post-transform 2D vertex coordinates for each triangle were integers... So the vertex could only move on discreet pixel locations. This makes smooth vertex movement virtually impossible. PS2 for instance fixed this by having fixed point fractional screen vertex locations, helping smooth movement out. Other later consoles had floating point 2D vertex positions.

The texture warp when drawing quads was due to the texture interpolation having no concept of screen depth, so only worked in linear 2D screen space. So when a square polygon is transformed with perspective there will either be a crease or weird curved UV waarping, depending on the implementation. To have smooth 3D UV interpolation you need to use non-linear UV interpolation based on vertex depth values (so 1/u and 1/v are interpolated in proportion to 1/z, rather than simply interpolating u and v by screen position). The triangle unit on the PS1 simply didn't have access to this data since the GTE only returned 2D screen locations with no depth.