diff --git a/src/OpenGl/OpenGl_Context.cxx b/src/OpenGl/OpenGl_Context.cxx index 7d8713a303..6147eaf0e7 100644 --- a/src/OpenGl/OpenGl_Context.cxx +++ b/src/OpenGl/OpenGl_Context.cxx @@ -3442,7 +3442,7 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile) && arbTexFloat && (IsGlGreaterEqual (3, 0) #if defined(GL_ES_VERSION_2_0) - || CheckExtension ("GL_EXT_shader_texture_lod") + || true // || CheckExtension ("GL_EXT_shader_texture_lod") fallback is used when extension is unavailable #else || (IsGlGreaterEqual (2, 1) && CheckExtension ("GL_EXT_gpu_shader4")) #endif diff --git a/src/OpenGl/OpenGl_ShaderManager.cxx b/src/OpenGl/OpenGl_ShaderManager.cxx index 6843f067f2..6a3653134c 100644 --- a/src/OpenGl/OpenGl_ShaderManager.cxx +++ b/src/OpenGl/OpenGl_ShaderManager.cxx @@ -3206,6 +3206,11 @@ Standard_Boolean OpenGl_ShaderManager::preparePBREnvBakingProgram (Standard_Inte aProgramSrc->SetHeader ("#extension GL_EXT_shader_texture_lod : enable\n" "#define textureCubeLod textureCubeLodEXT"); } + else + { + myContext->PushMessage (GL_DEBUG_SOURCE_APPLICATION, GL_DEBUG_TYPE_PORTABILITY, 0, GL_DEBUG_SEVERITY_MEDIUM, + "Warning: incomplete PBR lighting implementation due to missing OpenGL ES 3.0 or GL_EXT_shader_texture_lod support."); + } #else aProgramSrc->SetHeader ("#version 120"); #endif diff --git a/src/Shaders/Declarations.glsl b/src/Shaders/Declarations.glsl index 8b7fe60f49..333e1172c4 100644 --- a/src/Shaders/Declarations.glsl +++ b/src/Shaders/Declarations.glsl @@ -32,7 +32,11 @@ #define occTexture2D texture2D #define occTexture3D texture3D #define occTextureCube textureCube - #define occTextureCubeLod textureCubeLod + #if !defined(GL_ES) || defined(textureCubeLod) + #define occTextureCubeLod textureCubeLod + #else // fallback + #define occTextureCubeLod(theSampl,theCoord,theLod) textureCube(theSampl,theCoord) + #endif #endif #ifdef GL_ES diff --git a/src/Shaders/Shaders_Declarations_glsl.pxx b/src/Shaders/Shaders_Declarations_glsl.pxx index bd3be98367..8c1adec3f0 100644 --- a/src/Shaders/Shaders_Declarations_glsl.pxx +++ b/src/Shaders/Shaders_Declarations_glsl.pxx @@ -35,7 +35,11 @@ static const char Shaders_Declarations_glsl[] = " #define occTexture2D texture2D\n" " #define occTexture3D texture3D\n" " #define occTextureCube textureCube\n" - " #define occTextureCubeLod textureCubeLod\n" + " #if !defined(GL_ES) || defined(textureCubeLod)\n" + " #define occTextureCubeLod textureCubeLod\n" + " #else // fallback\n" + " #define occTextureCubeLod(theSampl,theCoord,theLod) textureCube(theSampl,theCoord)\n" + " #endif\n" "#endif\n" "\n" "#ifdef GL_ES\n"