0025703: Visualization - Decrease number of samplers used in ray-tracing mode
[occt.git] / src / OpenGl / OpenGl_Workspace.hxx
index 805d577..5450975 100644 (file)
@@ -184,7 +184,6 @@ public:
                                Image_PixMap&               theImage,
                                const Graphic3d_BufferType& theBufferType);
 
-  void UseTransparency (const Standard_Boolean theFlag);
   Standard_Boolean& UseZBuffer()   { return myUseZBuffer; }
   Standard_Boolean& UseDepthTest() { return myUseDepthTest; }
   Standard_Boolean& UseGLLight()   { return myUseGLLight; }
@@ -197,13 +196,6 @@ public:
 
   const TEL_COLOUR* HighlightColor;
 
-  const OpenGl_Matrix* SetViewMatrix (const OpenGl_Matrix* );
-  const OpenGl_Matrix* SetStructureMatrix (const OpenGl_Matrix*, bool aRevert = false);
-
-  //! Updates current model-view matrix
-  //! replacing it with StructureMatrixT*ViewMatrix from the workspace.
-  const void UpdateModelViewMatrix();
-
   const OpenGl_AspectLine*   SetAspectLine   (const OpenGl_AspectLine*   theAspect);
   const OpenGl_AspectFace*   SetAspectFace   (const OpenGl_AspectFace*   theAspect);
   const OpenGl_AspectMarker* SetAspectMarker (const OpenGl_AspectMarker* theAspect);
@@ -325,6 +317,8 @@ protected:
     OpenGl_RT_uOffsetX,
     OpenGl_RT_uOffsetY,
     OpenGl_RT_uSamples,
+    OpenGl_RT_uWinSizeX,
+    OpenGl_RT_uWinSizeY,
 
     OpenGl_RT_uTextures,
 
@@ -334,30 +328,25 @@ protected:
   //! Defines texture samplers.
   enum ShaderSamplerNames
   {
-    OpenGl_RT_SceneNodeInfoTexture = 0,
-    OpenGl_RT_SceneMinPointTexture = 1,
-    OpenGl_RT_SceneMaxPointTexture = 2,
-
-    OpenGl_RT_ObjectNodeInfoTexture = 3,
-    OpenGl_RT_ObjectMinPointTexture = 4,
-    OpenGl_RT_ObjectMaxPointTexture = 5,
+    OpenGl_RT_SceneNodeInfoTexture  = 0,
+    OpenGl_RT_SceneMinPointTexture  = 1,
+    OpenGl_RT_SceneMaxPointTexture  = 2,
+    OpenGl_RT_SceneTransformTexture = 3,
 
-    OpenGl_RT_GeometryVertexTexture = 6,
-    OpenGl_RT_GeometryNormalTexture = 7,
-    OpenGl_RT_GeometryTexCrdTexture = 8,
-    OpenGl_RT_GeometryTriangTexture = 9,
+    OpenGl_RT_GeometryVertexTexture = 4,
+    OpenGl_RT_GeometryNormalTexture = 5,
+    OpenGl_RT_GeometryTexCrdTexture = 6,
+    OpenGl_RT_GeometryTriangTexture = 7,
 
-    OpenGl_RT_EnvironmentMapTexture = 10,
+    OpenGl_RT_EnvironmentMapTexture = 8,
 
-    OpenGl_RT_RaytraceMaterialTexture = 11,
-    OpenGl_RT_RaytraceLightSrcTexture = 12,
+    OpenGl_RT_RaytraceMaterialTexture = 9,
+    OpenGl_RT_RaytraceLightSrcTexture = 10,
 
-    OpenGl_RT_FSAAInputTexture = 13,
+    OpenGl_RT_FSAAInputTexture = 11,
 
-    OpenGl_RT_SceneTransformTexture = 14,
-
-    OpenGl_RT_OpenGlColorTexture = 15,
-    OpenGl_RT_OpenGlDepthTexture = 16
+    OpenGl_RT_OpenGlColorTexture = 12,
+    OpenGl_RT_OpenGlDepthTexture = 13
   };
 
   //! Tool class for management of shader sources.
@@ -541,6 +530,8 @@ protected: //! @name methods related to ray-tracing
 
   //! Sets uniform state for the given ray-tracing shader program.
   Standard_Boolean SetUniformState (const Graphic3d_CView&        theCView,
+                                    const Standard_Integer        theSizeX,
+                                    const Standard_Integer        theSizeY,
                                     const OpenGl_Vec3*            theOrigins,
                                     const OpenGl_Vec3*            theDirects,
                                     const OpenGl_Mat4&            theUnviewMat,
@@ -602,22 +593,15 @@ protected: //! @name fields related to ray-tracing
   //! OpenGL/GLSL adaptive-AA shader program.
   Handle(OpenGl_ShaderProgram) myPostFSAAProgram;
 
-  //! Texture buffer of data records of high-level BVH nodes.
+  //! Texture buffer of data records of bottom-level BVH nodes.
   Handle(OpenGl_TextureBufferArb) mySceneNodeInfoTexture;
-  //! Texture buffer of minimum points of high-level BVH nodes.
+  //! Texture buffer of minimum points of bottom-level BVH nodes.
   Handle(OpenGl_TextureBufferArb) mySceneMinPointTexture;
-  //! Texture buffer of maximum points of high-level BVH nodes.
+  //! Texture buffer of maximum points of bottom-level BVH nodes.
   Handle(OpenGl_TextureBufferArb) mySceneMaxPointTexture;
   //! Texture buffer of transformations of high-level BVH nodes.
   Handle(OpenGl_TextureBufferArb) mySceneTransformTexture;
 
-  //! Texture buffer of data records of bottom-level BVH nodes.
-  Handle(OpenGl_TextureBufferArb) myObjectNodeInfoTexture;
-  //! Texture buffer of minimum points of bottom-level BVH nodes.
-  Handle(OpenGl_TextureBufferArb) myObjectMinPointTexture;
-  //! Texture buffer of maximum points of bottom-level BVH nodes.
-  Handle(OpenGl_TextureBufferArb) myObjectMaxPointTexture;
-
   //! Texture buffer of vertex coords.
   Handle(OpenGl_TextureBufferArb) myGeometryVertexTexture;
   //! Texture buffer of vertex normals.
@@ -671,7 +655,6 @@ protected: //! @name protected fields
   Standard_Boolean       myTransientDrawToFront; //!< optimization flag for immediate mode (to render directly to the front buffer)
   Standard_Boolean       myBackBufferRestored;
   Standard_Boolean       myIsImmediateDrawn;     //!< flag indicates that immediate mode buffer contains some data
-  Standard_Boolean       myUseTransparency;
   Standard_Boolean       myUseZBuffer;
   Standard_Boolean       myUseDepthTest;
   Standard_Boolean       myUseGLLight;