Results 1 to 3 of 3

Thread: Color/Lighting confusion

  1. #1
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Color/Lighting confusion

    Hi,

    I am a little confused about how glColor4f, glColorPointer & Lights make up the final color for a primitive.

    As I understand:
    1. If lighting is disabled
    1.1 The vertex gets the current color (possibly set by glColor4f).
    1.2 Each vertex gets the color given by glColorPointer, if given (Is this correct ??)

    2. If lighting is enabled Vertex color is calculated using current lighting parameters.
    2.1 This lighting parameters include material properties, which can be taken from the current color (glColor4f), if COLOR_MATERIAL is enabled.
    2.2 If COLOR_MATERIAL is disabled, only the current lighting parameters are used. (glColor & glColorPointer dont make any difference)(Is this correct ??)
    2.3 If COLOR_MATERIAL is enabled and we have data given by glColorPointer , for each vertex we take the material color from the glColorPointer information and compute the lighting. (Is this correct ??)

    Do let me know if my understanding of OpenGL ES color and lighting is right.

    Thanks & regards,
    Neelima

  2. #2
    Junior Member
    Join Date
    Jun 2004
    Posts
    19

    Re: Color/Lighting confusion

    Yes those things are correct.

    The attribute token specified by the glColorMaterial call determines which material parameter is affected by the application of color attributes if and only if GL_COLOR_MATERIAL is enabled. If it is not enabled color attributes are ignored and the current glMaterial attributes are used for lighting calculations.

  3. #3
    Junior Member
    Join Date
    Jun 2004
    Posts
    7

    Re: Color/Lighting confusion

    Thanks a lot dorbie

Similar Threads

  1. Confusion with write_imagef()
    By giridhart in forum OpenCL
    Replies: 1
    Last Post: 09-08-2010, 01:19 PM
  2. OpenGL ES Color buffer v.s Lighting
    By wycwang in forum OpenGL ES general technical discussions
    Replies: 2
    Last Post: 07-20-2007, 07:56 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
  •