0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
authoriko <iko@opencascade.com>
Thu, 20 Jun 2019 06:53:20 +0000 (09:53 +0300)
committerapn <apn@opencascade.com>
Fri, 1 Nov 2019 15:25:28 +0000 (18:25 +0300)
commit67312b7991c945e66d4fa1d3a6f8e02dbabc9b5a
tree076e0feb36e8bfce7355f3884f29d8365548e55b
parentf4a7308f61af6cde23a6380eb8127695b75f4690
0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model

Metallic-Roughness shading model Graphic3d_TOSM_PBR has been implemented.
New materials descriptors Graphic3d_PBRMaterial have been added to Graphic3d_MaterialAspect.
PBR shading model requires OpenGL 3.0+ or OpenGL ES 3.0+ hardware.
Environment cubemap is expected to be provided for realistic look of metallic materials.

occLight_IsHeadlight() now returns bool instead of int.
Avoid using lowp for enumerations to workaround occLight_IsHeadlight()
ignorance on Adreno 308 caused by some GLSL optimizator bugs.

OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures.
OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.
75 files changed:
src/Graphic3d/FILES
src/Graphic3d/Graphic3d_BSDF.cxx
src/Graphic3d/Graphic3d_BSDF.hxx
src/Graphic3d/Graphic3d_CView.hxx
src/Graphic3d/Graphic3d_CubeMap.hxx
src/Graphic3d/Graphic3d_MaterialAspect.cxx
src/Graphic3d/Graphic3d_MaterialAspect.hxx
src/Graphic3d/Graphic3d_PBRMaterial.cxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_PBRMaterial.hxx [new file with mode: 0644]
src/Graphic3d/Graphic3d_RenderingParams.hxx
src/Graphic3d/Graphic3d_ShaderProgram.cxx
src/Graphic3d/Graphic3d_ShaderProgram.hxx
src/Graphic3d/Graphic3d_TextureParams.cxx
src/Graphic3d/Graphic3d_TextureParams.hxx
src/Graphic3d/Graphic3d_TypeOfLimit.hxx
src/Graphic3d/Graphic3d_TypeOfShadingModel.hxx
src/Image/Image_Color.hxx
src/Image/Image_Format.hxx
src/Image/Image_PixMap.cxx
src/Media/Media_Frame.cxx
src/OpenGl/FILES
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_FrameBuffer.cxx
src/OpenGl/OpenGl_GlFunctions.hxx
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_LayerList.cxx
src/OpenGl/OpenGl_Material.hxx
src/OpenGl/OpenGl_PBREnvironment.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_PBREnvironment.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_Sampler.cxx
src/OpenGl/OpenGl_ShaderManager.cxx
src/OpenGl/OpenGl_ShaderManager.hxx
src/OpenGl/OpenGl_ShaderProgram.cxx
src/OpenGl/OpenGl_ShaderProgram.hxx
src/OpenGl/OpenGl_ShaderStates.hxx
src/OpenGl/OpenGl_Texture.cxx
src/OpenGl/OpenGl_Texture.hxx
src/OpenGl/OpenGl_TextureFormat.cxx
src/OpenGl/OpenGl_View.cxx
src/OpenGl/OpenGl_View.hxx
src/OpenGl/OpenGl_View_Redraw.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/Shaders/Declarations.glsl
src/Shaders/DeclarationsImpl.glsl
src/Shaders/FILES
src/Shaders/PBRCookTorrance.glsl [new file with mode: 0644]
src/Shaders/PBRDistribution.glsl [new file with mode: 0644]
src/Shaders/PBREnvBaking.fs [new file with mode: 0644]
src/Shaders/PBREnvBaking.vs [new file with mode: 0644]
src/Shaders/PBRFresnel.glsl [new file with mode: 0644]
src/Shaders/PBRGeometry.glsl [new file with mode: 0644]
src/Shaders/PBRIllumination.glsl [new file with mode: 0644]
src/Shaders/PhongShading.fs
src/Shaders/Shaders_DeclarationsImpl_glsl.pxx
src/Shaders/Shaders_Declarations_glsl.pxx
src/Shaders/Shaders_PBRCookTorrance_glsl.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBRDistribution_glsl.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBREnvBaking_fs.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBREnvBaking_vs.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBRFresnel_glsl.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBRGeometry_glsl.pxx [new file with mode: 0644]
src/Shaders/Shaders_PBRIllumination_glsl.pxx [new file with mode: 0644]
src/Textures/FILES
src/Textures/Textures_EnvLUT.pxx [new file with mode: 0644]
src/V3d/V3d_View.cxx
src/V3d/V3d_View.hxx
src/ViewerTest/ViewerTest.cxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx
src/XCAFDoc/XCAFDoc_VisMaterial.cxx
tests/de_mesh/gltf_read/end
tests/de_mesh/obj_read/end
tests/v3d/glsl/pbr_spheres [new file with mode: 0644]
tests/v3d/materials/pbr1 [new file with mode: 0644]