Shrinking textures
I am making a 2d game (see signature). The tile textures are considerably larger than the usual viewing size. As I understand, you set the reaction to this using glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, something);
No matter what value I produce for "something", I have a problem. If I use GL_LINEAR, then the mask gets all weird and produces artifacts on the size. If I use GL_NEAREST, it appears to twirl weirdly in the middle because the texture isn''t so smooth so its coming up with different pixels to display (besides being just plain ugly). If I choose any of the other possible values involving mipmaps (whatever those are), the textures go completely blank.
How do I get normal looking textures without artifacts?
The official zorx website
The answer is mipmaps. But to use mipmapping you''ll have to
- know what a mipmap is
- generate mipmaps for your textures
There is loads of info about this on the net. Look it up.
- know what a mipmap is
- generate mipmaps for your textures
There is loads of info about this on the net. Look it up.
If your game is in pure 2D, and you never need to scale textured objects, why not make textures "the right size" right away?
If your texture is like 512x512, and is used to texture an 128x128 object, that always stays that size, why not rescale the texture (photoshop or other) to this size? That should get rid of filtering artifacts.
Not sure what you''re trying to tell with ''mask producing artifacts on the size''. If you''re using masking the problem might be that the mask edges get blurred (due to filtering), and produce artifacts?
If your texture is like 512x512, and is used to texture an 128x128 object, that always stays that size, why not rescale the texture (photoshop or other) to this size? That should get rid of filtering artifacts.
Not sure what you''re trying to tell with ''mask producing artifacts on the size''. If you''re using masking the problem might be that the mask edges get blurred (due to filtering), and produce artifacts?
quote:Original post by marijnhThank you, I''ll look into it.
The answer is mipmaps. But to use mipmapping you''ll have to
- know what a mipmap is
- generate mipmaps for your textures
There is loads of info about this on the net. Look it up.
quote:Original post by WildfireBecause I don''t know what resolution the user will be running it at.
If your game is in pure 2D, and you never need to scale textured objects, why not make textures "the right size" right away?
If your texture is like 512x512, and is used to texture an 128x128 object, that always stays that size, why not rescale the texture (photoshop or other) to this size? That should get rid of filtering artifacts.
quote:Original post by WildfireThat''s exactly what''s happenning.
Not sure what you''re trying to tell with ''mask producing artifacts on the size''. If you''re using masking the problem might be that the mask edges get blurred (due to filtering), and produce artifacts?
The official zorx website
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement