Back in college when I took graphics the phong algorithm for fragment shaders was just kinda there, so I'd often forget and have to look back. Now that I'm getting into Opengl on my own time, I should learn it lol. This tutorial explained everything perfectly! I can finally understand the code for it and why we write what we write in it!
Furthermore, this explains lighting a billion times better than the OpenGL tutorial I was reading that did this lighting method, resulting in a horrendous, disorganized plane crash that brought me to this video. So I’ll make sure to pass on this video to other aspiring programmers.
Apart from the fact that the summation "epsilon" is of course called sigma (greek S, for sum), the rest of the information is completely accurate. A nice video, very well illustrated and planned, and very engaging narration! Thanks!!
I'm still learning how all of this works so this is great. I have a question though. I know that Phong shading (or shading algorithms in general) uses linear interpolation. I'm currently researching on the subject of fast interpolation, and I have found a very fast way to interpolate, but it's based solely on integer math. So the input points and the interpolated points are integers. Would it be possible to use this integer based interpolation in any shading algorithm and still get a decent result? Or in a more general sense, is there any use in shading for an interpolation algorithm based on integers?
The interpolation occurs between the vertex shader and the fragment shader. Unfortunately this stage is a part of the “Fixed Function Pipeline” meaning that it is not programmable. At least in the metal shading language. However this does sound really cool! Are you able to share?
It's great that you've done these videos, but there's a minor clarification so people who aren't familiar with the summation notation and look at other sources don't get confused. The summation symbol is a capital sigma (Greek "S"), standing for "sum"'. It does look kind of like a capital "E", but it's not epsilon. There is an epsilon in the notation though, the lower case "e" looking symbol under the sigma. It stands for "element of", and in this context indicates that the sum of all the elements in the set is being calculated. It's actually a good shorthand for a Swift for...in loop. The more frequent notation is to put "i = a" under the sigma instead of the epsilon thing, with "b" above the sigma to indicate that the sum is done over the integers in the range a...b, which is a good shorthand for a C-style for loop.
You're using the "hat" so, A hat = (0,1,0) Typically when dealing with vectors, the hat symbol represents the basis vectors for a coordinate system. In your example A hat == Y hat. The cartesian system has basis vectors (1,0,0),(0,1,0),and(0,0,1). People may get confused if they use this symbol expecting it to represent an arbitrary vector. 5:55
06:00 The magnitude of B is not 0.5, it is sqrt(0.5). Or so I think :/ Never the less, pretty good Video. Im reading alot about BRD-Functions right now for my Bachelors Thesis and it is super overwhelming... Your video helped, thanks :)