Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!cs.utexas.edu!asuvax!enuxha!nwatson From: nwatson@enuxha.eas.asu.edu (Nathan F. Watson) Newsgroups: comp.graphics Subject: Re: phunky phong triangles in rayshade 4.0 Keywords: rayshade raytrace Bob n' Ray Message-ID: <3574@enuxha.eas.asu.edu> Date: 12 Jun 91 19:20:02 GMT References: <31202@hydra.gatech.EDU> Organization: Arizona State University, Tempe, AZ Lines: 59 In article <31202@hydra.gatech.EDU>, gt4417a@prism.gatech.EDU (SKELTON,JOEL PHILLIP) writes: > Has anyone else noticed problems with shading discontinuities > on objects composed of phong triangles in rayshade 4.0? > ... If I put the light away from > the eye and to the side of the sphere then I see a line that traces > the edge of some of the triangles where the shading suddenly > goes to almost black. The effect is something like this: > > > ..... > . \ . > smoothly shaded -. / . ------- almost black > . \ . > . / . > . \ . > ..... > > jps > bongo fury My guess is that triangles to the left of the boundary have their TRUE outward normals pointing toward the light source, and so include the mentioned light source in their shading calculations. The triangles to the right have their TRUE outward normals pointing away from the light source and so eliminate the mentioned light source in shading calculations. The left triangles along the boundary will be smoothly shaded using the light source, whereas right triangles will be "black". Because the phongly-calculated normals along the boundary are not necessarily normal to the vector to the light source (and may, indeed, point away from the light source), the transition will not be smooth. A proposed solution (that I'm not sure will work): Handle lighting calculations w.r.t. the mentioned light source as follows: (a) For triangles whose vertex normals all point toward the light source: Use phongly-calculated normals as usual. (b) For triangles whose vertex normals all point away from the light source: Reject the triangle as it is not lit by the light source. (c) For triangles with vertex normals point both at and away from the light source: Calculate the phong-normal at each point and determine whether the light source should be used. I suspect that triangles in (a) will usually have their outward normals pointing toward the light source, those in (b) will usually have their outward normals pointing away from the light source. Those in (c) will have outward normals pointing toward and away from the light source. The mentioned check should be applied in either case to provide a smooth transition. Sorry for the wordy description. -- --------------------------------------------------------------------- Nathan F. Watson Arizona State University nwatson@enuxha.eas.asu.edu Computer Science Department "Remember: No matter where you go, there you are." - Mr. B. Banzai