What iv recently noticed is if you rotate a Quad or move an object with floating point coordinates the quad's texture will look like it has artefacts as the edge pixels get merged together. The solution that i found was to modify my textures so that instead of having a completly transparent background to my images which will get rotated or moved i would have a background to them that has the lowest transparency possible and coloured with RGB(127,127,127). That way when the edge pixels are merged you don't notice any difference as there all the same colour + hard to see.
This has one slight problem, since the background pixels now have some solidity to them you can sometimes notice a lighter area where your texture is. To minimise this you can make it so the background part only extends say 4 pixels around the actual image and you can change the RGB used in the background (For dark backgrounds black is best).
The reason for these artifacts is the texture filter which interpolates linearly between 4 neighboring texels. On the texture border it might happen that you interpolate say 95% of the border texel and 5% of a texel outside of the texture. If the outside texel differs a lot from the inner texel you will get artifacts. To avoid these artifacts there are several approaches:
Move your texture coordinates at the edges by a small epsilon inwards, say 1/20 texel.
You can set texture wrapping to GL_REPEAT or GL_MIRRORED_REPEAT. See glTexParameter. For GL_REPEAT obviously you need a seamless texture.
Extend the texture by a one texel on each side. If you don't have image data, just copy the border texels. In case you use anisotropic filtering you will need a 4 texel border for correct results. Of course you will need to adjust your texture coordinates. This approach is also used for Virtual Texturing to avoid artifacts between cached tiles.
With images that have transparency(Which i was talking about) your solutions are wrong. OpenGL ignores the pixels which are fully transparent so the artefacts are not necessarily right on the edges of the texture. My solution works in all cases.
P.S GL_REPEAT is defaultly on and you still get artefacts. No clue about anything else you said with a non-transparent image, but i doubt they would help a non-transparent image.
Mitglieder in diesem Forum: 0 Mitglieder und 1 Gast
Du darfst keine neuen Themen in diesem Forum erstellen. Du darfst keine Antworten zu Themen in diesem Forum erstellen. Du darfst deine Beiträge in diesem Forum nicht ändern. Du darfst deine Beiträge in diesem Forum nicht löschen. Du darfst keine Dateianhänge in diesem Forum erstellen.