Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Dark Texture...

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Montreal
    Posts
    8

    Dark Texture...

    Hi everyone,

    I have a small problem with texture mapping. I am mapping a greyscale image on a plane but the texture appear very darker than it should be. I thought it could be a lighting problem but even with disabling it, the result is the same.

    Here is some of the parameters that I used:

    minfilter = GL_NEAREST;
    magfilter = GL_NEAREST;
    env = GL_DECAL;
    wraps = GL_CLAMP;
    wrapt = GL_CLAMP;

    glBindTexture (GL_TEXTURE_2D, g_texture[index]);
    glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ) ;
    glPixelStorei( GL_UNPACK_ROW_LENGTH, 0 ) ;
    glPixelStorei( GL_UNPACK_SKIP_ROWS, 0 ) ;
    glPixelStorei( GL_UNPACK_SKIP_PIXELS, 0 ) ;
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, wraps);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, wrapt);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, minfilter);
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, magfilter);


    (...)

    glTexImage2D(GL_TEXTURE_2D, 0, GL_LUMINANCE,
    ImageWidth, ImageWidth,
    0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
    &image[0][0][0]);


    Thank in advance!

  2. #2
    Junior Member Newbie
    Join Date
    Oct 2000
    Location
    Montreal
    Posts
    8

    Re: Dark Texture...

    Oh I forgot, I used also
    glTexEnvf(GL_TEXTURE_ENV ,GL_TEXTURE_ENV_MODE, env);
    with
    env to GL_REPLACE but the result is still the same...

Posting Permissions

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