diff --git a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h index a12d81a68..eae913fe7 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl.h +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl.h @@ -379,6 +379,7 @@ public: static inline void setupCausticsSecondTex(uint stage);*/ virtual bool setupMaterial(CMaterial& mat); + void generateShaderDesc(CShaderDesc &desc, CMaterial &mat); bool setupProgram(CMaterial& mat); void setupUniforms(CMaterial& mat); void releaseProgram(); 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 791fe8149..205c6110f 100644 --- a/code/nel/src/3d/driver/OpenGL3/driver_opengl_program.cpp +++ b/code/nel/src/3d/driver/OpenGL3/driver_opengl_program.cpp @@ -148,11 +148,8 @@ namespace NL3D static IProgramObject *p; - bool CDriverGL3::setupProgram( CMaterial &mat ) + void CDriverGL3::generateShaderDesc( CShaderDesc &desc, CMaterial &mat ) { - -#ifdef GLSL - CShaderDesc desc; desc.setShaderType( mat.getShader() ); desc.setVBFlags( _CurrentVertexBufferHard->VB->getVertexFormat() ); @@ -171,6 +168,16 @@ namespace NL3D desc.setAlphaTest( mat.getAlphaTest() ); desc.setAlphaTestThreshold( mat.getAlphaTestThreshold() ); + } + + + bool CDriverGL3::setupProgram( CMaterial &mat ) + { + +#ifdef GLSL + CShaderDesc desc; + + generateShaderDesc( desc, mat ); p = shaderCache.findShader( desc );