Results 1 to 4 of 4

Thread: Lighting.

  1. #1
    Junior Member Newbie
    Join Date
    Feb 2004
    Bangalore, Karnataka,India


    Hi all,
    How to get lighting effect with the colors that I used to draw the objects. That is I have a cube with diferent colors for each surface. But When I use lighting effect. I get all in white-black-grey combination. I used white light( {1.0,1.0,1.0,1.0}). I tried some of the examples from the net. But didn't help. Can anybody help me. So that I get the surfaces lit with its own colors.

  2. #2
    Senior Member OpenGL Pro
    Join Date
    May 2001

    Re: Lighting.

    Hi !

    Maybe you could post the part of your code that does the rendering here, it is difficult to say whats wrong without having a peek at the code.


  3. #3
    Member Contributor
    Join Date
    Nov 2001

    Re: Lighting.

    When you apply lighting, the colored vertices will disappear. Don't know why, but they do. In order to get them back, you either have to create a texture, or use materials. Setting the material values is usually easier. XD

  4. #4
    Member Contributor
    Join Date
    Feb 2003

    Re: Lighting.

    did you try to search about this here?
    use this:
    if u use glColor3f to color vertices
    or use materials....

    [This message has been edited by gvm (edited 02-27-2004).]

Similar Threads

  1. How to introduce Specular and Diffuse lighting into Bumped lighting
    By Liable in forum OpenGL: Advanced Coding
    Replies: 3
    Last Post: 12-06-2004, 05:48 PM
  2. Lighting problem (opengl + shader lighting)
    By ox1d_47 in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 08-19-2004, 09:43 PM
  3. debug lighting vs release lighting
    By haust in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-30-2003, 10:43 AM
  4. lighting back facing triangles _without_ using two sided lighting
    By Nicolas Lelong in forum OpenGL: Advanced Coding
    Replies: 5
    Last Post: 02-07-2003, 03:05 AM
  5. About lighting (not OpenGL lighting, but general lighting)
    By Anonymous Coward in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2001, 09:10 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