Results 1 to 5 of 5

Thread: the colors of the texture change when i render

  1. #1
    Junior Member Newbie
    Join Date
    Jun 2006
    Posts
    16

    the colors of the texture change when i render

    I have disable all the things that could change the colour of the texture, but when i make a render the final colour is similar but not the same. And i need the same colour exactly.

    I use:

    glDisable (GL_BLEND);
    glDisable (GL_DITHER);
    glDisable (GL_FOG);
    glDisable (GL_LIGHTING);
    glDisable (GL_TEXTURE_1D);
    glShadeModel (GL_FLAT);

    glDisable(GL_COLOR_MATERIAL);
    glColor4f(1.,1.,1.,1.);
    glTexEnvf( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);

    Dont use Mip-map and the textures are in RGBA format.

    Thanks

  2. #2
    Member Newbie
    Join Date
    Apr 2004
    Location
    France
    Posts
    31

    Re: the colors of the texture change when i render

    Do you use GL_NEAREST or GL_LINEAR with glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTE R,filter) ?
    In your case, the correct choice should be GL_NEAREST.

  3. #3
    Junior Member Newbie
    Join Date
    Jun 2006
    Posts
    16

    Re: the colors of the texture change when i render

    Yes, i use GL_NEAREST.
    Question: I have read that OpenlGL clamp the values of the texture into [0,1]. Can i lose some precission in this transformation (when convert the unsigned byte to a real into [0,1]?

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: the colors of the texture change when i render

    What is your internalFormat parameter to glTexTexture2D? Use GL_RGBA8.
    What is the color resolution of your desktop?
    What is the color resolution of your OpenGL pixelformat?

    This will only work if the texture format is natively supported and equals the color resolution of the pixelformat and screen.

  5. #5
    Junior Member Newbie
    Join Date
    Jun 2006
    Posts
    16

    Re: the colors of the texture change when i render

    I try and works
    The only problem, as you say, i need the same color for the screen and i cant control this.

    Well, you have enlightened me, so a lot of thanks

Similar Threads

  1. Texture coordinates need to change when I change triangulation?
    By Grognard in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 12-05-2016, 02:35 AM
  2. Replies: 2
    Last Post: 06-15-2015, 03:26 AM
  3. Replies: 3
    Last Post: 04-01-2015, 02:05 AM
  4. using GL_MAP2_COLOR_4 inOpenGL to change vertexe colors
    By ali----- in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-13-2013, 12:49 PM
  5. why do colors change in fullscreen mode?
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 05-27-2002, 04:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean