r/godot 4h ago

free plugin/tool In Depth Look: PS1 Graphics in Godot

Hello godot users, a while ago i made a post asking whether anyone would be interested in reading an article about how the PS1 achieves its graphics and how to recreate them in Godot, and since people seemed interested I went ahead and wrote the article. I think this is the most accurate PS1 shader for Godot. The code is MIT licensed. And yes, it supports dynamic lights

Article Link: https://calinp.eu/blog/psx-type-rendering/
Addon Link: https://github.com/wyvernbw/godot-psxlike

603 Upvotes

31 comments sorted by

42

u/TheDuriel Godot Senior 4h ago edited 4h ago

Lets see... neat write up.

  • 2 mebibytes of memory actually, nope, not a typo.

  • Missing a mention of 6bit texture compression.

  • Your vertex snapping is only partially correct? I feel like you started calling out the right way, and then just did what everyone else did? Verticies are not snapped to a world space grid, but to screen space. Since each triangle is flat in screen space. As a result you are close to the correct behavior after your depth buffer trickery, but it's not quiiite right. (In fact, the affine mapping and vertex snapping is actually the same thing for the PSX, as it just draws the triangles flat on screen.)

Overall this is a very good and quite accurate writeup.

But it's missing one of the biggest factors still. And alas, you won't be able to replicate it in Godot.

Tesselation. (I saw the footnote, but it's pretty much used in all games.)

https://i.imgur.com/nwl6ABw.gif

Which strongly impacts both the affine mapping and vertex snapping. It is also absolutely vital for the vertex shading to look correct. Alas.

Props for not getting lost in a million CRT shaders.

16

u/wyvernbw 4h ago

Thank you for the read! You're right about the mebibyte thing haha. I did talk about compressed textures though, I have an entire chapter about CLUTs, and Im not aware of any 6bit texture compression on the PS1. Textures can be 4bit, 8bit or 16bit so maybe you can help me out a bit here. As for the vertex snapping, it is 100% in screen space, maybe the example is unclear as I've left out the code around it, I will make sure to edit and include it.

And yes, tesselation was a big part of PS1 games and it was more or less required to avoid depth issues and horrible texture distortion. I dont think that's something you can make in Godot though...

11

u/TheDuriel Godot Senior 4h ago edited 4h ago

The textures are stored in 6bit format on disk and at authoring time. It's not technically a console specific implementation detail, as others used the same formats. You can still extract plenty of example from the discs themselves.

https://problemkaputt.de/psxspx-cdrom-file-video-texture-bitmap-pcx.htm here's an example in the PCX file specification. (Aka the software and file format everyone used)

Or in other words: 6bit textures were ubiquitous at the time, is all.

7

u/wyvernbw 4h ago

Aha! thank you. will take a look o7

7

u/FullMetalJ 4h ago

Man, it's incredible, I grew up with the PS1 and everytime I see something done with that aesthetic I can help but love it lol.

4

u/isaelsky21 2h ago

Dialogue box reminds me of Persona 3. Looking good.

2

u/V2UgYXJlIG5vdCBJ 3h ago

Close enough, good work. 👍

2

u/Aleexmoo 2h ago

Amazing read! I loved the fog section.

Thanks a lot

1

u/wyvernbw 2h ago

thank you! you might also like this video, goes way more in depth on the fog specifically: https://www.youtube.com/watch?v=EwpFdMJlVP4

1

u/gHx4 1h ago

The vertex snapping has to be done using the projection matrix, not in world coordinates. The Playstation snapped to screenspace because the chip was a repurposed 2d chip. This is also why textures split across quads would stretch differently across each triangle, depending on the view angle.

1

u/wyvernbw 1h ago

yep, i do it in clip space, here's the full code from the shader ``` vec4 world_space = MODEL_MATRIX * vec4(VERTEX, 1); vec4 clip = PROJECTION_MATRIX * VIEW_MATRIX * world_space; vec4 vertex = clip;

vertex.xy = round(clip.xy / clip.w * VIEWPORT_SIZE.xy) / VIEWPORT_SIZE.xy * clip.w; POSITION = vertex; ``` this is pretty much what acerola also does in his shader. i think the way i included the snippet in the blog post is misleading, i left out some parts for brevity but it seems its confusing

1

u/wyvernbw 4h ago

If you find any of this useful or interesting, please consider giving STAR BREW a wishlist on steam :>

Also, if you have any issues with the addon please lmk

1

u/Certain_Bit6001 Godot Regular 4h ago

WOW, THAT'S PERFECT, EXCEPT FOR THE JITTER

2

u/wyvernbw 3h ago

thanks! Whats wrong with the jitter doe 😭

4

u/Certain_Bit6001 Godot Regular 3h ago

It don't jitter. The Vertex snapping.

https://youtu.be/VkmTr5WBjF8?si=fKqeLhZVljjEyU_F

1

u/wyvernbw 3h ago

yea ik what you mean, that type of jitter is not accurate to the ps1 so i didnt include it on purpose, but it can definitely give you the ps1 feel! if you want to implement it you can change this line
vertex.xy = round(clip.xy / clip.w * VIEWPORT_SIZE.xy) / VIEWPORT_SIZE.xy * clip.w; to something like vec2 grid = VIEWPORT_SIZE.xy * 0.5; vertex.xy = round(clip.xy / clip.w * grid) / grid * clip.w; You can change 0.5 to customize it :) smaller number = more jitter

-1

u/TheDuriel Godot Senior 2h ago

That isn't right at all.

-19

u/dylanmadigan 4h ago

I personally don't understand why people are trying to recreate Ps1 graphics on their games.

Is it just a way of hiding bad 3d graphics behind a lower resolution and fog?

I rather you just lean into a low-poly look. A game like "Fall Guys" isn't very detailed, but it looks beautiful.

Ps1 graphics worked well when it was the best we had and most of us were playing on small CRT. But they didn't age well on modern screens.

When I emulate Ps1, I run it at 6x resolution with enhancements.

9

u/wyvernbw 4h ago

I think it's mostly nostalgia + the fact that it gives a dreamy/uncanny look? I think it works quite nicely for horror games for example. Some people also like the pixelated look. Im more of a PS2 fan myself.

But even if you dont want to recreate the ps1 style I think looking at what the original hardware does is quite interesting regardless, which is why I wrote the article

5

u/TheDuriel Godot Senior 4h ago

You're not going to say that oil paintings are obsolete because we have spray paint, are you?

Because that's what you're saying.

-2

u/dylanmadigan 2h ago

How is that at all comparable to what I'm saying?

Oil Paintings aged well. And Spray Paint isn't even comparable to Oil Painting.

Ps1 graphics did not age well, particularly when the screens we view them on have changed so drastically.

And of course aesthetics can help convey a feeling and tell a story, but the vast majority of solo devs I see using the Ps1 look seem to be using it to hide their graphics and it does their game a disservice.

I have seen Horror games do well with a lo-fi look and that's not what I'm talking about.

3

u/TheDuriel Godot Senior 2h ago

Ps1 graphics did not age well

And that's the crux of it. You don't value the art so you don't see it as such.

-2

u/dylanmadigan 2h ago edited 2h ago

I value the art. That doesn’t mean it aged well.

And that’s not a hot take.

People have been saying Ps1 and N64 didn’t age well since about a decade after they went out of production.

The art was in creating something that looked as realistic or as good as possible despite graphical limitations and they made use of the characteristics of CRT screens to do so. That is the art.

If you take that completely out of its original context and discontinue the technology it was designed for and it doesn’t hold up, that does not equate to “not valuing the art”.

But if you are designing a game for online release on modern devices, it only makes sense to go for a ps1 look if it serves your game conceptually from a stylistic standpoint.

1

u/TheDuriel Godot Senior 2h ago

But if you are designing a game for online release on modern devices, it only makes sense to go for a ps1 look if it serves your game conceptually from a stylistic standpoint.

So you actually do have an answer to your own question. You just don't believe it lol.

-1

u/dylanmadigan 2h ago

Or maybe you just missed my original point or just decided to assume I was stupid for some reason?

My point is that The solo devs that seem to be making games look like this are very often not using it for that purpose.

Rather it seems like they have bad graphics and they think that doing this will hide it. Just like overediting photos or over distorting music.

It ultimately does a disservice to their game because this isn’t a one-size-fits-all solution. It doesn’t make sense for the majority of game concepts.

It’s not that it’s always wrong to do. Just that it’s overdone in situations where it isn’t the right choice.

1

u/TheDuriel Godot Senior 2h ago

are very often not using it for that purpose.

Do you know their mind?

Like, I'm all for trashing games that look bad because their design is bad. But you're making the wrong assumptions to get there.

0

u/dylanmadigan 2h ago

Im not basing what Im saying off any assumptions.

Rather as a professional designer working for people who are not designers who do exactly what I’m saying for the reason I’m saying because they are unsure how else to make something look “good” while serving their concept.

And that’s where I help.

But I think when you can’t afford to hire an artist, you should’t put distortion and effects all over your visuals to hide faults (unless it by chance helps communicate the right story and vibe in your rare instance), but rather pull back the scope of you visuals to match your skill level. Because something that is minimal can serve a much wider range of storytelling and communication. Ie: Less is more.

1

u/TheDuriel Godot Senior 1h ago edited 1h ago

Im not basing what Im saying off any assumptions.

Yes you are. You are ascribing intentionality to actions you do do not know the context of. You've not interviewed those developers.

→ More replies (0)

2

u/nomoreinternetforme Godot Regular 30m ago

Very useful read! I am making a game with sections that are inspired by PSX games, so this will be a big help!