GL3: Remove GL_LIGHTING

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 641125963e
commit 3885389b3b

@ -473,7 +473,7 @@ bool CDriverGL3::setupDisplay()
// Backward compatibility: default lighting is Light0 default openGL
// meaning that light direction is always (0,1,0) in eye-space
// use enableLighting(0....), to get normal behaviour
_DriverGLStates.enableLight(0, true);
// _DriverGLStates.enableLight(0, true); // FIXME GL3 VERTEX PROGRAM
_LightMode[0] = CLight::DirectionalLight;
_WorldLightDirection[0] = CVector::Null;

@ -134,7 +134,7 @@ void CDriverGL3::enableLightInternal(uint8 num, bool enable)
// Enable glLight
if (num < MaxLight)
{
_DriverGLStates.enableLight(num, enable); // FIXME GL3 FIXED
// _DriverGLStates.enableLight(num, enable); // FIXME GL3 VERTEX PROGRAM
_UserLightEnable[num] = enable;
}
}

@ -437,7 +437,8 @@ bool CDriverGL3::setupMaterial(CMaterial& mat)
// Light Part.
_DriverGLStates.enableLighting(mat.getFlags()&IDRV_MAT_LIGHTING);
// _DriverGLStates.enableLighting(mat.getFlags()&IDRV_MAT_LIGHTING); // FIXME GL3 VERTEX PROGRAM
if ((mat.getFlags() & IDRV_MAT_LIGHTING) == 0)
disableAllLights();
@ -773,7 +774,7 @@ sint CDriverGL3::beginLightMapMultiPass ()
computeLightMapInfos (mat);
// always enable lighting for lightmap (because of dynamic light)
_DriverGLStates.enableLighting(true);
// _DriverGLStates.enableLighting(true); // FIXME GL3 VERTEX PROGRAM
// if the dynamic lightmap light has changed since the last render (should not happen), resetup
// normal way is that setupLightMapDynamicLighting() is called in setupMaterial() if shader different from prec

@ -63,11 +63,6 @@ void CDriverGLStates3::init()
_DepthRangeNear = 0.f;
_DepthRangeFar = 1.f;
_ZBias = 0.f;
// by default all lights are disabled (not reseted in forceDefaults)
for (i=0; i<MaxLight; i++)
{
_CurLight[i]= false;
}
}
@ -81,7 +76,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
_CurBlend = false;
_CurCullFace = true;
_CurAlphaTest = false;
_CurLighting= false;
_CurZWrite = true;
_CurStencilTest =false;
@ -90,7 +84,6 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
glDisable(GL_BLEND);
glEnable(GL_CULL_FACE);
glDisable(GL_ALPHA_TEST);
glDisable(GL_LIGHTING);
glDepthMask(GL_TRUE);
// Func.
@ -131,8 +124,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages)
static const GLfloat zero[4] = { 0, 0, 0, 1 };
// TexModes
uint stage;
for (stage=0;stage<nbStages; stage++)
for (uint stage = 0; stage < nbStages; ++stage)
{
// disable texturing.
nglActiveTexture(GL_TEXTURE0 + stage);
@ -236,52 +228,6 @@ void CDriverGLStates3::enableAlphaTest(uint enable)
}
}
// ***************************************************************************
void CDriverGLStates3::enableLighting(uint enable)
{
H_AUTO_OGL(CDriverGLStates3_enableLighting)
// If different from current setup, update.
bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE
if (enabled != _CurLighting)
#endif
{
// new state.
_CurLighting= enabled;
}
}
// ***************************************************************************
void CDriverGLStates3::enableLight(uint num, uint enable)
{
H_AUTO_OGL(CDriverGLStates3_enableLight)
if (num >= MaxLight)
return;
// If different from current setup, update.
bool enabled= (enable!=0);
#ifndef NL3D_GLSTATE_DISABLE_CACHE
if (enabled != _CurLight[num])
#endif
{
// new state.
_CurLight[num]= enabled;
}
}
// ***************************************************************************
bool CDriverGLStates3::isLightEnabled(uint num) const
{
H_AUTO_OGL(CDriverGLStates3_isLightEnabled)
if (num >= MaxLight)
return false;
else
return _CurLight[num];
}
// ***************************************************************************
void CDriverGLStates3::enableZWrite(uint enable)
{

@ -89,12 +89,6 @@ public:
/// enable and set good AlphaFunc.
void enableAlphaTest(uint enable);
void enableZWrite(uint enable);
// overall lighting enabled
void enableLighting(uint enable);
bool isLightingEnabled() const { return _CurLighting; }
/// enable/disable specific light. num must be < "maxLight" param set in init()
void enableLight(uint num, uint enable);
bool isLightEnabled(uint num) const;
/// enable/disable stencil test
void enableStencilTest(bool enable);
bool isStencilTestEnabled() const { return _CurStencilTest; }
@ -170,7 +164,6 @@ private:
bool _CurFog;
bool _CurCullFace;
bool _CurAlphaTest;
bool _CurLighting;
bool _CurZWrite;
bool _CurStencilTest;
@ -217,10 +210,6 @@ private:
private:
void updateDepthRange();
// Mirror of glEnable() and GL_LIGHT0+i
enum { MaxLight = NL_OPENGL3_MAX_LIGHT };
bool _CurLight[MaxLight];
};
#ifdef NL_STATIC

Loading…
Cancel
Save