3 ms·
> Use of float makes it unlikely that you’d run it on the PlayStation, which has no FPU. I think this sentence just made me realize what made the PSX graphics
by embedding-shape 2mo ago
> Use of float makes it unlikely that you’d run it on the PlayStation, which has no FPU.
I think this sentence just made me realize what made the PSX graphics look so "PSX", I'm guessing all the positions/translations and similar stuff were actually not floating point which they typically are (today at least), hence the classic look of triangles/meshes kind of "jumping"? Huh...
- anthk 2mo agoIntegers. You could almost emulate a PSX in a potato (Pentium MMX) with -ffast-math -O3 except for Alpha channel (transparencies) in textures.
- ndepoel 2mo agoThe jumpy polygons are because the PSX's GPU only accepts vertex positions in screen coordinates, meaning that vertices always snap to hard integer values. There is no sub-pixel accuracy. That's not a limitation caused by the PSX's lack of an FPU though. A large part of the render pipeline and standard libraries are built around the use of fixed point math, i.e. using integers to simulate decimal values. The GTE co-processor which handles 3D math makes use of standardized fixed-point types. So the PSX would have been capable of calculating sub-pixel coordinate values, it's just that the communication between CPU and GPU was designed to use only integer screen coordinate values.
- spicyjpeg 2mo agoIt's slightly more complicated than that. The PlayStation's geometry pipeline uses fixed-point coordinates with a decent amount of fractional precision (12 bits), however the GPU lacks support for subpixel rendering and operates entirely in screen space using integer X/Y pixel coordinates; all transformed vertices thus have to be rounded CPU-side before they reach the GPU. The GPU is also a 2D rasterizer only, with no perspective correction nor depth buffering, so transformed Z values are used on the CPU to sort polygons back to front (typically using hardware-assisted linked list bucket sorting) and dropped afterwards [1]. [1] https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/08_spinningCube/main.c#L252-L296 https://github.com/spicyjpeg/ps1-bare-metal/blob/main/src/08...
- meindnoch 2mo agoNo. The reason is that the PlayStation doesn't have perspective-correct texcoord interpolation.