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 3 of 3

Thread: Vertex colors and lights.

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2000
    Posts
    5

    Vertex colors and lights.

    Here is the problem I have.

    The scene renders with vertex colors perfectly. But after activating openGL lighting It takes the light, but the colors disappear. The result is an ugly grayscale image. Is there anything I need to know about lights in opengl?

    BTW. I really need the Vertex colors to conserve texture memory.

  2. #2
    Guest

    Re: Vertex colors and lights.

    vertex colors do not work with lights
    assuming you are using

    glColor....

    you should use instead

    glMaterial.....

  3. #3
    Guest

    Re: Vertex colors and lights.

    A quicker easier way to do it is to use glColorMaterial(GL_FRONT_AND_BACK,GL_AMBIENT_AND_D IFFUSE);
    glEnable(GL_COLOR_MATERIAL);
    i think I got all the options correct. Note that you need to call glColorMaterial b4 the glEnable. You can change to options to glColorMaterial to get other effects.

Posting Permissions

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