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


Lightmap filtering

Recommended Posts

I''m creating a Quake 2 rendering engine, and I was just working on the lightmaps. As you may know, the lightmaps are limited to 16x16, so I placed 64 of them in one texture (128x128). This works fine, except when I do a GL_LINEAR filter on the texture. There are black lines that border all the lightmaps (because it filters using the pixels outside of the lightmap border). Is there a better way of accomplishing this? I''d like to keep the lightmaps in this size texture unit, but I would like to get rid of the black borders. GL_NEAREST filter makes it look too blocky to use. Thanks, Mark Before I couldn''t spell engineer, now I are one!

Share this post

Link to post
Share on other sites
Guest Anonymous Poster
this is a common issue with certain rendering hardwares.

are you setting your uv coords right on the border of
your lightmaps? if so try using the center of that
particular corner instead.

so if you need to lightmap the 2nd lightmap in the texture
and its (upperleft/lowerright) coordinates are (16,0/32,16)
then you want your mapped uvs to be (16.5,0.5/31.5,15.5).

does that make sense?

Share this post

Link to post
Share on other sites