Sign in to follow this  
Kincaid

lightmap ugly edges

Recommended Posts

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?

Share this post


Link to post
Share on other sites
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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

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