Live data from Hacker News

Picophysics: Single file physics for games on platforms like N64, PSX, DC

gitlab.com

21–25 of 25 posts

Re: Picophysics: Single file physics for games on platforms like N64, PSX, DC

#21
post #5

Everything being static inline makes it hostile to these older systems which have limited RAM. Use of float makes it unlikely that you’d run it on the PlayStation, which has no FPU.

> 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...

It'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...

Re: Picophysics: Single file physics for games on platforms like N64, PSX, DC

#22
post #5

Everything being static inline makes it hostile to these older systems which have limited RAM. Use of float makes it unlikely that you’d run it on the PlayStation, which has no FPU.

> 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...

No.

The reason is that the PlayStation doesn't have perspective-correct texcoord interpolation.

Re: Picophysics: Single file physics for games on platforms like N64, PSX, DC

#23
post #14
post #9

Earlier quoted context omitted.

Only one of the consoles listed lacks an FPU, the other two (N64 and DreamCast) both have FPUs. Despite its age, the FPU on the N64 was plenty fast and it was used extensively.

The N64's FPU will usually be faster than doing fixed point on the CPU. You are actually multiplier/divider bound, and the CPU can multiply about 10 bits per cycle and only divide 1 bit per cycle. Since you aren't multiplying the sign/exponent bits, it's faster to multiply/divide the 24 mantissa bits of a 32-bit float than it is to multiply/divide the 32 bits of an int. And with fixed point, you then have to throw in…

According to Kaze Emanuar, the N64 is actually memory bandwidth bound in almost everything it does.

Re: Picophysics: Single file physics for games on platforms like N64, PSX, DC

#24

Earlier quoted context omitted.

> 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...

No. The reason is that the PlayStation doesn't have perspective-correct texcoord interpolation.

That's a separate issue from the wobbling.

Re: Picophysics: Single file physics for games on platforms like N64, PSX, DC

#25

Earlier quoted context omitted.

> 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...

No. The reason is that the PlayStation doesn't have perspective-correct texcoord interpolation.

Well, that’s half of it, and the other half of it is no sub-pixel coordinates.
Post reply on HN