opengl es strange 16bit texture scale problem
hi every one,
i am actually developing my first 2D iphone game and render all graphics in opngl 16bit. this is how the game looks like at the moment:
![[Image: screenshot2.jpg]](http://microsia.de/data/screenshot2.jpg)
for the background i use a 1024x1024 texture (which i generate during the game). the whole gameworld can be zoomed out but while this happens strange patterns (like Moiré patterns http://en.wikipedia.org/wiki/Moir%C3%A9_pattern) appear on the background texture. it is hard to discribe and i cant screenshot it, because it only happens if the image is steadily scaling (relative fast).
if i set the GL_TEXTURE_MIN_FILTER & MAG_FILTER parameter of the texture to GL_NEAREST the effect happens stronger so i guess it has to do with the scaling algorithm of opengl and 16 bit. even if the texture is a plain color the "moiree" effect is happening when scaling the texture. on the simulator the effect is less stronger (hard to see) than on the iphone (obviously annoying).
does anybody know this effect and have a suggestion how i can solve it? when i use 32bit textures the effect does not appear but that is no solution for me.
many thanks and greetings
i am actually developing my first 2D iphone game and render all graphics in opngl 16bit. this is how the game looks like at the moment:
![[Image: screenshot2.jpg]](http://microsia.de/data/screenshot2.jpg)
for the background i use a 1024x1024 texture (which i generate during the game). the whole gameworld can be zoomed out but while this happens strange patterns (like Moiré patterns http://en.wikipedia.org/wiki/Moir%C3%A9_pattern) appear on the background texture. it is hard to discribe and i cant screenshot it, because it only happens if the image is steadily scaling (relative fast).
if i set the GL_TEXTURE_MIN_FILTER & MAG_FILTER parameter of the texture to GL_NEAREST the effect happens stronger so i guess it has to do with the scaling algorithm of opengl and 16 bit. even if the texture is a plain color the "moiree" effect is happening when scaling the texture. on the simulator the effect is less stronger (hard to see) than on the iphone (obviously annoying).
does anybody know this effect and have a suggestion how i can solve it? when i use 32bit textures the effect does not appear but that is no solution for me.
many thanks and greetings
http://www.microsia.de - become a micromusician and create molecular tunes
using mipmaps should eliminate the problem.
i am using mipmaps... but i did not set the GL_TEXTURE_MIN_FILTER to GL_LINEAR_MIPMAP_LINEAR. now it works the patterns are gone. thanks for your advice it leaded me to proove the mipmap thingie.
have a nice day
have a nice day
http://www.microsia.de - become a micromusician and create molecular tunes
You may wish to consider LINEAR_MIPMAP_NEAREST, it's usually faster, and the difference may not be noticeable in your case.
It sounds to me like you are referring to 16bit colour banding? Especially if the problem disappears when you increase the colour depth.
The easiest solution would be to accept that you need to increase your colour depth. Remember that you can mix and match between 32bit textures and 16bit renderbuffers, or the other way around - maybe you can find a compromise.
If you are still unwilling to increase your colour depth you could look into dithering patterns.
Quick edit: Ooops... reread the thread and noticed that mipmaps had solved the problem.
The easiest solution would be to accept that you need to increase your colour depth. Remember that you can mix and match between 32bit textures and 16bit renderbuffers, or the other way around - maybe you can find a compromise.
If you are still unwilling to increase your colour depth you could look into dithering patterns.
Quick edit: Ooops... reread the thread and noticed that mipmaps had solved the problem.
The Monkey Hustle - Now available on the App Store!
@OneSadCookie
oh the LINEAR_MIPMAP_NEAREST works too very well. i thoughted that when i am using mipmaps an set the parameter only to GL_LINEAR the mipmap blending is NEAREST by default. but it seems so if i only set GL_LINEAR (and not LINEAR_MIPMAP_NEAREST) that there ist no mipmap blending wich caused the problem.
many thanks.
@mariocaprino
i do mixing 32bit and 16bit but for the background two images at 1024x1024 in 32bit would be consume too much memory.
the dithering was no problem, because the effect also appeared when i am using only a plain colour.
but thanks for your advice.
have a nice day
oh the LINEAR_MIPMAP_NEAREST works too very well. i thoughted that when i am using mipmaps an set the parameter only to GL_LINEAR the mipmap blending is NEAREST by default. but it seems so if i only set GL_LINEAR (and not LINEAR_MIPMAP_NEAREST) that there ist no mipmap blending wich caused the problem.
many thanks.
@mariocaprino
i do mixing 32bit and 16bit but for the background two images at 1024x1024 in 32bit would be consume too much memory.
the dithering was no problem, because the effect also appeared when i am using only a plain colour.
but thanks for your advice.
have a nice day
http://www.microsia.de - become a micromusician and create molecular tunes
I wonder what happend to this little game?

Possibly Related Threads...
Thread: | Author | Replies: | Views: | Last Post | |
SOIL image library problem or texture lib problem | hippocoder | 12 | 14,075 |
Mar 22, 2010 08:51 PM Last Post: Frank C. |
|
OpenGL box2d scale factor | lifebythedrop | 4 | 8,091 |
Nov 15, 2009 06:39 AM Last Post: mpcarr |
|
Why do I see strange texture borders on Simulator but not on iPhone? | riruilo | 2 | 4,338 |
Oct 4, 2009 10:33 AM Last Post: riruilo |
|
Increasing brightness of texture in OpenGL | dsedov | 3 | 9,055 |
Jul 29, 2009 03:00 PM Last Post: arekkusu |
|
how to draw to OpenGL texture | Gillissie | 7 | 10,269 |
Apr 24, 2009 06:35 AM Last Post: AnotherJake |