🎉 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
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
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.
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
Might be faster also cause you don''t have to split the polies no more.
Japio
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement