## mesa3d-users

 [Mesa3d-users] Smooth shading... From: Ross Miller - 2002-09-19 15:18:42 ```Hello all, This isn't strictly a Mesa3d question, but I figure the folks on this l= ist=20 would know the answer, so... My understanding is that OpenGL's smooth shading uses Gouraud shading. I= s=20 this correct? And is it part of the OpenGL spec, or could an implementat= ion=20 choose to use Phong shading instead? Also, my understanding is that both Phong and Gouraud shading use vertex=20 normals, but that where Gouraud calculates the colors of the vertexes and= =20 then interpolates those colors, Phong shading interpolates the normals an= d=20 evaluates a different normal for every pixel in the polygon. Is this=20 correct? Thanks very much, -Ross ```
 Re: [Mesa3d-users] Smooth shading... From: Brian Paul - 2002-09-19 15:31:23 ```Ross Miller wrote: > Hello all, > This isn't strictly a Mesa3d question, but I figure the folks on this list > would know the answer, so... > > My understanding is that OpenGL's smooth shading uses Gouraud shading. Is > this correct? And is it part of the OpenGL spec, or could an implementation > choose to use Phong shading instead? It's part of the OpenGL spec. I believe there's an extension for Phong shading. It can also be accomplished with fragment programming, sphere/cube mapping tricks, etc. > Also, my understanding is that both Phong and Gouraud shading use vertex > normals, but that where Gouraud calculates the colors of the vertexes and > then interpolates those colors, Phong shading interpolates the normals and > evaluates a different normal for every pixel in the polygon. Is this > correct? That's basically it, yes. Though one could get nit picky and get into Phong shading vs. lighting, etc. I'll spare you. -Brian ```
 Re: [Mesa3d-users] Smooth shading... From: Stephen J Baker - 2002-09-19 15:41:18 ```On Thu, 19 Sep 2002, Ross Miller wrote: > My understanding is that OpenGL's smooth shading uses Gouraud shading. Yes. It computes the lighting equation at each vertex of the polygon, then interpolates the resulting colours to get a colour at each pixel. > Is this correct? And is it part of the OpenGL spec... Yes. > or could an implementation choose to use Phong shading instead? No. > Also, my understanding is that both Phong and Gouraud shading use vertex > normals, but that where Gouraud calculates the colors of the vertexes and > then interpolates those colors, Phong shading interpolates the normals and > evaluates a different normal for every pixel in the polygon. Is this > correct? Yes. Phong is obviously more compute-intensive because the lighting equation has to be evaluated at every fragment (which might be a pixel - or it might be a sub-pixel if FSAA is in use). It's possible to implement Phong shading (or something very close to it) on most modern graphics cards using various OpenGL extensions. The next generation of cards (ATI's 9xxx and nVidia's NV3x machines) will implement Phong shading more or less directly as a part of their fragment programming extensions. You can also get something very close to Phong shading by using OpenGL's standard environment-mapping feature. ---- Steve Baker (817)619-2657 (Vox/Vox-Mail) L3Com/Link Simulation & Training (817)619-2466 (Fax) Work: sjbaker@... http://www.link.com Home: sjbaker1@... http://www.sjbaker.org ```