# 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.

## 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]

1. 1
Rutin
32
2. 2
3. 3
4. 4
5. 5

• 11
• 13
• 86
• 11
• 10
• ### Forum Statistics

• Total Topics
632972
• Total Posts
3009611
• ### Who's Online (See full list)

There are no registered users currently online

×