Results 1 to 3 of 3

Thread: Simultaneous Lighting and Blending impossible?

  1. #1
    Member Newbie
    Join Date
    Nov 2002
    Posts
    33

    Simultaneous Lighting and Blending impossible?

    Hi!

    It seems, when unsing blending and lighting, I can only get one of them to work at a time... That is, if I enable lighting, blending does not work.
    Is this an internal restriction or did I just miss an important state configuration part?

    Thanks
    Nick

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

    Re: Simultaneous Lighting and Blending impossible?

    They are two separated operations and work independently. Your problem is probably that you use the alpha channel of the primary color (glColor for example) to control transparency. When lighting is enabled, the primary color is calculated using the lighting equations, and the value you pass is not used. When lighting is enabled, you change the material of the object using glMaterial.

  3. #3
    Member Newbie
    Join Date
    Nov 2002
    Posts
    33

    Re: Simultaneous Lighting and Blending impossible?

    Thanks! I see now!
    Anyway I think it's strange, that when the alpha value of the 'glColor' color got 0 the object was not rendered although any non-zero alpha values have no effect on transparency.
    I guess it must be some form of optimization, that avoids drawing when the primary alpha is zero or something...
    What do you think?

    Nick

Similar Threads

  1. Replies: 1
    Last Post: 05-01-2013, 09:37 PM
  2. Lighting & blending
    By nk in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-22-2004, 08:30 AM
  3. Can I use blending&lighting together?
    By in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 07-01-2003, 03:01 AM
  4. Lighting with Blending
    By MrShoe in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 12-28-2001, 05:37 PM
  5. Smooth Shading + glColor4f + Alpha blending = impossible?
    By Arath in forum OpenGL: Basic Coding
    Replies: 6
    Last Post: 11-15-2000, 11:03 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