Results 1 to 5 of 5

Thread: colour

  1. #1
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    171

    colour

    Hi

    any reason why red appears as black in my scene - I used to be able to see red but for some reason it now shows as black - how can i rectify this

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Feb 2000
    Location
    Sweden
    Posts
    2,978

    Re: colour

    Does any other color work? Do you use textures, lighing or anything else that affects the final color?

  3. #3
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    171

    Re: colour

    Originally posted by Bob:
    Does any other color work? Do you use textures, lighing or anything else that affects the final color?
    yes blue and green work perfect
    I've enabled depthtesting in initGL()
    I do use texture mapping -this problem occured since I started using opengl fonts - so if i click over an object it gives it's label but if for instance I choose the material of the label to be redish as below it actually appears blue - even though I disable depth testing before drawing the labels - this also affects other objects where I can't get red
    GLfloat diffuse[4]={0.7, 0.3, 0.3, 1.0};
    glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_emission);

    thanx


    [This message has been edited by fox (edited 03-21-2001).]

  4. #4
    Senior Member OpenGL Pro
    Join Date
    Oct 2000
    Location
    Fargo, ND
    Posts
    1,753

    Re: colour

    By default OpenGL uses the GL_MODULATE for the texture enviroment paramater. This will cause the material and textures to be blended together. Is it the actual material color you want to show, or the texture? If it's just the material color you want, disable textures before drawing... if you want the texture to show without blending you can do

    glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE /*or GL_DECAL*/);

    Or you can make your material white...
    Deiussum
    Software Engineer and OpenGL enthusiast

  5. #5
    Senior Member Regular Contributor
    Join Date
    Aug 2000
    Posts
    171

    Re: colour

    cheers - I'll try that

Similar Threads

  1. OpenGL colour not able to render colour
    By mundrapiyush in forum OpenGL: Linux
    Replies: 3
    Last Post: 05-16-2010, 03:15 AM
  2. Custom Colour
    By Eckos in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 08-27-2008, 12:49 AM
  3. colour order BGR
    By mr_coolio in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-11-2003, 05:34 AM
  4. Different colour for TGA font
    By cyam95 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 01-09-2002, 07:31 AM
  5. colour problem
    By fox in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 12-07-2001, 10:13 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
  •  
Proudly hosted by Digital Ocean