简体   繁体   中英

My textures are bleeding into one another when rendering from a texture atlas

I am using an texture map, by which I mean a composite of several texture images. See here:

imageMap

When I use part of this image map as a texture, however, I get some 'bleed' from the parts immediately to either side of it. See here:

在此处输入图片说明

You can (just!) see that the red and yellow images on either side are appearing.

I am guessing that this is caused by re-sampling, which effectively blurs the texture map. When a specific part of the blurred texture map is then used, the result is this bleeding effect.

Is there any way to avoid this, aside from simply not using image maps at all?


Update

There are two triangles being used for the shape, as you would expect. The texture coordinates I am using are (if I recall correctly):

[0.50, 0.75]
[0.75, 0.75]
[0.75, 1.00]

[0.75, 1.00]
[0.50, 1.00]
[0.50, 0.75]

These pick out the image one to the left of the top left of the image map.

I should answer my own question for the benefit of others who might come here. In fact, the answer is effectively given here:

https://gamedev.stackexchange.com/questions/46963/how-to-avoid-texture-bleeding-in-a-texture-atlas?newreg=0dbdf79fa0214a718ac7cd38488c56df

Basically, texture coordinates must be centred on the middle of texels, not the edges and, importantly, mipmapping must be turned off.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM