Jump to content
  • Advertisement
Sign in to follow this  
s3mt3x

Texture Artifacts - Help me with this and i'll have your children!!

This topic is 4490 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

Hi Guys, I've been working on generating lightmaps and I keep getting artifacts on the sides of my polygons and i've no idea where they are comming from. Please see the image below: As you can see, there are artifacts on the sides of the poly - i've included the lightmap texture i'm using on the right - the yellow border correspond to the uvs. Can anyone help me with this? It's driving me insane - I can't see any reason why this should be happening? It appears to happen when the UVs span a pixel - any comments or suggestions would be really appreciated. Actually - i've just tried aligining the uvs to the nearest pixel - and it still happens :( Please, Please someone help!!! Also, the red borders on the lightmap will later be filled with the adjacent pixels - i've filled them with red to enhance what's going on. Kind Regards, Chris

Share this post


Link to post
Share on other sites
Advertisement
When you create the texture, did you specify clamp to edge?

In OpenGL, for a 2D texture:
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

Share this post


Link to post
Share on other sites
Hi Tabby,

Thanks for replying, yes I have - in fact i've tried it with pretty much every possible comination of texture parameters and it still goes all wierd :(

Kind Regadrs,

Chris

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
That's definitely DXT compression artifacts. Your red color interferes with the compression process... each 4x4 block can only have 2 unique colors, the other 2 are interpolated from those.

You shouldn't compress lightmaps really anyway, it'll just look ugly.

Share this post


Link to post
Share on other sites
How many textures are you overlaying? It's strange to me that the blue texels are significantly larger than those which make up the light map's grey(ish) texels.

Edit: Ahh, compression, that would explain the deviance in grey's purity.

Share this post


Link to post
Share on other sites
Hi Guys,

Texture compression???? I'm using opengl and i've loaded all the extensions at runtime - would this activate it texture compression without specifically specifying it?

Share this post


Link to post
Share on other sites
I'm not sure what is causing those artifacts, but on another note I don't see why you are shifting your uv's in by more than half a pixel on the right and bottom sides of the lightmap texture.

If you are going to give the surrounding red pixels the colour of their nearest neighbour then this should completely remove any bleeding that occurs with filtering and there is no need for the half pixel uv shrink hack. [smile]

Regards,
ViLiO

Share this post


Link to post
Share on other sites
No texture compression is enabled by default, unless it's overrode by the graphic driver itself through some user setting.

So I'm assuming the impurity is from the JPEG compression of the screenshot, and isn't actually displayed when the information is still lossless.

Baring that, is it indeed just one texture per pass? Have you checked the actual raw data in RAM to see if those pixels really aren't just simply blue and the green and red aren't being filled?

Are you using a BGRA colour format? Or RGBA?

Share this post


Link to post
Share on other sites
Quote:
Original post by ViLiO
I'm not sure what is causing those artifacts, but on another note I don't see why you are shifting your uv's in by more than half a pixel on the right and bottom sides of the lightmap texture.

If you are going to give the surrounding red pixels the colour of their nearest neighbour then this should completely remove any bleeding that occurs with filtering and there is no need for the half pixel uv shrink hack. [smile]

Regards,
ViLiO


It's probably your mip mapping that's causing the problem. Try without mipmapping, and also try duplicating the pixels at the edge like ViLiO mentioned.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I'm 100% sure that the large scale banding that you are seeing is because DXT (S3TC) compression is being applied at some stage. You may want to check your driver control panel, some quality parameter may be forcing texture compression.

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!