|
|
@ -128,32 +128,32 @@ void CDriverGL3::setTextureEnvFunction(uint stage, CMaterial& mat)
|
|
|
|
activateTexEnvColor(stage, env);
|
|
|
|
activateTexEnvColor(stage, env);
|
|
|
|
|
|
|
|
|
|
|
|
// Activate texture generation mapping
|
|
|
|
// Activate texture generation mapping
|
|
|
|
_DriverGLStates.activeTexture(stage);
|
|
|
|
//_DriverGLStates.activeTexture(stage);
|
|
|
|
if (mat.getTexCoordGen (stage))
|
|
|
|
if (mat.getTexCoordGen(stage))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// set mode and enable.
|
|
|
|
// set mode and enable.
|
|
|
|
CMaterial::TTexCoordGenMode mode= mat.getTexCoordGenMode(stage);
|
|
|
|
CMaterial::TTexCoordGenMode mode= mat.getTexCoordGenMode(stage);
|
|
|
|
if (mode==CMaterial::TexCoordGenReflect)
|
|
|
|
if (mode==CMaterial::TexCoordGenReflect)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Cubic or normal ?
|
|
|
|
// Cubic or normal ?
|
|
|
|
if (text->isTextureCube ())
|
|
|
|
if (text->isTextureCube())
|
|
|
|
_DriverGLStates.setTexGenMode (stage, GL_REFLECTION_MAP_ARB);
|
|
|
|
setTexGenModeVP(stage, TexGenReflectionMap);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
_DriverGLStates.setTexGenMode (stage, GL_SPHERE_MAP);
|
|
|
|
setTexGenModeVP(stage, TexGenSphereMap);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mode==CMaterial::TexCoordGenObjectSpace)
|
|
|
|
else if (mode==CMaterial::TexCoordGenObjectSpace)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_DriverGLStates.setTexGenMode (stage, GL_OBJECT_LINEAR);
|
|
|
|
setTexGenModeVP(stage, TexGenObjectLinear);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (mode==CMaterial::TexCoordGenEyeSpace)
|
|
|
|
else if (mode==CMaterial::TexCoordGenEyeSpace)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_DriverGLStates.setTexGenMode (stage, GL_EYE_LINEAR);
|
|
|
|
setTexGenModeVP(stage, TexGenEyeLinear);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Disable.
|
|
|
|
// Disable.
|
|
|
|
_DriverGLStates.setTexGenMode(stage, 0);
|
|
|
|
setTexGenModeVP(stage, TexGenDisabled);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -835,8 +835,7 @@ void CDriverGL3::setupLightMapPass(uint pass)
|
|
|
|
// FIXME GL3 LIGHTMAP
|
|
|
|
// FIXME GL3 LIGHTMAP
|
|
|
|
|
|
|
|
|
|
|
|
// Setup gen tex off
|
|
|
|
// Setup gen tex off
|
|
|
|
_DriverGLStates.activeTexture(0);
|
|
|
|
setTexGenModeVP(0, TexGenDisabled);
|
|
|
|
_DriverGLStates.setTexGenMode(0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// And disable other stages.
|
|
|
|
// And disable other stages.
|
|
|
|
for (uint stage = 1; stage < inlGetNumTextStages(); stage++)
|
|
|
|
for (uint stage = 1; stage < inlGetNumTextStages(); stage++)
|
|
|
@ -932,8 +931,7 @@ void CDriverGL3::setupLightMapPass(uint pass)
|
|
|
|
activateTexEnvColor(stage, stdEnv);
|
|
|
|
activateTexEnvColor(stage, stdEnv);
|
|
|
|
|
|
|
|
|
|
|
|
// Setup env for texture stage.
|
|
|
|
// Setup env for texture stage.
|
|
|
|
_DriverGLStates.activeTexture(stage);
|
|
|
|
setTexGenModeVP(stage, TexGenDisabled);
|
|
|
|
_DriverGLStates.setTexGenMode(stage, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// setup TexEnvCombine4 (ignore alpha part).
|
|
|
|
// setup TexEnvCombine4 (ignore alpha part).
|
|
|
|
if (_CurrentTexEnvSpecial[stage] != TexEnvSpecialLightMap)
|
|
|
|
if (_CurrentTexEnvSpecial[stage] != TexEnvSpecialLightMap)
|
|
|
@ -961,8 +959,7 @@ void CDriverGL3::setupLightMapPass(uint pass)
|
|
|
|
activateTexEnvMode(stage, _LightMapLastStageEnv);
|
|
|
|
activateTexEnvMode(stage, _LightMapLastStageEnv);
|
|
|
|
|
|
|
|
|
|
|
|
// Setup gen tex off
|
|
|
|
// Setup gen tex off
|
|
|
|
_DriverGLStates.activeTexture(stage);
|
|
|
|
setTexGenModeVP(stage, TexGenDisabled);
|
|
|
|
_DriverGLStates.setTexGenMode(stage, 0);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -1087,8 +1084,7 @@ void CDriverGL3::setupSpecularBegin()
|
|
|
|
activateTexEnvMode(0, env);
|
|
|
|
activateTexEnvMode(0, env);
|
|
|
|
|
|
|
|
|
|
|
|
// Disable texGen for stage 0
|
|
|
|
// Disable texGen for stage 0
|
|
|
|
_DriverGLStates.activeTexture(0);
|
|
|
|
setTexGenModeVP(0, TexGenDisabled);
|
|
|
|
_DriverGLStates.setTexGenMode(0, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// ---- Stage 1 Common Setup.
|
|
|
|
// ---- Stage 1 Common Setup.
|
|
|
|
// NB don't setup the TexEnv here (stage1 setuped in setupSpecularPass() according to extensions)
|
|
|
|
// NB don't setup the TexEnv here (stage1 setuped in setupSpecularPass() according to extensions)
|
|
|
@ -1105,8 +1101,7 @@ void CDriverGL3::setupSpecularEnd()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
H_AUTO_OGL(CDriverGL3_setupSpecularEnd)
|
|
|
|
H_AUTO_OGL(CDriverGL3_setupSpecularEnd)
|
|
|
|
// Disable Texture coord generation.
|
|
|
|
// Disable Texture coord generation.
|
|
|
|
_DriverGLStates.activeTexture(1);
|
|
|
|
setTexGenModeVP(1, TexGenDisabled);
|
|
|
|
_DriverGLStates.setTexGenMode(1, 0);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Happiness !!! we have already enabled the stage 1
|
|
|
|
// Happiness !!! we have already enabled the stage 1
|
|
|
|
_UserTexMat[ 1 ].identity();
|
|
|
|
_UserTexMat[ 1 ].identity();
|
|
|
|