Results 1 to 4 of 4

Thread: Lightening problems

  1. #1
    Guest

    Lightening problems

    I have some problems with GL lightening.
    I have a 3D scene exported from blender with
    - normals per vertex
    - color per vertex
    - texture uv per face

    *) material properties ok.
    *) light source is ok (position + properties)

    When i render with
    glEnable(GL_LIGHT0);
    glEnable(GL_LIGHTING);
    glEnable(GL_TEXTURE_2D);
    glEnable(GL_COLOR_MATERIAL);

    ==> No lighting.
    If i don't use TEXTUREs, i have light ok.
    What is happening ??

    2) I use a glMultMatrix in my rendering code is it ok for lightning ??

  2. #2
    Senior Member Regular Contributor
    Join Date
    Feb 2000
    Location
    Caracas/Venezuela
    Posts
    182

    Re: Lightening problems

    At which point are you defining the light's position? The usual way to do it is after setting the world matrix in the modelview matrix (for example, after gluLookAt).
    Also, if you enable GL_COLOR_MATERIAL, you have to use glColor to define material properties, not glMaterial.

  3. #3
    Guest

    Re: Lightening problems

    Thanks i'll try i after my exams...

  4. #4
    Senior Member Regular Contributor
    Join Date
    Jun 2000
    Location
    B.C., Canada
    Posts
    367

    Re: Lightening problems

    If lighting works without textures and doesn't work with, you probably have your texture environment set to GL_REPLACE or GL_DECAL. Set it to GL_MODULATE and the lighting should show up.

    j

Similar Threads

  1. lightening
    By karteek in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-23-2003, 07:04 PM
  2. regarding textues and lightening
    By karteek in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-13-2003, 01:29 AM
  3. Problem in lightening
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 02-11-2003, 02:48 AM
  4. Lightening
    By in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 02-10-2003, 08:51 PM
  5. How to switch lightening off
    By pospisil_m in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 01-08-2003, 12:19 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