• Advertisement
Sign in to follow this  

Texture Atlas Glitch

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

I just started getting vegetation into my program and bam, I ran into this glitch. You can see a black line over all the trees in this shot. The first thing that came to my mind was it looks like a texture atlas glitch caused by mipmapping accessing texels that wouldn't have been in the original image, so I opened up the texture and what do you know... texture atlas glitch Any ideas as to how I can resolve this with as little work possible (apparently all the trees i have are setup like this)?

Share this post


Link to post
Share on other sites
Advertisement
Thats a manually created atlas, right? not D3DX's UVAtlas?

Have you tried various filtering options - e.g. U/V clamping?

Also, if you're billboarding that tree, I've sometimes found that manually "pulling" the UV coordinates in by a 1/2 texel can stop it from wrapping around the edge of the texture atlas. Failing that, gutter areas have solved most problems.

EDIT: Very nice screenshot btw [smile]

hth
Jack

Share this post


Link to post
Share on other sites
Quote:
Thats a manually created atlas, right? not D3DX's UVAtlas?


Right, otherwise I could use their border functionality.

Quote:
Have you tried various filtering options - e.g. U/V clamping?


Doh, I jumped straight to the conclusion that it was the atlas edge. Clamping removes the glitch from the top and sides, but the bottom one is still there, which matches up with the texture atlas edge.

Quote:
Failing that, gutter areas have solved most problems.


That would require changing the texture coordinates too right? I'll keep that in mind.

I found a solution to the atlas edge problem, which is kindof unique to this situation. The bottom half with the leaves uses the alpha channel but the top half doesn't, so I painted transparency into the top half and now the samples that were causing the glitch are being ignored. This wouldn't work if the trunk was using the alpha channel though.

Thanks for your help! I would rate you up if I hadn't done that a long time ago =)

Share this post


Link to post
Share on other sites
Quote:
Original post by jamesw
Quote:
Failing that, gutter areas have solved most problems.


That would require changing the texture coordinates too right? I'll keep that in mind.
Getting the texture coordinates and any borders perfect isn't always trivial, but it does work wonders [smile]

I'm not sure if it'll work quite so well in your context, but back in January I solved a similar problem with using a "tile set" for a 2D/3D type game. Was jibbering on about it in my journal instead of revising for my exams [embarrass]

Anyway, I designed my tiles to use a 30x30 region of an allocated 32x32 texture area:



I then implemented an algorithm that wrapped around the edges, so any additional texels fetched by filtering algorithms would be correct. Its okay if these texels are actually the edge of the texture, but this is rarely the case for tiles...



Maybe a similar approach might work for you?

Quote:
Original post by jamesw
Thanks for your help! I would rate you up if I hadn't done that a long time ago =)
S'ok - glad to be of some use [grin]

Cheers,
Jack

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement