Help Creating a Phong-Gouraud Shader Material?

Hi!

I’m developing a retro PS2 styled game, as model-wise, it’s cheap to hire someone to make them and they come out relatively quickly, and also I’m a complete sucker for PS2 and some early PS3 stuff, they look artistically and stylistically better than the hyper-realistic stuff released now. Hyperrealism leaves less room for creativity in my opinion, but enough about my opinions, I need help!
A bunch of research has led me to a very crucial thing used in PS2 games, Phong shade or Gouraud Shading, though I think Phong best suits my purpose.

Surprisingly enough games that relied on shadows in PS2 were actually Unlit levels, infact most games from this era were ‘Unlit’, unless it’s a Quake 3 type game (graphically).

From what I conlcude, levels are usually given a Gourad shader and the player/npc/enemey models are given a Phong shader, so I think this is the model I will use from here on out.
Here’s a good example, this scene from Silent Hill 2 captures this perfectly, also one of my favorite scenes in a horror game.

Mannequin

I also want to mention that since the scene is unlit, the game uses projected texture to simulate the lighting cone, no idea how to do that either. I think how they do it is that they keep the base texture and shadow maps separate, which allows you to re-blend the visuals when dynamic lights come into play. Again, no idea how to do this.
For a PS2 style game, its exclusively point lights and cone/spot lights, and really only 1-2 dynamic lights, the rest should be lights baked into the scene. No movable lights either, as no way in hell the PS2 could handle ray tracing without catching on fire, so all the lights are on static or stationary.

I already know how to get the lighting down, but I can’t really test it accurately without the shader. Post Processing is also something I can’t accurately test, all I know is that I have to turn up the bloom as much as possible and turn off everything else, maybe let some things stay so the game doesn’t feel too dated, but again, nothing will be 100% accurate till I figure out how to do this shading.
My expertise is in game mechanics and pretty much anything that doesn’t involve the visuals, so, I’m incredibly stumped on where to start or what to do, and how to even program it, it’s way out of my field.

So, how do I make a Phong or Gouraud shader and how to I apply it to my materials and scenes?

Thank you in advance.

Edit: I’m on 4.26.2

1 Like

bump

bump

bump

You should be able to use raw shader code in a material.
Here are a couple of starting points to explore:

1 Like

I’ll check them out!

The reason your not getting an answer is most people have no idea how, i remember doing it somehow but cant find the video, however it is indeed possible on the shader graph.

There are 2 ways to approach this situation

Not use the flashy stuff that makes “realistic” games look like it constantly just rained indoors somehow, instead keeping the roughness under control, and just using reflectioncaptures, which might actually look better than redoing the shading. Real life rarely has a mirror shine anywhere, so it likely will look actually realistic, instead of just labeled as “realistic”.

Use forward renderer+Lit material set to fully rough and with specular set to 0, it will be able to accept lighting from lights that way without any reflections or specular of any kind, and due to forward renderer it will give you access to the lightvector node, which should speed up the process a lot, pair it with the dotproduct node and it might be what your looking for.

1 Like

I would recommend not messing with render c++ files.

Make everything Unlit, and set 2 parameters for light position. Then with BP set those 2 lights based on proximity (you can use triggers so when the player enters a light radius the material knows about it).

For the Gourad shader just do the lighting calculations on the material pass it through a vertex interpolation node (this way is calculated per vertex, not per pixel).

For the Phong shader just do the code straight away in the material.