diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp index f7fb430ea..453b37227 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_material.cpp @@ -549,6 +549,7 @@ void CDriverGL3::setupPass(uint pass) // All others materials do not require multi pass. default: return; } + } // *************************************************************************** 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 cd6bf959f..da5c1f962 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_program.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_program.cpp @@ -201,33 +201,6 @@ namespace NL3D setUniformMatrix4fv( mvpIndex, 1, false, mat.get() ); } - switch( mat.getShader() ) - { - case CMaterial::Normal: - setupNormalPass(); - break; - - case CMaterial::LightMap: - beginLightMapMultiPass(); - setupLightMapPass( 0 ); - break; - - case CMaterial::Specular: - beginSpecularMultiPass(); - setupSpecularPass( 0 ); - break; - } - - if( !p->validate( log ) ) - { - vp = NULL; - pp = NULL; - delete p; - p = NULL; - nlinfo( "%s", log.c_str() ); - return false; - } - #endif return true; @@ -235,17 +208,6 @@ namespace NL3D void CDriverGL3::releaseProgram() { - switch( _CurrentMaterial->getShader() ) - { - case CMaterial::LightMap: - endLightMapMultiPass(); - break; - - case CMaterial::Specular: - endSpecularMultiPass(); - break; - } - delete p; p = NULL; vp = NULL; diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp index 1ee446e6b..be42c2835 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_vertex.cpp @@ -214,6 +214,10 @@ bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) if ( !setupMaterial(mat) || _LastIB._Values == NULL ) return false; +#ifdef GLSL + setupProgram( mat ); +#endif + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; // render primitives. //============================== @@ -256,10 +260,6 @@ bool CDriverGL3::renderLines(CMaterial& mat, uint32 firstIndex, uint32 nlines) bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris) { -#ifdef GLSL - return renderTriangles2( mat, firstIndex, ntris ); -#endif - H_AUTO_OGL(CDriverGL3_renderTriangles); // update matrix and Light in OpenGL if needed @@ -269,7 +269,9 @@ bool CDriverGL3::renderTriangles(CMaterial& mat, uint32 firstIndex, uint32 ntris if ( !setupMaterial(mat) || _LastIB._Values == NULL ) return false; +#ifdef GLSL setupProgram( mat ); +#endif refreshTexMatrices(); @@ -363,6 +365,10 @@ bool CDriverGL3::renderRawPoints(CMaterial& mat, uint32 startIndex, uint32 numPo if ( !setupMaterial(mat) ) return false; +#ifdef GLSL + setupProgram( mat ); +#endif + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; // render primitives. //============================== @@ -404,6 +410,10 @@ bool CDriverGL3::renderRawLines(CMaterial& mat, uint32 startIndex, uint32 numLin if ( !setupMaterial(mat) ) return false; +#ifdef GLSL + setupProgram( mat ); +#endif + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; // render primitives. //============================== @@ -445,7 +455,9 @@ bool CDriverGL3::renderRawTriangles(CMaterial& mat, uint32 startIndex, uint32 nu if ( !setupMaterial(mat) ) return false; +#ifdef GLSL setupProgram( mat ); +#endif if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; // render primitives. @@ -491,9 +503,11 @@ bool CDriverGL3::renderRawQuads(CMaterial& mat, uint32 startIndex, uint32 numQua if ( !setupMaterial(mat) ) return false; - if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; - +#ifdef GLSL setupProgram( mat ); +#endif + + if (_CurrentVertexBufferHard && _CurrentVertexBufferHard->isInvalid()) return true; const uint32 QUAD_BATCH_SIZE = 2048; static GLshort defaultIndices[QUAD_BATCH_SIZE * 6];