Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


light, light, light

This topic is 6543 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i have a little questions.... 1) In my engine for omnilight illumination i''m usign the following algho : angle = vec_dot(plane normal, light); if (angle>0) vert1.a = vert2.a = vert3.a = 255*angle+AMBIENT; else vert1.a = vert2.a = vert3.a = AMBIENT; ok, it works well (well it''s a bit different) but if i have an object like sphere or cone, this algo doesnt make a very good effect (you see every triangle of the object !!). How can i produce a right interpolation of vertex alpha value? I have an idea but i have to use the center of the object and its ray (if the object is a cone). 2) have anybody a any tricks about lightmaps? i dont know how can i produce a good lightmap, shadowmap alghoritm? Please help me !!!!!!!!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
Just a couple of comments.

First of all you''re using the plane normal to generate vertex lighting. This will cause discontinuities in the lighting like you''ve seen. It''s better to generate vertex normals (by averaging all of the plane normals for polygons that use a vertex) and to use that.

Also you may need to duplicate a vertex when it is shared by more than one triangle if the angle between the 2 tris is greater than, say, 90 degrees. Otherwise you''ll get lighting rapping around sharp edges in the model (think about what would happen if you were lighting a cube).

Hope this helps.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!