lightmap ugly edges

Started by
1 comment, last by Yann L 17 years, 6 months ago
Hello, I was working with lightmaps the first time and then I made one lightmap per quad. This had ugly edges but that wqs solved with GL_CLAMP_TO EDGE. No I have one big lightmap with all the smaller lightmaps, but the edges are back. I'm pretty sure this is not a round-off erros, since I've typecasted everything correctly by now. Would using a 3D texture solve this problem?? or what else?
Advertisement
ok, 3d textures seem to solve the problem,
but a new problem had occured. the lightmaps are allright but a little grayed....

i guess this had something to do with proper binding and en/disabling
to bind one 2d texture, and one 3d texture, is this correct ???

glActiveTextureARB ( TEXTURE0 );
glDisable ( GL_TEXTURE_3D );
glEnable ( GL_TEXTURE_2D );
glBindTexture ( GL_TEXTURE_2D, texture_reference );

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_REPLACE);

glActiveTextureARB ( TEXTURE1 );
glDisable ( GL_TEXTURE_2D );
glEnable ( GL_TEXTURE_3D );
glBindTexture ( GL_TEXTURE_3D, texture_reference );

glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_EXT);
glTexEnvf(GL_TEXTURE_ENV, GL_COMBINE_RGB_EXT, GL_MODULATE);


and call glMultiTexCoord2f and glMultiTexCoord3f in the drawing loop


[Edited by - Kincaid on September 30, 2006 5:25:54 AM]
You shouldn't use a 3D texture for that. Getting outline artifacts from using packed lightmaps is usually a sign of incorrect subtexel UV coordinates (keep in mind that the bilinear filter will filter from the texel centers !), or from the lack of boundary padding.

This topic is closed to new replies.

Advertisement