Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualC0lumbo

Posted 13 December 2012 - 09:49 AM

Talking about the bleeding problem - I don't think this is really a floating point accuracy issue, it's a texture sampling issue.

You want scaling, so that means you won't be able to do 1 to 1 texel to pixel mapping no matter how hard you try. This means you're going to be bilinear filtering on your textures. With texture atlases you need to add a border around each of images so that the bilinear filtering doesn't accidentally pull in any adjacent images. An alternative is to modify your UVs so that the UV rectangle is squeezed inwards by half a texel on all sides, but that'll cut off a little of your image slightly so you won't always get away with it.

If you need mipmaps for your atlases then that can be extra tricky, and you'll generally need larger borders, possibly some custom mipmap generation that discourages bleeding across atlas tiles or some atlas generation rule that encourages atlas tiles to align with power of two grid lines so that there's less bleeding in your lower mips.

#2C0lumbo

Posted 13 December 2012 - 09:41 AM

I don't think this is really a floating point accuracy issue, it's a texture sampling issue.

You want scaling, so that means you won't be able to do 1 to 1 texel to pixel mapping no matter how hard you try. This means you're going to be bilinear filtering on your textures. With texture atlases you need to add a border around each of images so that the bilinear filtering doesn't accidentally pull in any adjacent images. An alternative is to modify your UVs so that the UV rectangle is squeezed inwards by half a texel on all sides, but that'll cut off a little of your image slightly so you won't always get away with it.

If you need mipmaps for your atlases then that can be extra tricky, and you'll generally need larger borders, possibly some custom mipmap generation that discourages bleeding across atlas tiles or some atlas generation rule that encourages atlas tiles to align with power of two grid lines so that there's less bleeding in your lower mips.

#1C0lumbo

Posted 13 December 2012 - 09:40 AM

You want scaling, so that means you won't be able to do 1 to 1 texel to pixel mapping no matter how hard you try. This means you're going to be bilinear filtering on your textures. With texture atlases you need to add a border around each of images so that the bilinear filtering doesn't accidentally pull in any adjacent images. An alternative is to modify your UVs so that the UV rectangle is squeezed inwards by half a texel on all sides, but that'll cut off a little of your image slightly so you won't always get away with it.

If you need mipmaps for your atlases then that can be extra tricky, and you'll generally need larger borders, possibly some custom mipmap generation that discourages bleeding across atlas tiles or some atlas generation rule that encourages atlas tiles to align with power of two grid lines so that there's less bleeding in your lower mips.

PARTNERS