]> OCCT Git - occt-copy.git/commit
0032081: Visualization - WebGL sample errors when run in Safari browser with WebGL 1.0
authorkgv <kgv@opencascade.com>
Tue, 26 Jan 2021 23:32:13 +0000 (02:32 +0300)
committerkgv <kgv@opencascade.com>
Wed, 27 Jan 2021 19:48:49 +0000 (22:48 +0300)
commit92da683b236a85d60bf409568a5bab40b99edc04
treee1b182f1040769d93322ac7ae2a397859c528efd
parent76b5a9baa6665a2f93260eb8cf6cfd5c459c24af
0032081: Visualization - WebGL sample errors when run in Safari browser with WebGL 1.0

Use "#define occLight_Index(theId) 0" hack to allow compiling
a single light source PBR shading program on OpenGL ES 2.0
disallowing non-constant index expressions.

PBR lookup table is now automatically resized to RGBA format
when RG texture format is unsupported (OpenGL ES 2.0).

OpenGl_ShaderManager now allows compiling PBR shaders
using WebGL 1.0 + GL_EXT_shader_texture_lod extension.

PBR IBL baking GLSL program has been redisigned to use
if/else to avoid non-constant index expressions.
Diffuse baking implements packing float values into a temporary RGBA8 texture
as a fallback solution on WebGL 1.0 implementations supporting float textures
but not as FBO render targets.

OpenGl_PBREnvironment now uses GL_FRAMEBUFFER instead of GL_DRAW_FRAMEBUFFER
for compatibility with OpenGL ES 2.0.
19 files changed:
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_PBREnvironment.cxx
src/OpenGl/OpenGl_PBREnvironment.hxx
src/OpenGl/OpenGl_ShaderManager.cxx
src/OpenGl/OpenGl_ShaderManager.hxx
src/OpenGl/OpenGl_Texture.cxx
src/OpenGl/OpenGl_Texture.hxx
src/OpenGl/OpenGl_TextureFormat.cxx
src/OpenGl/OpenGl_TextureFormat.hxx
src/OpenGl/OpenGl_View.cxx
src/Shaders/Declarations.glsl
src/Shaders/DirectionalLightShadow.glsl
src/Shaders/PBREnvBaking.fs
src/Shaders/PBREnvBaking.vs
src/Shaders/Shaders_Declarations_glsl.pxx
src/Shaders/Shaders_DirectionalLightShadow_glsl.pxx
src/Shaders/Shaders_PBREnvBaking_fs.pxx
src/Shaders/Shaders_PBREnvBaking_vs.pxx