Live data from Hacker News

Show HN: Tiny PS1-like Renderer in 500 lines

github.com

31–40 of 47 posts

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#31
Love the project and the spirit of it. Brings be back to playing FFT.

Question to all C/C++ programmers out there. Why are your variables so terse? I have no idea what td and dt mean and why they are both in the same function. I'm genuinely trying to read your code and have no idea what is happening because there is seemingly a desire by the author to keep variables as short as possible. Why?

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#32

Have PS1 triangular graphics made a retro resurgence yet? Because I'm so down for that.

They need to be coupled with the same bespoke, precise controls and input handling though. There's a tightness to a lot of PS1 and N64 games that takes care to replicate. And Unity and friends don't exactly help you in that department.

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#34

Earlier quoted context omitted.

Yes, very much so. Mostly for horror games, for some reason. https://www.nme.com/features/gaming-features/the-resurgence-... https://hauntedps1.itch.io/demodisc2021

Silent Hill inspired, I guess

And Resident Evil, surely?

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#35
post #33

Very cool and nostalgic! Had no idea the PS1 look was trending. Also, due to Stack Overflow conditioning: fgetc() does not return 'char', it returns 'int' else EOF won't fit.

> fgetc() does not return 'char', it returns 'int' else EOF won't fit.

Or more precisely: don't store the return value in a 'char' and check if it is EOF. On some platforms (e.g. gcc ARM eabi), regular 'char' is unsigned and the check fails.

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#36
post #7

I was wondering how this was done in 500 lines...then I saw the 5000+ line library file borrowed from another project. I do enjoy the look of your results though. How long before somebody includes your library and says they created PSX graphics in 25 lines?

depends on how you look at things. The library is a rendering library (presumably for calling GL).

And what about any of the operating system calls that might get used? It's also a library (despite the source code not being in the project).

The actual code to compute the logic of the graphics PS1 style, is indeed around 500 lines.

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#37
Glad to see PS1 style rendering that simulates the affine texture warping side effects of the console. The original Playstation was very much not designed with 3D in mind, lack of perspective correction on textures lead to the aforementioned warping.

Vertex coordinates were rounded to whole integers, giving that hallmark polygon jiggle effect from the rounding that 'snapped' them in place. The complete lack of a z-buffer also lead to lots of z fighting, as the system rendered polygons strictly in the order they were calculated.

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#38
post #8

heh, I wrote an N64 one not too long ago with the exact same style: https://github.com/glouw/gel

i came across this a few days ago searching n64 style rendering, its awesome! i plan on trying to make a spiritual successor of sorts for blast corps using those techniques in another renderer

Re: Show HN: Tiny PS1-like Renderer in 500 lines

#40
Looks great!

I couldn't help noticing that it tests every pixel on the "screen" to see whether it's inside a face. Back in the software renderer days we'd run the inner loop just for the pixels that fell inside a triangle. But then you'd need to explicitly handle polygon clipping and it would greatly complicate the code. I guess 320*240 tests is nothing these days.

Anyway, great job!

Post reply on HN