mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-03 17:56:21 +03:00
0032110: Visualization, TKOpenGl - allow incomplete PBR on OpenGL ES 2.0 without GL_EXT_shader_texture_lod
textureCube() is now used as fallback when textureCubeLod() is unavailable.
This commit is contained in:
parent
7106e4c8b1
commit
75642c1489
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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"
|
||||
|
Loading…
x
Reference in New Issue
Block a user