diff --git a/code/nel/src/3d/driver/opengl/CMakeLists.txt b/code/nel/src/3d/driver/opengl/CMakeLists.txt index 21d790668..8b5aabeb1 100644 --- a/code/nel/src/3d/driver/opengl/CMakeLists.txt +++ b/code/nel/src/3d/driver/opengl/CMakeLists.txt @@ -30,6 +30,14 @@ ELSE() SET(NLDRV_OGL_LIB "nel_drv_opengl") ENDIF() +# This helps to debug issue 310 +IF(DEBUG_OGL_SPECULAR_FALLBACK) + ADD_DEFINITIONS(-DDEBUG_OGL_SPECULAR_FALLBACK) +ENDIF() +IF(DEBUG_OGL_COMBINE43_DISABLE) + ADD_DEFINITIONS(-DDEBUG_OGL_COMBINE43_DISABLE) +ENDIF() + NL_TARGET_DRIVER(${NLDRV_OGL_LIB} ${SRC}) INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp index 91a2fcab3..d386dd85f 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_extension.cpp @@ -786,7 +786,13 @@ static bool setupNVTextureEnvCombine4(const char *glext) { H_AUTO_OGL(setupNVTextureEnvCombine4); CHECK_EXT("GL_NV_texture_env_combine4"); +#ifdef DEBUG_OGL_COMBINE43_DISABLE + // issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass() + nlwarning("GL_NV_texture_env_combine4 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)"); + return false; +#else return true; +#endif } // ********************************* @@ -802,7 +808,13 @@ static bool setupATITextureEnvCombine3(const char *glext) // #endif CHECK_EXT("GL_ATI_texture_env_combine3"); +#ifdef DEBUG_OGL_COMBINE43_DISABLE + // issue 310: disable extension to debug bug around CDriverGL::setupSpecularPass() + nlwarning("GL_ATI_texture_env_combine3 disabled by request (DEBUG_OGL_COMBINE43_DISABLE)"); + return false; +#else return true; +#endif } // ********************************* diff --git a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp index bf9845103..e28521310 100644 --- a/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp +++ b/code/nel/src/3d/driver/opengl/driver_opengl_material.cpp @@ -1425,6 +1425,11 @@ void CDriverGL::setupSpecularPass(uint pass) } else { +// Disabled because of Intel GPU texture bug (issue 310) +// CMake options to debug +// -DDEBUG_OGL_SPECULAR_FALLBACK=ON enables this +// -DDEBUG_OGL_COMBINE43_DISABLE=ON disables GL_NV_texture_env_combine4/GL_ATI_texture_env_combine3 +#ifdef DEBUG_OGL_SPECULAR_FALLBACK // Multiply texture1 by alpha_texture0 and display with add _DriverGLStates.enableBlend(true); _DriverGLStates.blendFunc(GL_ONE, GL_ONE); @@ -1457,6 +1462,7 @@ void CDriverGL::setupSpecularPass(uint pass) } activateTexEnvMode(1, env); +#endif // DEBUG_OGL_SPECULAR_FALLBACK } } }