🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

lighting of concave faces

Started by
2 comments, last by David 24 years, 5 months ago
Hello graphics guru''s, I hope someone of you can help me. Here''s my problem: I want to render an object with a face that is concave. My polygon filler only supports convex polygons, so I split the concave face up into convex polygons. I use flat shading. I use a normal vector in the "middle" of each polygon for my lighting calculations. But because the angle between this normal vector and the lightsource differs for each polygon in the *same* plane, the original concave polygone is shaded with more than one color. How can I solve this? Thanks in advance, David
Advertisement
One option is specify a different lighting mode for your polygons, so that you get a smooth lighting effect on your surface. GL does some nifty things with this. Another option is to use a adjacent corners for your lighting calculations. That should give you the same dot product for both surfaces.
Thank you for your reply. I don''t use OpenGL, it''s all done in software, so I think smooth shading is not really an option. (I want to use flat shading because of the performance). Your second suggestion only works when there is a corner in the original face which is shared by all the polygons into which the original face is broken up. And this isn''t always the case.
I don''t *have* to use flat shading, I just want a very fast shading algorithm and flat shading seems fastest to me.
How about making a special case concave filler.
Might be faster also cause you don''t have to split the polies no more.

Japio
____________________________Mmmm, I''ll have to think of one.

This topic is closed to new replies.

Advertisement