True color display problem

Environment:

  1. Windows Mobile 6

  2. Vincent lib

  3. I just created gradient image in vertical direction like the below:

int width=256; int height=256;
unsigned char data[2562564];
int x,y;
for(y=0;y<height;++y)
for(x=0;x<width;++x)
{
data[4*(x+ywidth)] = y;
data[4
(x+ywidth)+1] = y;
data[4
(x+ywidth)+2] = 0;
data[4
(x+y*width)+3] = 255;
}
and then binded this texture like the below.
glBindTexture(GL_TEXTURE_2D, textureName);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, data);

  1. I expected to be displayed gradiently but It shows like the step like the below.

    Can you give me advices for this issue in OpenGL ES 1.x.
    Is there any options list for me to ckeck? :mrgreen:

You have a problem with either dithering (some implementation don’t have dithering, BAD! ) or your texture are repeated. Fix your triangles and clamp texture.

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.