- Home /
Using a Sprite as a Texture, getting sub-pixel glitches.
I am running into an odd issue. I have a 3d game, but I am using a pixel art sprite as a texture to paint an object. However, when that object is displayed at runtime the pixel art is not being displayed crisply, it is displaying with a bunch of sub-pixel errors.
Is there any way to prevent or fix this? It it just a result of not looking at the texture at a 90 degree angle? When the camera moves the errors disappear and the more appear in different places in the graphic.
Answer by Eno-Khaon · Jan 08, 2021 at 09:46 PM
To start, your Texture appears to be Point Filtered (a.k.a. nearest neighbor filtering). This filtering scheme eliminates sub-pixel blending in your texture (most prominent when viewed up close).
What this means for you is that, when viewed at *ANY* angle whatsoever, as the engine decides which pixel to draw on the unaligned face, the nearest pixel-in-your-texture to the pixel-being-drawn-on-screen will be displayed. This results in the texture appearing to be jagged when viewed up close, or incomplete (as it were) when viewed from far enough away that the texture's pixels take up less space than the screen's pixels.
That sounds like it would be causing the issue. The texture is point filtered and viewed at a bit of an angle. So I guess I need to figure out a way to keep the clarity of the texture without using standard point filtering. Thank you for the insight.
Answer by Leviathanth · Jan 08, 2021 at 09:24 PM
I think this may be partly the fault of my monitor. When I moved the game window to a smaller and higher resolution monitor the glitches shrink significantly.
Your answer
Follow this Question
Related Questions
Does Unity Support 3D? 1 Answer
Pixel art is jittery while moving camera. 2 Answers
UDP app signature? 1 Answer
Best Looking Unity Game? 2 Answers
3D performance on mobile platforms? 1 Answer