GL3: Remove checkForPerPixelLightingSupport

--HG--
branch : opengl3
hg/feature/opengl3
kaetemi 11 years ago
parent 313de47e53
commit 8a60e5d4fa

@ -485,19 +485,16 @@ bool CDriverGL3::setupDisplay()
_Initialized = true;
_ForceDXTCCompression= false;
_ForceTextureResizePower= 0;
_ForceDXTCCompression = false;
_ForceTextureResizePower = 0;
// Reset profiling.
_AllocatedTextureMemory= 0;
_AllocatedTextureMemory = 0;
_TextureUsed.clear();
_PrimitiveProfileIn.reset();
_PrimitiveProfileOut.reset();
_NbSetupMaterialCall= 0;
_NbSetupModelMatrixCall= 0;
// check whether per pixel lighting shader is supported
checkForPerPixelLightingSupport();
_NbSetupMaterialCall = 0;
_NbSetupModelMatrixCall = 0;
// Reset the vbl interval
setSwapVBLInterval(_Interval);
@ -1178,26 +1175,12 @@ void CDriverGL3::setMatrix2DForTextureOffsetAddrMode(const uint stage, const flo
//glTexEnvfv(GL_TEXTURE_SHADER_NV, GL_OFFSET_TEXTURE_MATRIX_NV, mat);
}
// ***************************************************************************
void CDriverGL3::checkForPerPixelLightingSupport()
{
H_AUTO_OGL(CDriverGL3_checkForPerPixelLightingSupport)
// we need at least 3 texture stages and cube map support + EnvCombine4 or 3 support
// TODO : support for EnvCombine3
// TODO : support for less than 3 stages
_SupportPerPixelShaderNoSpec = true; // FIXME GL3
_SupportPerPixelShader = true; // FIXME GL3
}
// ***************************************************************************
bool CDriverGL3::supportPerPixelLighting(bool specular) const
{
H_AUTO_OGL(CDriverGL3_supportPerPixelLighting)
return specular ? _SupportPerPixelShader : _SupportPerPixelShaderNoSpec;
return _Extensions.GLCore;
}
// ***************************************************************************

@ -918,9 +918,6 @@ private:
//\name description of the per pixel light
// @{
void checkForPerPixelLightingSupport();
bool _SupportPerPixelShader;
bool _SupportPerPixelShaderNoSpec;
float _PPLExponent;
NLMISC::CRGBA _PPLightDiffuseColor;
NLMISC::CRGBA _PPLightSpecularColor;

@ -218,12 +218,17 @@ CMaterial::TShader CDriverGL3::getSupportedShader(CMaterial::TShader shader)
H_AUTO_OGL(CDriverGL3_CDriverGL)
switch (shader)
{
case CMaterial::PerPixelLighting: return _SupportPerPixelShader ? CMaterial::PerPixelLighting : CMaterial::Normal;
case CMaterial::PerPixelLightingNoSpec: return _SupportPerPixelShaderNoSpec ? CMaterial::PerPixelLightingNoSpec : CMaterial::Normal;
case CMaterial::PerPixelLighting:
return CMaterial::Normal; // FIXME GL3
case CMaterial::PerPixelLightingNoSpec:
return CMaterial::Normal; // FIXME GL3
// Lightmap and Specular work only if at least 2 text stages.
case CMaterial::LightMap: return (inlGetNumTextStages()>=2) ? CMaterial::LightMap : CMaterial::Normal;
case CMaterial::Specular: return (inlGetNumTextStages()>=2) ? CMaterial::Specular : CMaterial::Normal;
default: return shader;
case CMaterial::LightMap:
return (inlGetNumTextStages() >= 2) ? CMaterial::LightMap : CMaterial::Normal;
case CMaterial::Specular:
return (inlGetNumTextStages() >= 2) ? CMaterial::Specular : CMaterial::Normal;
default:
return shader;
}
}

Loading…
Cancel
Save