[英]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:
看这里:
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 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. 基本上,纹理坐标必须位于纹理像素的中心,而不是边缘的中心,而且重要的是,必须禁用mipmapping。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.