Archived

This topic is now archived and is closed to further replies.

clum

Shrinking textures

Recommended Posts

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

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
quote:
Original post by marijnh
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.

Thank you, I''ll look into it.
quote:
Original post by Wildfire
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.
Because I don''t know what resolution the user will be running it at.

quote:
Original post by Wildfire
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?
That''s exactly what''s happenning.

The official zorx website

Share this post


Link to post
Share on other sites