Blinn vs Phong
Posted by Marius Oberholster on Wednesday, January 3, 2018 Under: News
Hey all!
Believe it or not, the Blinn and Phong models are not all that different. The goal with Blinn is to have specularity that is similar to Phong, but without it's sensitivity to proximity. This give many advantages within NPR, because it gives yet another thing you can manipulate - the size of the specularity. Source links will be at the end of this post.
Let's look at their formulas (don't worry, this doesn't get very technical) and the variables.
R = Reflected direction to the light source
N = Normals (like surface of the shape)
L = Light source (location)
V = Viewer (location of the eye or camera)
H = Is a required vector to calculate Blinn (yeah, I don't know what in the world the wikipedia article is saying its function is, hahaha)
Phong:
Ispecular = Iincoming kspecular max(0,R.V)nshininess
where
R = 2N(N.L)-L
Blinn:
Ispecular = Iincoming kspecular (H.N)nshininess
where
H = (L+V)/2
Now when you know what you are looking at in the equations (which you will have a fair idea if you read the articles), you will see that they are extremely similar in approach. It is only what goes in the parenthesis that differs - granted this is a very crucial and integral part of the equation (it really defines how the specularity will respond to the light source).
This difference is what gives us a proximity sensitive equation in Phong. That means that the light source will respond very sensitively to the distance of the light source. The closer it is, the smaller and brighter it will be. The further away it is, the larger and dimmer it will be. Very similar to the energy loss provision we find in the Cycles toon shader (imo). This is fine in some instances (like the Esther 6 demo), where all the characters are a fair distance from the same light source - no major changes will occur, but it becomes a serious sensitivity issue with larger scenes and moving lights, like with the space garage demo.
Blinn, on the other hand, is designed to be a lot like Phong in how it's specularity is calculated, but with the exception of scale sensitivity (ie, energy loss). This means that whether the light source is close or far, you won't experience much of a difference and that is phenomenal for big scenes and also fine for smaller scenes. You could say it's a very good all'round solution for specularity.
- Light sources differ - how does it know what to do?
These equations do not define your light source though. The vector information you give the equation will determine how the specularity will show up in relation to the light source you have. For example, the equation simply asks you for a point in space (X,Y,Z). You need to find a way to tell the equation that you want it to respond this or that way to the vectors you give it and then calculate the specularity based on the chosen model.
Let me explain it practically. A point lamp is a single point in space. Ideal for an equation because it don't get simpler than this. It calculates straight up the information it gets. No need to adjust anything, because the equation's default response is exactly what we need (apart from a single issue, but we'll get to that in a later post).
.jpg)
.jpg)
The sun lamp, on the other hand is a light source that has a single angle and doesn't have an origin. It's like a massive omnipresent (in the scene) light source that shines at a specific angle. This means that you have to now tell the equation to respond to it's light vector and other variables to respond as if L is at the exact same angle to the object at all times and in every location.
.jpg)
.jpg)
Mesh and area lamps are a bit of a mystery to me, because they require a whole different method of being calculated, if their forms are to be taken into account and quite frankly, that is just so far beyond me right now and GOD has not given me the grace to understand how to handle that yet.
In short, we have two models that have to be calculated in 2 different ways, because the light sources work differently and need various setups and rigs in order to function correctly - usually these situations are coded for, but since this is not coded and only nodes were used, I don't know how to automatically tell it:
- the amount of lights
- what kind of lights
- where they are in relation to the object
- how to handle each kind
The only way around this is to custom add the calculations for every light source (diffuse and specularity, since both are affected - NPR means this is just a suggestion, haha). It will work to add custom light sources, but you have to always keep in mind that these are not handled automatically, so every light change you make is a change you need to make on the shader - at least until it gets coded.
In the next post, we'll be looking at how these were built - at least somewhat!
Biggest thanx to GOD for helping me with this. Without HIM, none of this would be possible! :D
Know JESUS yet?
Have a great one!!!
Thank YOU!!!!!!
Sources:
In : News
Tags: god jesus holy spirit blender anime toon shaders specularity diffuse eevee progress development 2.8


Hey! I'm having an incredible learning experience, not only learning how Blender works (yes, still learning), but also about Open-Source and the incredible software available. Stick around!





