]> OCCT Git - occt.git/commit
0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light...
authorkgv <kgv@opencascade.com>
Mon, 4 Jan 2021 09:17:44 +0000 (12:17 +0300)
committerbugmaster <bugmaster@opencascade.com>
Wed, 13 Jan 2021 14:10:26 +0000 (17:10 +0300)
commitd84e866973bad1be1c92c17371691a2c0d9a9532
tree5771f16b75556998b3a94c3e64721015df9d9ec6
parent37f80e163c6651a5905c91f7e8c84e7dbdeac303
0032039: Visualization, TKOpenGl - implement simple shadow mapping for a direct light source

Graphic3d_CLight::ToCastShadows() - added new property defining if light should cast shadows (ignored by Ray-Tracing).

OpenGl_ShaderManager::stdComputeLighting() now implements shadow mapping for directional lights.
OpenGl_ShaderManager::prepareGeomMainSrc() now handles copying of arrays.
OpenGl_Context::ShadowMapTexUnit() - added property defining an offset for shadow map texture units.
OpenGl_ShadowMap - added new class storing shadow map FBO with parameters.
OpenGl_View::prepareFrameBuffers() - added resizing of shadow map FBOs.
OpenGl_View::Redraw() - added section redrawing scene into shadow map FBOs via OpenGl_View::renderShadowMap() method.

vrenderparams - added new parameters -shadowMapResolution and -shadowMapBias.
33 files changed:
src/Graphic3d/Graphic3d_CLight.cxx
src/Graphic3d/Graphic3d_CLight.hxx
src/Graphic3d/Graphic3d_LightSet.cxx
src/Graphic3d/Graphic3d_LightSet.hxx
src/Graphic3d/Graphic3d_RenderingParams.hxx
src/Graphic3d/Graphic3d_ShaderProgram.cxx
src/Graphic3d/Graphic3d_ShaderProgram.hxx
src/Graphic3d/Graphic3d_TextureUnit.hxx
src/OpenGl/FILES
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_FrameBuffer.hxx
src/OpenGl/OpenGl_FrameStats.cxx
src/OpenGl/OpenGl_LayerList.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_ShadowMap.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_ShadowMap.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_Structure.cxx
src/OpenGl/OpenGl_View.cxx
src/OpenGl/OpenGl_View.hxx
src/Shaders/DirectionalLightShadow.glsl [new file with mode: 0644]
src/Shaders/FILES
src/Shaders/Shaders_DirectionalLightShadow_glsl.pxx [new file with mode: 0644]
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/v3d/grids.list
tests/v3d/shadows/buggy [new file with mode: 0644]
tests/v3d/shadows/dir1 [new file with mode: 0644]
tests/v3d/shadows/dir2 [new file with mode: 0644]
tests/v3d/shadows/dirhead [new file with mode: 0644]