[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/3/ - 3DCG


View post   

File: 19 KB, 450x163, _SHADING.gif [View same] [iqdb] [saucenao] [google]
732467 No.732467 [Reply] [Original]

In simplified terms can you explain the difference between phong and gourard shading? They look different from one another but more similar to eachother than flat shading.

everything on youtube i found was explaining the math equations and I dont think thats going to help me if i only need a general gist of what their uses and strengths and weaknesses are.

>> No.732474

>>732467
Basically, Gouraud shading is Phong shading, but executed in the vertex shader rather than in the pixel shader.

>> No.732476

>>732474
Gouraud Strength: much faster since it only has to calculate a few hundred/thousand vertices rather than millions of pixels

Gouraud Weakness: sharp highlights are pretty much impossible or at the very least artifact ridden and inconsistent across the surface.
You also cannot use pixel shader effects like normal mapping with it.

>> No.732478

>>732476
>>732474

So is it running the same calculation but, just a higher resolution so to speak? The pixels woul exist on the vertexes anyway so I feel like it would be a similar process. Just one rougher and more generalized than the other.


Looking around more and seeing photos has left me with a question, did runescape back in the day utilize Gouraud shading? it sort of has that look to me, with a full satin look.

Is Gouraud and phong used at all today? Either by itself or in conjunction with other techniques? It looks artificial but Im sure its still relevant in some way somehow.

>> No.732498

>>732478
>So is it running the same calculation but, just a higher resolution so to speak? The pixels woul exist on the vertexes anyway so I feel like it would be a similar process. Just one rougher and more generalized than the other.
The process is similar, yes, but calculating shading for, say, 10k vertices and then interpolating between the vertices in the camera's framebuffer (pixels) is a ton faster than computing the shading in the framebuffer.

>Looking around more and seeing photos has left me with a question, did runescape back in the day utilize Gouraud shading? it sort of has that look to me, with a full satin look.
It does seem to use some kind of vertex based lighting, but I'm not sure if it's Gouraud or just baked into the vertex colors.

>Is Gouraud and phong used at all today? Either by itself or in conjunction with other techniques? It looks artificial but Im sure its still relevant in some way somehow.
I'd imagine it being popular for mobile games even if it's just part of the overall lighting process. It's nearly indistinguishable from Phong for very high roughness values.

>> No.732507

>>732467
It's literally on wikipedia you giant mongo

>> No.732531

a thread died for this stupid question

>> No.732532

>>732467
You can think of it as gouraud calculating the only light at each vertex with the same calculation as phong and then fill in the pixels inbetween them by doing a linear interpolation between the vertex values of that face.

In the same way as Gouraud interpolates color inbetween vertices the basic 'phong' instead of the color interpolates the normal vector. So now each pixel has a unique direction it is pointing in. now the very same light calculation used to decide the color of each vertex is applied but to every pixel.

Gouraud have no real strengths cept performance and retro look. It's legacy tech and every single device that we use to play videogames these days can handle pixelshaders at high framerates just fine.

Unless you are making homebrew for 90's hardware there is no reason to use gouraud unless you want it to look old and shitty because of: reasons.

You need to understand how it works tho if you wanna write shaders as modern shaders are a combination of both per vertex and per pixel calculations.

>> No.732600

>>732531
im cooming im cooming im gonna im gonnna