Talk:Blinn–Phong shading model
From Wikipedia, the free encyclopedia
Contents |
[edit] Need an image
We need an image to illustrate the situation here. Anyone? --cslarsen 11:03, 5 May 2006 (UTC)
- Done. - Rainwarrior 18:46, 7 August 2006 (UTC)
-
- I believe there is an error in the image caption. The rightmost image is supposed to approximate the phong model by modifying the specular power and thus making the highlight smaller (as blinn-phong tends to make larger highlights for the same specular power than phong). But surely we would have to *raise* the exponent to make the highlight smaller, not lower it as the caption suggests. Jtsiomb 14:13, 24 January 2007 (UTC)
[edit] Default in OpenGL?
Someone reverted this paragraph: "Blinn-Phong is the default shading model used in OpenGL, and is carried out on each vertex as it passes down the graphics pipeline; pixel values between vertices are interpolated by Gouraud shading by default, rather than the more expensive Phong shading." with the comment "rm paragraph: speaking about a 'per-vertex phong shading' is rather strange to me".
I don't know if the original statement was true, but it makes perfect sense. While Phong shading is a per-pixel shading with normal interpolation, the Phong reflection model or the alternative Blinn–Phong shading model, though called differently, can be used at vertices and interpolated with Gouraud shading.
I'm going to revert the deletion. If someone knows for sure that it's true or not, please comment.
Dicklyon 16:13, 29 June 2006 (UTC)
- It was correct. Doing actual normal-interpolation takes a lot of extra calculation and gives only a little benefit. The traditional way to get around this is to increase tesselation, but nowadays you can write a fragment shader that does it. (I'm still wondering if we could have a normal-interpolation feature added to GLSL that could in hardware interpolate two normals with a quadratic approximation to the normalization, instead of having to take a square root at every step....) - Rainwarrior 05:07, 30 June 2006 (UTC)
-
- Indeed, an approximate normalization of the interpolated normal is a lot quicker than a reciprocal square root. But then the high power of the dot product multiplies the normalization error up by a big factor, so you really need a different (and quicker) formulation of the reflection model to get a net win. Right? Maybe like this [1]? Dicklyon 05:28, 30 June 2006 (UTC)
-
-
- That's true, any errors would be worsened by high specular exponents... it's just something I've had in the back of my mind for a while, I haven't tried out any experiments of my own yet. I was more wondering if an automatic normal approximation might ever be built into GLSL, i.e. instead of just the varying type, have a normalized_varying type or something where interpolates them as normals doing an approximation in hardware somehow. I suppose there are already extensions that use a cube map to approximate normalization though. I should try some of these out. - Rainwarrior 06:17, 30 June 2006 (UTC)
-
-
-
-
- The sensitivity to normalization errors comes from using the dot product as a proxy for the angle. If you use the squared magnitude of a vector difference instead (approx sin^2 instead of cos), then the error due to normalization when you compute a smaller specular reflection is much less. Making an approximate Phong-like or Blinn-like or Gaussian-like specularity out of the sin^2 is easy. It's all published in an obscure Apple tech report and a patent. Let me know if you'd like a copy. Dicklyon 15:06, 30 June 2006 (UTC)
-
-
-
-
-
-
- Thanks! - Rainwarrior 20:50, 1 July 2006 (UTC)
-
-
-
[edit] Rename
Since we make a distinction between Phong shading model and Phong reflection model, shouldn't we be consistent about this and move this page to Blinn-Phong reflection model? - Rainwarrior 18:48, 7 August 2006 (UTC)
[edit] Efficiency explanation
Jtsiomb added an explanation, but I'm not sure I get it. It seems to rely on L and V being constant across a face, but that would only be true of the light and viewpoint were infinitely distant, no? Also, the language about how it might "seem absurd" is not appropriately encyclopedic. Seems like a rewrite is in order. Dicklyon 03:55, 24 January 2007 (UTC)
- You are absolutely correct. I didn't realize while writing it, that I was implicitly assuming the light and viewer to be treated as infinitely distant. I edited it to explicitly state that assumption. Also as far as the language goes, I'm afraid I'm not a native english speaker, and I didn't think the "seem absurd" would be inappropriate. I fixed that too.Jtsiomb 10:37, 24 January 2007 (UTC)