Results 1 to 5 of 5

Thread: debug lighting vs release lighting

  1. #1
    Member Contributor
    Join Date
    Aug 2000
    Location
    Epinay sur Seine, France
    Posts
    67

    debug lighting vs release lighting

    i have a very weird problem, with the following code which render a simple landscape
    [CODE] glEnable(GL_LIGHTING);
    glEnable(GL_LIGHT0);
    land.Render(frustumhelper, draw_debug);
    {
    GLfloat light_ambient[] = { 0.0f, 0.0f, 0.0f, 1.0f };
    GLfloat light_diffuse[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    GLfloat light_specular[] = { 1.0f, 1.0f, 1.0f, 1.0f };
    //GLfloat light_position[] = { 1.0f, 1.0f, 1.0f, 0.0f };
    GLfloat light_position[] = { 0.0f, 0.0f, 1.0f, 0.0f };

    glLightfv(GL_LIGHT0, GL_AMBIENT, light_ambient);
    glLightfv(GL_LIGHT0, GL_DIFFUSE, light_diffuse);
    glLightfv(GL_LIGHT0, GL_SPECULAR, light_specular);
    glLightfv(GL_LIGHT0, GL_POSITION, light_position);
    }
    glDisable(GL_LIGHTING);

    [CODE]
    in release mode, lighting is correct however in debug mode the landscape doesn't lit at all : full dark !!

    any hint about this behaviour ??
    thanks for the help.
    One life for hate , one eternity for love [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

  2. #2
    Member Newbie
    Join Date
    Oct 2003
    Posts
    30

    Re: debug lighting vs release lighting

    Do you have any ASSERTs, cause if you do, they may be the problem...

  3. #3
    Senior Member OpenGL Pro
    Join Date
    May 2001
    Location
    Kristianstad,Skåne,Sweden
    Posts
    1,595

    Re: debug lighting vs release lighting

    Yes, check all TRACE and ASSERT lines, one typical problem is if you have:

    if( .... )
    TRACE( ...);

    This will break in release mode, you must use:

    if( ... )
    {
    TRACE( ... );
    }

    Mikael

  4. #4
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: debug lighting vs release lighting

    Then sit down and debug what's the difference in OpenGL calls for both paths.
    You're setting the lighting parameters _after_ you have rendered the frustum helper(?).
    If the frustum helper has modified the modelview matrix, the light position is transformed by the current modelview matrix.

  5. #5
    Member Contributor
    Join Date
    Aug 2000
    Location
    Epinay sur Seine, France
    Posts
    67

    Re: debug lighting vs release lighting

    Then sit down and debug what's the difference in OpenGL calls for both paths
    there is _no_ difference between the debug and release _code_

    You're setting the lighting parameters _after_ you have rendered the frustum helper(?).
    If the frustum helper has modified the modelview matrix, the light position is transformed by the current modelview matrix.
    actually the frustumhelper modify nothing, it just compute the 6 planes (normal and distance values) so the light is till tied to the modelview matrix before frustum operation.

    however the debug version works great now. it seems it's another compile problem but i'm sure sure i did many rebuild all (using vc 6)....
    weirdo.

    thanks for your replis guyz
    One life for hate , one eternity for love [img]/forum/images/%%GRAEMLIN_URL%%/smile.gif[/img]

Similar Threads

  1. Lighting Problem when running a release build
    By devildeath in forum OpenGL: Windows
    Replies: 1
    Last Post: 09-22-2010, 12:09 PM
  2. debug/release difference in glReadPixels
    By bozalina in forum OpenGL: Advanced Coding
    Replies: 7
    Last Post: 09-21-2006, 09:03 AM
  3. lighting fails in release
    By qiz in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 08-28-2003, 03:55 AM
  4. Debug vs. Release Builds
    By ribblem in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 02-01-2001, 07:19 AM
  5. debug(Release) message
    By gvili r in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 02-08-2000, 03:58 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