Lightmaps and bilinear filtering problem
I''m creating a lightmap for a model and I''m using raytracing for triangle collision detection:
http://www.gamedev.net/community/forums/topic.asp?topic_id=202886
Each triangle has its own lightmap. I am keeping it simple for now.
Everything seems to be working ok, except when I turn on bilinear filtering, which messes up the edges.
I tried to be sneaky by adding a 1-pixel border around each lightmap, but this causes headaches in raytracing.
How does one solve this bilinear filtering problem, either during or after the raytracing process?
I tried duplicating the outer lightmap edges, but this doesn''t work.
I found what I''m looking for, well sorta of. This tutorial calls the function:
FillAllIllegalPixelsForThisLightMap
http://www.flipcode.com/articles/article_lightmapping.shtml
But, they give no code for this function.
How do you fill in illegal pixels for a lightmap?
FillAllIllegalPixelsForThisLightMap
http://www.flipcode.com/articles/article_lightmapping.shtml
But, they give no code for this function.
How do you fill in illegal pixels for a lightmap?
If you''re using OpenGL, might want to look into GL_CLAMP_TO_EDGE which prevents textures from ''bleeding'' across edges.
No, these are lightmaps written to one texture. Like textures within a texture. Can't use edge or border clamping.
Has anyone created their own FillAllIllegalPixelsForThisLightMap function? How did you fill in the missing pixel?
[edited by - raydog on January 26, 2004 1:14:24 AM]
Has anyone created their own FillAllIllegalPixelsForThisLightMap function? How did you fill in the missing pixel?
[edited by - raydog on January 26, 2004 1:14:24 AM]
I had -exact- same problem. If I added that 1-pixel border I got that raytracing error with shadows. Unfortunately I didn''t came up with a solution, I bought a Radeon 9700 Pro and instead (Real-Time Per-Pixel lighting). :-)
Maybe you should generate a lightmap for each surface rather than for each triangle.
Maybe you should generate a lightmap for each surface rather than for each triangle.
I''ve gone over that tutorial several times, and it offers no clues as to how to fill in these
"invalid pixels" with the "closest color".
These pixels are usually outside the triangle, or straddle alone the triangle edge.
Blurring or taking the average of all surrounding pixels does not work with
bilinear filtering.
"invalid pixels" with the "closest color".
These pixels are usually outside the triangle, or straddle alone the triangle edge.
Blurring or taking the average of all surrounding pixels does not work with
bilinear filtering.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement