Jump to content
  • Advertisement
Sign in to follow this  

light mapping help

This topic is 3942 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

I've run into a problem with a light mapping program I'm trying to write. The light mapping works for the most part. Here are a couple of screen shots of the output: example b (note: I run the output of my program through ImageMagick to apply a gaussian blur to the light maps. It takes the edge off) The problem is the method I'm using. The program currently, for each object to be light mapped, recursively tessellates the object. It does this by subdividing the triangles by the edge midpoints. A simple box goes from 12 triangles to over 200K triangles. At this point I loop through the tesselated vert list translating them away from the object by 0.01% of the unit normal of the face. This list is used as an end point for the ray triangle intersection test (obviously, the light source is the other end point for the ray). The texture coord from the tessellated vert is used to plot the calculated intensity. Longer story short, I'd like to use a traditional algo where I itterate across the texture and map the UV coords onto the plane of the triangle. From there I can do a simple point in triangle test, translate out by a fraction of the normal and shoot the ray the from here. This would greatly speed up my program and get rid of the edge bleeding and aliasing I'm getting with the current method. I searched google and here but I can't find (or don't get) the answer. I did see some stuff on flip code but it seemed everything being mapped had to be axis aligned. It shouldn't matter but I'm writting the program in python with the math intensive stuff embedded in C. A second python program I wrote is used to display the scene using OpenGL. Anyway, any help would be appreciated. [Edited by - hostileturtle on January 5, 2008 3:31:07 PM]

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

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

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!