From cb3f3b72c5624e36758aaf320dbdf531560cb92a Mon Sep 17 00:00:00 2001 From: kaetemi Date: Wed, 2 Apr 2014 19:08:52 +0200 Subject: [PATCH] GL3: Cleanup --HG-- branch : opengl3 --- .../src/3d/driver/opengl3/driver_opengl.cpp | 16 +- .../nel/src/3d/driver/opengl3/driver_opengl.h | 31 +- .../driver/opengl3/driver_opengl_material.cpp | 326 ++++-------------- .../driver/opengl3/driver_opengl_program.cpp | 242 +------------ .../driver/opengl3/driver_opengl_states.cpp | 1 + .../driver/opengl3/driver_opengl_texture.cpp | 16 +- 6 files changed, 105 insertions(+), 527 deletions(-) diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp index 09ef3f687..7434906ff 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl.cpp @@ -411,7 +411,7 @@ bool CDriverGL3::setupDisplay() // Activate the default texture environnments for all stages. //=========================================================== - for (uint stage=0;stageisTextureCube()) @@ -140,11 +131,11 @@ void CDriverGL3::setTextureEnvFunction(uint stage, CMaterial& mat) else setTexGenModeVP(stage, TexGenSphereMap); } - else if (mode==CMaterial::TexCoordGenObjectSpace) + else if (mode == CMaterial::TexCoordGenObjectSpace) { setTexGenModeVP(stage, TexGenObjectLinear); } - else if (mode==CMaterial::TexCoordGenEyeSpace) + else if (mode == CMaterial::TexCoordGenEyeSpace) { setTexGenModeVP(stage, TexGenEyeLinear); } @@ -240,7 +231,6 @@ bool CDriverGL3::setupMaterial(CMaterial& mat) CMaterial::TShader matShader; GLenum glenum = GL_ZERO; uint32 touched = mat.getTouched(); - uint stage; // profile. _NbSetupMaterialCall++; @@ -315,15 +305,8 @@ bool CDriverGL3::setupMaterial(CMaterial& mat) // 2b. User supplied pixel shader overrides material //================================== - if (m_UserPixelProgram) - { - matShader = CMaterial::Program; - } - else - { - // Now we can get the supported shader from the cache. - matShader = pShader->SupportedShader; - } + // Now we can get the supported shader from the cache. + matShader = pShader->SupportedShader; // 2b. Update more shader state //================================== @@ -349,9 +332,9 @@ bool CDriverGL3::setupMaterial(CMaterial& mat) // because setupTexture() may disable all stage. if (matShader != CMaterial::Water && matShader != CMaterial::Program) { - for (stage=0 ; stagegetFlags() & IDRV_MAT_DOUBLE_SIDED) != 0) - _DriverGLStates.enableCullFace(false); - else - _DriverGLStates.enableCullFace(true); - - CDynMaterial *m = _CurrentMaterial->getDynMat(); - SRenderPass *currentPass = m->getPass(pass); - - IProgram *p; - - IProgram* programs[ 2 ]; - programs[ 0 ] = currentProgram.vp; - programs[ 1 ] = currentProgram.pp; - - IDriver::TProgram type[ 2 ]; - type[ 0 ] = IDriver::VertexProgram; - type[ 1 ] = IDriver::PixelProgram; - - for (uint32 j = 0; j < 2; j++) - { - p = programs[ j ]; - - for (uint32 i = 0; i < currentPass->count(); i++) - { - const SDynMaterialProp *prop = currentPass->getProperty(i); - int loc = getUniformLocation(type[ j ], prop->prop.c_str()); - if (loc == -1) - continue; - - switch(prop->type) - { - case SDynMaterialProp::Float: - setUniform1f(type[ j ], loc, prop->value.toFloat()); - break; - - case SDynMaterialProp::Int: - setUniform1i(type[ j ], loc, prop->value.toInt()); - break; - - case SDynMaterialProp::Uint: - setUniform1ui(type[ j ], loc, prop->value.toUInt()); - break; - - case SDynMaterialProp::Color: - { - float v[ 4 ]; - prop->value.getVector4(v); - - for (int k = 0; k < 4; k++) - v[ k ] = v[ k ] / 255.0f; - - setUniform4f(type[ j ], loc, v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ]); - } - break; - - case SDynMaterialProp::Vector4: - { - float v[ 4 ]; - prop->value.getVector4(v); - setUniform4f(type[ j ], loc, v[ 0 ], v[ 1 ], v[ 2 ], v[ 3 ]); - } - break; - - case SDynMaterialProp::Matrix4: - { - float m[ 16 ]; - prop->value.getMatrix4(m); - setUniform4x4f(type[ j ], loc, m); - break; - } - - case SDynMaterialProp::Texture: - break; - } - } - - ////////////////////////////////// Set up some standard uniforms ////////////////////////////////// - - int loc = -1; - loc = getUniformLocation(type[ j ], "mvpMatrix"); - if (loc != -1) - { - CMatrix mat = _GLProjMat * _ModelViewMatrix; - setUniform4x4f(type[ j ], loc, mat); - } - - loc = getUniformLocation(type[ j ], "mvMatrix"); - if (loc != -1) - { - setUniform4x4f(type[ j ], loc, _ModelViewMatrix); - } - - //////////////////////////////////////////////////////////////////////////////////////////////////// - - } - - return true; - */ -} - void CDriverGL3::setupNormalPass() { nlassert(m_DriverPixelProgram); const CMaterial &mat = *_CurrentMaterial; - for (int i = 0; i < _Extensions.NbFragmentTextureUnits; i++) + for (int i = 0; i < IDRV_MAT_MAXTEXTURES; i++) { - if (!m_UserPixelProgram) + // Set constants for TexEnv + uint cl = m_DriverPixelProgram->getUniformIndex(CProgramIndex::TName(CProgramIndex::Constant0 + i)); + if (cl != ~0) { - // Set constant - int cl = m_DriverPixelProgram->getUniformIndex(CProgramIndex::TName(CProgramIndex::Constant0 + i)); - if (cl != -1) - { - GLfloat glCol[ 4 ]; - convColor(mat._TexEnvs[ i ].ConstantColor, glCol); - setUniform4f(IDriver::PixelProgram, cl, glCol[ 0 ], glCol[ 1 ], glCol[ 2 ], glCol[ 3 ]); - } + GLfloat glCol[4]; + convColor(mat._TexEnvs[i].ConstantColor, glCol); + setUniform4f(IDriver::PixelProgram, cl, glCol[0], glCol[1], glCol[2], glCol[3]); } } } @@ -762,6 +639,9 @@ void CDriverGL3::computeLightMapInfos (const CMaterial &mat) sint CDriverGL3::beginLightMapMultiPass () { H_AUTO_OGL(CDriverGL3_beginLightMapMultiPass) + + //setupBuiltinPrograms(); // FIXME GL3 + const CMaterial &mat= *_CurrentMaterial; // compute how many lightmap and pass we must process. @@ -811,8 +691,8 @@ void CDriverGL3::setupLightMapPass(uint pass) activateTexture(0,text); // setup std modulate env - CMaterial::CTexEnv env; - activateTexEnvMode(0, env); + //CMaterial::CTexEnv env; + //activateTexEnvMode(0, env); // FIXME GL3 // Since Lighting is disabled, as well as colorArray, must setup alpha. // setup color to 0 => blackness. in emissive cause texture can still be lighted by dynamic light @@ -820,7 +700,7 @@ void CDriverGL3::setupLightMapPass(uint pass) // FIXME GL3 LIGHTMAP // Setup gen tex off - setTexGenModeVP(0, TexGenDisabled); + // setTexGenModeVP(0, TexGenDisabled); // FIXME GL3 // And disable other stages. for (uint stage = 1; stage < inlGetNumTextStages(); stage++) @@ -913,17 +793,17 @@ void CDriverGL3::setupLightMapPass(uint pass) setUniform4f(IDriver::PixelProgram, cl, glCol[ 0 ], glCol[ 1 ], glCol[ 2 ], glCol[ 3 ]); } - activateTexEnvColor(stage, stdEnv); + // activateTexEnvColor(stage, stdEnv); // FIXME GL3 // Setup env for texture stage. - setTexGenModeVP(stage, TexGenDisabled); + // setTexGenModeVP(stage, TexGenDisabled); // FIXME GL3 // setup TexEnvCombine4 (ignore alpha part). - if (_CurrentTexEnvSpecial[stage] != TexEnvSpecialLightMap) + /*if (_CurrentTexEnvSpecial[stage] != TexEnvSpecialLightMap) { // TexEnv is special. _CurrentTexEnvSpecial[stage] = TexEnvSpecialLightMap; - } + }*/ // FIXME GL3 } } @@ -941,10 +821,10 @@ void CDriverGL3::setupLightMapPass(uint pass) activateTexture(stage,text); // setup ModulateRGB/ReplaceAlpha env. (this may disable possible COMBINE4_NV setup). - activateTexEnvMode(stage, _LightMapLastStageEnv); + // activateTexEnvMode(stage, _LightMapLastStageEnv); // FIXME GL3 // Setup gen tex off - setTexGenModeVP(stage, TexGenDisabled); + // setTexGenModeVP(stage, TexGenDisabled); // FIXME GL3 } } else @@ -1053,31 +933,9 @@ void CDriverGL3::endSpecularBatch() void CDriverGL3::setupSpecularBegin() { H_AUTO_OGL(CDriverGL3_setupSpecularBegin) - // ---- Reset any textures with id>=2 - uint stage = 2; - for (; stage < inlGetNumTextStages(); stage++) - { - // disable texturing - activateTexture(stage, NULL); - } - - // ---- Stage 0 Common Setup. - // Setup the env for stage 0 only. - // Result RGB : Texture*Diffuse, Alpha : Texture - CMaterial::CTexEnv env; - env.Env.OpAlpha= CMaterial::Replace; - activateTexEnvMode(0, env); // Disable texGen for stage 0 setTexGenModeVP(0, TexGenDisabled); - - // ---- Stage 1 Common Setup. - // NB don't setup the TexEnv here (stage1 setuped in setupSpecularPass() according to extensions) - // For all cases, setup the TexCoord gen for stage1 - _DriverGLStates.activeTexture(1); - - // todo hulud remove - lol - // _DriverGLStates.setTextureMode(CDriverGLStates::TextureCubeMap); setTexGenModeVP(1, TexGenReflectionMap); // setup the good matrix for stage 1. @@ -1101,25 +959,14 @@ sint CDriverGL3::beginSpecularMultiPass() H_AUTO_OGL(CDriverGL3_beginSpecularMultiPass) const CMaterial &mat= *_CurrentMaterial; - // activate the 2 textures here - uint stage; - uint numStages= std::min((uint)2, inlGetNumTextStages()); - for (stage=0 ; stagegetUniformIndex(CProgramIndex::TexMatrix0); // FIXME GL3 VERTEX PROGRAM - if (tm0 != -1) - { - setUniform4x4f(IDriver::VertexProgram, tm0, _UserTexMat[ 0 ]); // OR is it just 1 (and not 0 2 3)? - } - - int tm2 = m_DriverVertexProgram->getUniformIndex(CProgramIndex::TexMatrix2); // FIXME GL3 VERTEX PROGRAM - if (tm2 != -1) - { - setUniform4x4f(IDriver::VertexProgram, tm2, _UserTexMat[ 2 ]); - } - - int tm3 = m_DriverVertexProgram->getUniformIndex(CProgramIndex::TexMatrix3); // FIXME GL3 VERTEX PROGRAM - if (tm3 != -1) - { - setUniform4x4f(IDriver::VertexProgram, tm3, _UserTexMat[ 3 ]); - } - - { - // Ok we can do it in a single pass - - // Set Stage 1 - // Special: not the same special env if there is or not texture in stage 0. - CTexEnvSpecial newEnvStage1; - if (mat.getTexture(0) == NULL) - newEnvStage1= TexEnvSpecialSpecularStage1NoText; - else - newEnvStage1= TexEnvSpecialSpecularStage1; - // Test if same env as prec. - if (_CurrentTexEnvSpecial[1] != newEnvStage1) - { - // TexEnv is special. - _CurrentTexEnvSpecial[1] = newEnvStage1; - - _DriverGLStates.activeTexture(1); - - } + uint idx = m_DriverVertexProgram->getUniformIndex((CProgramIndex::TName)(CProgramIndex::TexMatrix0 + stage)); + if (idx != ~0) + setUniform4x4f(IDriver::VertexProgram, idx, _UserTexMat[stage]); } } @@ -1185,6 +990,7 @@ void CDriverGL3::setupSpecularPass(uint pass) void CDriverGL3::endSpecularMultiPass() { H_AUTO_OGL(CDriverGL3_endSpecularMultiPass) + // End specular , only if not Batching mode. if (!_SpecularBatchOn) setupSpecularEnd(); @@ -1313,6 +1119,9 @@ CTextureCube *CDriverGL3::getSpecularCubeMap(uint exp) sint CDriverGL3::beginPPLMultiPass() { H_AUTO_OGL(CDriverGL3_beginPPLMultiPass) + + //setupBuiltinPrograms(); // FIXME GL3 + #ifdef NL_DEBUG nlassert(supportPerPixelLighting(true)); // make sure the hardware can do that #endif @@ -1350,7 +1159,7 @@ void CDriverGL3::setupPPLPass(uint pass) // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 - activateTexEnvColor(0, _PPLightDiffuseColor); + // activateTexEnvColor(0, _PPLightDiffuseColor); // FIXME GL3 // Stage 1 // alpha = diffuse alpha @@ -1358,7 +1167,7 @@ void CDriverGL3::setupPPLPass(uint pass) // Stage 2 is rgb = SpecularCubeMap * SpecularLightColor + Prec * 1 // alpha = prec alpha - activateTexEnvColor(2, _PPLightSpecularColor); + // activateTexEnvColor(2, _PPLightSpecularColor); // FIXME GL3 } @@ -1373,6 +1182,9 @@ void CDriverGL3::endPPLMultiPass() sint CDriverGL3::beginPPLNoSpecMultiPass() { H_AUTO_OGL(CDriverGL3_beginPPLNoSpecMultiPass) + + //setupBuiltinPrograms(); // FIXME GL3 + #ifdef NL_DEBUG nlassert(supportPerPixelLighting(false)); // make sure the hardware can do that #endif @@ -1407,12 +1219,12 @@ void CDriverGL3::setupPPLNoSpecPass(uint pass) // Stage 0 is rgb = DiffuseCubeMap * LightColor + DiffuseGouraud * 1 (TODO : EnvCombine3) - activateTexEnvColor(0, _PPLightDiffuseColor); + // activateTexEnvColor(0, _PPLightDiffuseColor); // FIXME GL3 // Stage 1 - static CMaterial::CTexEnv env; + /*static CMaterial::CTexEnv env; env.Env.SrcArg1Alpha = CMaterial::Diffuse; - activateTexEnvMode(1, env); + activateTexEnvMode(1, env);*/ // FIXME GL3 } @@ -1444,7 +1256,7 @@ void CDriverGL3::endPPLNoSpecMultiPass() activateTexture(0, mat.getTexture(0)); /// texture environment 0 - setTextureEnvFunction(0, mat); + setTexGenFunction(0, mat); /// texture matrix 0 setupUserTextureMatrix(0, mat); @@ -1501,6 +1313,9 @@ void CDriverGL3::endCausticsMultiPass(const CMaterial &mat) sint CDriverGL3::beginCloudMultiPass () { H_AUTO_OGL(CDriverGL3_beginCloudMultiPass) + + //setupBuiltinPrograms(); // FIXME GL3 + nlassert(_CurrentMaterial->getShader() == CMaterial::Cloud); return 1; } @@ -1528,6 +1343,9 @@ void CDriverGL3::endCloudMultiPass() sint CDriverGL3::beginWaterMultiPass() { H_AUTO_OGL(CDriverGL3_beginWaterMultiPass) + + //setupBuiltinPrograms(); // FIXME GL3 + nlassert(_CurrentMaterial->getShader() == CMaterial::Water); return 1; } diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_program.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_program.cpp index f7c2852fa..bcf3cc97c 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_program.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_program.cpp @@ -629,10 +629,10 @@ void CDriverGL3::generateShaderDesc(CShaderDesc &desc, CMaterial &mat) desc.setLighting(/*enableLights && mat.isLighted() &&*/ m_VPBuiltinCurrent.Lighting); } -bool CDriverGL3::setupBuiltinPrograms(CMaterial &mat) +bool CDriverGL3::setupBuiltinPrograms() { return setupBuiltinVertexProgram() - && setupBuiltinPixelProgram(mat) + && setupBuiltinPixelProgram() && setupUniforms(); } @@ -657,10 +657,12 @@ bool CDriverGL3::setupBuiltinVertexProgram() return true; } -bool CDriverGL3::setupBuiltinPixelProgram(CMaterial &mat) +bool CDriverGL3::setupBuiltinPixelProgram() { if (m_UserPixelProgram) return true; + nlassert(_CurrentMaterial); + CMaterial &mat = *_CurrentMaterial; CMaterialDrvInfosGL3 *matDrv = static_cast((IMaterialDrvInfos *)(mat._MatDrvInfo)); nlassert(matDrv); @@ -680,219 +682,6 @@ bool CDriverGL3::setupBuiltinPixelProgram(CMaterial &mat) // GL3 TODO: Here we set the uniforms of the vertex program! return true; - - -#if 0 - // nlassert(!m_UserVertexProgram); // TEMP - // nlassert(!m_UserPixelProgram); // TEMP - - if (mat.getDynMat() != NULL) - return true; - - // CVertexProgram *vp = NULL; // REMOVED - CPixelProgram *pp = NULL; - SShaderPair sp; - - CShaderDesc desc; - - generateShaderDesc(desc, mat); - - // See if we've already generated and compiled this shader - sp = shaderCache.findShader(desc); - - // Yes we have! - if (!sp.empty()) - { - /*if (m_UserVertexProgram == NULL) - { - if (!activeVertexProgram(sp.vp, true)) - return false; - }*/ - - if (m_UserPixelProgram == NULL) - { - if (!activePixelProgram(sp.pp, true)) - return false; - } - } - // No we need to generate it now - else - { - // std::string vs; - std::string ps; - bool cacheShaders = true; - - shaderGenerator->reset(); - shaderGenerator->setMaterial(&mat); - shaderGenerator->setShaderDesc(&desc); - - // If we don't already have a vertex program attached, we'll generate it now - /* if (m_UserVertexProgram == NULL) - { - shaderGenerator->generateVS(vs); - vp = new CVertexProgram(); - { - IProgram::CSource *src = new IProgram::CSource(); - src->Profile = IProgram::glsl330v; - src->DisplayName = ""; - src->setSource(vs); - vp->addSource(src); - } - - if (!compileVertexProgram(vp)) - { - delete vp; - vp = NULL; - return false; - } - - if (!activeVertexProgram(vp, true)) - { - delete vp; - vp = NULL; - return false; - } - } - else - cacheShaders = false; - */ - - // If we don't already have a pixel program attached, we'll generate it now - if (m_UserPixelProgram == NULL) - { - shaderGenerator->generatePS(ps); - pp = new CPixelProgram(); - { - IProgram::CSource *src = new IProgram::CSource(); - src->Profile = IProgram::glsl330f; - src->DisplayName = ""; - src->setSource(ps); - pp->addSource(src); - } - - if (!compilePixelProgram(pp)) - { - // delete vp; - // vp = NULL; - delete pp; - pp = NULL; - return false; - } - - if (!activePixelProgram(pp, true)) - { - // delete vp; - // vp = NULL; - delete pp; - pp = NULL; - return false; - } - } - else - cacheShaders = false; - - - // If we already have a shader attached we won't cache this shaderpair, since we didn't generate it - if (cacheShaders) - { - sp.vp = NULL; - sp.pp = pp; - desc.setShaders(sp); - shaderCache.cacheShader(desc); - } - } - - return true; -#endif -} - -bool CDriverGL3::setupDynMatProgram(CMaterial& mat, uint pass) -{ - /* - if ((currentProgram.vp != NULL) && (currentProgram.pp != NULL)) - return true; - - CDynMaterial *m = mat.getDynMat(); - const SRenderPass *rp = m->getPass(pass); - std::string shaderRef; - rp->getShaderRef(shaderRef); - - NL3D::CUsrShaderProgram prg; - - if (!usrShaderManager->getShader(shaderRef, &prg)) - return false; - - std::string shaderSource; - std::string log; - std::string name; - - if (currentProgram.vp == NULL) - { - prg.getVP(shaderSource); - prg.getName(name); - - CVertexProgram *vp = new CVertexProgram(); - { - IProgram::CSource *src = new IProgram::CSource(); - src->Profile = IProgram::glsl330v; - src->DisplayName = name; - src->setSource(shaderSource.c_str()); - vp->addSource(src); - } - - if (!compileVertexProgram(vp)) - { - delete vp; - return false; - } - - if (!activeVertexProgram(vp)) - { - delete vp; - return false; - } - - if (currentProgram.dynmatVP != NULL) - delete currentProgram.dynmatVP; - currentProgram.dynmatVP = vp; - - } - - if (currentProgram.pp == NULL) - { - - CPixelProgram *pp = new CPixelProgram(); - - prg.getFP(shaderSource); - { - IProgram::CSource *src = new IProgram::CSource(); - src->Profile = IProgram::glsl330f; - src->DisplayName = name; - src->setSource(shaderSource.c_str()); - pp->addSource(src); - } - - if (!compilePixelProgram(pp)) - { - delete pp; - return false; - } - - if (!activePixelProgram(pp)) - { - delete pp; - return false; - } - - if (currentProgram.dynmatPP != NULL) - delete currentProgram.dynmatPP; - currentProgram.dynmatPP = pp; - - } - - return true; - */ - return false; } bool CDriverGL3::setupUniforms() @@ -1056,27 +845,6 @@ void CDriverGL3::setupUniforms(TProgram program) { nglProgramUniform4f(progId, selfIlluminationId, selfIllumination.R, selfIllumination.G, selfIllumination.B, 0.0f); } - - // Lightmaps have special constants - if (mat.getShader() == CMaterial::Normal - || mat.getShader() == CMaterial::UserColor) - { - for (uint stage = 0; stage < IDRV_MAT_MAXTEXTURES; ++stage) - { - int cl = p->getUniformIndex(CProgramIndex::TName(CProgramIndex::Constant0 + stage)); - if (cl != -1) - { - CRGBA col = mat._TexEnvs[stage].ConstantColor; - GLfloat glCol[4]; - glCol[0] = col.R / 255.0f; - glCol[1] = col.G / 255.0f; - glCol[2] = col.B / 255.0f; - glCol[3] = col.A / 255.0f; - - nglProgramUniform4f(progId, cl, glCol[0], glCol[1], glCol[2], glCol[3]); - } - } - } } void CDriverGL3::setupInitialUniforms(IProgram *program) diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp index a914a7da8..87dc72df1 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_states.cpp @@ -103,6 +103,7 @@ void CDriverGLStates3::forceDefaults(uint nbStages) // FIXME GL3 TEXTUREMODE glDisable(GL_TEXTURE_RECTANGLE); // FIXME GL3 TEXTUREMODE _TextureMode[stage]= TextureDisabled; // FIXME GL3 TEXTUREMODE } + // etc // ActiveTexture current texture to 0. nglActiveTexture(GL_TEXTURE0); diff --git a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp index d1896169e..387e7169c 100644 --- a/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp +++ b/code/nel/src/3d/driver/opengl3/driver_opengl_texture.cpp @@ -1377,7 +1377,7 @@ static const GLenum OperandLUT[4]= { GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SR // This maps the CMaterial::TTexOperator, used for openGL Arg2 setup. static const GLenum InterpolateSrcLUT[8]= { GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_TEXTURE, GL_PREVIOUS_EXT, GL_PRIMARY_COLOR_EXT, GL_CONSTANT_EXT }; - +/* // *************************************************************************** void CDriverGL3::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) { @@ -1385,9 +1385,9 @@ void CDriverGL3::forceActivateTexEnvMode(uint stage, const CMaterial::CTexEnv // cache mgt. _CurrentTexEnv[stage].EnvPacked= env.EnvPacked; // Disable Special tex env f(). - _CurrentTexEnvSpecial[stage]= TexEnvSpecialDisabled; + //_CurrentTexEnvSpecial[stage]= TexEnvSpecialDisabled; } - +*//* // *************************************************************************** void CDriverGL3::activateTexEnvColor(uint stage, NLMISC::CRGBA col) { @@ -1396,8 +1396,8 @@ void CDriverGL3::activateTexEnvColor(uint stage, NLMISC::CRGBA col) { forceActivateTexEnvColor(stage, col); } -} - +}*/ +/* // *************************************************************************** void CDriverGL3::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) { @@ -1408,9 +1408,9 @@ void CDriverGL3::activateTexEnvMode(uint stage, const CMaterial::CTexEnv &env) { forceActivateTexEnvMode(stage, env); } -} - +}*/ +/* // *************************************************************************** void CDriverGL3::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env) { @@ -1420,7 +1420,7 @@ void CDriverGL3::activateTexEnvColor(uint stage, const CMaterial::CTexEnv &env forceActivateTexEnvColor(stage, env); } } - +*/ // *************************************************************************** void CDriverGL3::forceDXTCCompression(bool dxtcComp)