0028180: Visualization, TKOpenGl - Performance of Shaded presentation dropped due...
authorkgv <kgv@opencascade.com>
Thu, 22 Dec 2016 09:48:16 +0000 (12:48 +0300)
committerkgv <kgv@opencascade.com>
Thu, 22 Dec 2016 14:24:05 +0000 (17:24 +0300)
commit8613985b2a2fdac0ac1ee9e3166c760c1a3d2e8d
treed6b702beaedbc9a18813b4f77811a3fe342b2108
parentdecdee7d3f49efb1290e181fe60418955f78ba42
0028180: Visualization, TKOpenGl - Performance of Shaded presentation dropped due to FFP disabled by default

FFP state management (light sources, matrices, clipping planes) has been
moved to OpenGl_ShaderManager for consistency with Programmable Pipeline.

OpenGl_Context::BindProgram() does not re-bind already active Program.
OpenGl_PrimitiveArray::Render() does not reset active Program at the end.

OpenGl_Context::ApplyModelViewMatrix() now checks if matrix differs
from already set one before modifying state in Shader Manager.
This allows avoing redundant state changes, matrix uploads onto GPU
and re-computation of inversed matrices.

NCollection_Mat4 has been extended with equality check operators for proper comparison.

OpenGl_ShaderManager - the tracking Material state has been added.
Removed unreachable states OPENGL_NS_RESMAT, OPENGL_NS_TEXTURE and OPENGL_NS_WHITEBACK.

Fixed resetting FFP material state after displaying GL_COLOR_ARRAY vertices;
the Material state within Shader Manager is now
invalidated within OpenGl_VertexBuffer::unbindFixedColor().

OpenGl_Workspace::ApplyAspectFace() - fixed invalidating Material State
when only Highlighting style is changing.
28 files changed:
src/NCollection/NCollection_Mat4.hxx
src/NCollection/NCollection_Vec2.hxx
src/NCollection/NCollection_Vec3.hxx
src/NCollection/NCollection_Vec4.hxx
src/OpenGl/FILES
src/OpenGl/OpenGl_Clipping.cxx
src/OpenGl/OpenGl_Clipping.hxx
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_Material.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_MaterialState.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_NamedStatus.hxx
src/OpenGl/OpenGl_PrimitiveArray.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.cxx
src/OpenGl/OpenGl_ShaderStates.hxx
src/OpenGl/OpenGl_Structure.cxx
src/OpenGl/OpenGl_Text.cxx
src/OpenGl/OpenGl_VertexBuffer.cxx
src/OpenGl/OpenGl_VertexBuffer.hxx
src/OpenGl/OpenGl_VertexBuffer.lxx
src/OpenGl/OpenGl_View_Redraw.cxx
src/OpenGl/OpenGl_Workspace.cxx
src/OpenGl/OpenGl_Workspace.hxx
src/ViewerTest/ViewerTest_OpenGlCommands.cxx