From: David T. <dc...@sa...> - 2002-10-23 23:14:42
|
I have found the lighting bug! I'm not sure how to implement the fix in the Python code generator (or if my fix is the most efficient way to go about it), but the basic problem is that calling glEnable(GL_LIGHTING) glEnable(GL_LIGHT0) then switching to another context and back to call glDisable(GL_LIGHT0) ends up setting the state tracker's state bits for light 0 (sb->lighting.light[0].dirty) but NOT setting the bits for lighting (sb->lighting.dirty). So, when crStateDiffContext() or crStateSwitchContext() call CHECKDIRTY(sb->lighting.dirty, bitID) to see if crStateLightingDiff() must be called, the test fails even though one of the lights must be enabled/disabled to move to the new context. What's worked as a fix for me is to add a "FILLDIRTY(b->dirty);" into state_lighting_gen.c (patch attached), but this file is automatically generated. The patch is against the generated file. Could this be causing Jesus Caban's OpenInventor color problem, too? David |