Sign in to follow this  

light mapping help

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

This topic is 3633 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this