Jump to content
  • Advertisement
Sign in to follow this  
Kincaid

lightmap ugly edges

This topic is 4310 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!