Results 1 to 2 of 2

Thread: True color display problem.

  1. #1
    Junior Member
    Join Date
    Jul 2009
    Posts
    1

    True color display problem.

    Environment:
    1. Windows Mobile 6
    2. Vincent lib

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

    int width=256; int height=256;
    unsigned char data[256*256*4];
    int x,y;
    for(y=0;y<height;++y)
    for(x=0;x<width;++x)
    {
    data[4*(x+y*width)] = y;
    data[4*(x+y*width)+1] = y;
    data[4*(x+y*width)+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);

    2. 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?

  2. #2
    Junior Member
    Join Date
    Oct 2009
    Location
    France
    Posts
    11

    Re: True color display problem.

    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);

Similar Threads

  1. color transformations - problem with alpha
    By sochm in forum OpenVG and VGU
    Replies: 3
    Last Post: 04-24-2009, 07:59 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •