Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have 2D array of floats. Using the floats, I generate image by doing proportional selection of color from between COLOR_MIN, COLOR_MAX – for maximal float value at given (x,y), I choose COLOR_MAX and put pixel at (x,y), for minimum float value – I choose COLOR_MIN.

Resulting 128x128 image (created from 128x128 float array) is then used as texture, which is then scaled to about 500x500 size. Image displayed this way has "dot-noise", like if the image would be printed from needle printer (example image/screenshot attached below).

How to avoid the noise? I could scale the image myself to 512x512, but I probably need some filtering? Or will be setting some OpenGL (ES) options for the texture sufficient?

Distorted image

PS.: The image is result of GL_LINEAR magnifying filter. Using GL_NEAREST results in large pixels being clearly visible (green below). So apparently, I need programmatic filter to run on CPU.

enter image description here

share|improve this question
Well it appears the colors values themselves are wobbling, or oscillating. If that's the case then this is the expected result. Can you post the GL_NEAREST results so we can look at it? – bobobobo Jul 23 '12 at 2:06
@bobobobo: I have added the GL_NEAREST image. – GameCoder Jul 23 '12 at 2:51
How come your uploaded images are neither 128x128 nor 512x512? You should post the original sized images, otherwise it's really hard to judge. – bummzack Jul 23 '12 at 7:36
So yeah. The issue is the underlying data is bumpy. You need to first smooth the data before generating the texture, just by averaging or low pass filtering. – bobobobo Jul 23 '12 at 16:27
@bo Should be an answer. – Anko Mar 12 '13 at 22:43

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.