1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-09-18 14:27:39 +03:00

0026571: Visualization, TKOpenGl - write depth values within RayTracing program

View-projection matrix was added to raytrace shaders (as uniform) in order to compute correct depth values for OpenGL.
For path tracing the additional depth buffer sampler was added to Display.fs program. It allows propagation of depth values from internal FBO to resulting FBO.
The old approach of mixing of OpenGL and ray-tracing graphics was kept in order to keep correct blending of transparent ray-traced objects with non-transparent OpenGL objects.
This commit is contained in:
duv
2016-02-29 17:11:34 +03:00
committed by abv
parent 251a79847b
commit 1d8656890c
5 changed files with 83 additions and 15 deletions

View File

@@ -653,6 +653,7 @@ protected: //! @name data types related to ray-tracing
OpenGl_RT_uDirectLB,
OpenGl_RT_uDirectRT,
OpenGl_RT_uDirectRB,
OpenGl_RT_uViewMat,
OpenGl_RT_uUnviewMat,
// 3D scene params
@@ -705,9 +706,10 @@ protected: //! @name data types related to ray-tracing
OpenGl_RT_FsaaInputTexture = 11,
OpenGl_RT_PrevAccumTexture = 12,
OpenGl_RT_DepthTexture = 13,
OpenGl_RT_OpenGlColorTexture = 13,
OpenGl_RT_OpenGlDepthTexture = 14
OpenGl_RT_OpenGlColorTexture = 14,
OpenGl_RT_OpenGlDepthTexture = 15
};
//! Tool class for management of shader sources.
@@ -939,6 +941,7 @@ protected: //! @name methods related to ray-tracing
const OpenGl_Mat4& theViewMapping,
OpenGl_Vec3* theOrigins,
OpenGl_Vec3* theDirects,
OpenGl_Mat4& theView,
OpenGl_Mat4& theUnView);
//! Binds ray-trace textures to corresponding texture units.
@@ -950,6 +953,7 @@ protected: //! @name methods related to ray-tracing
//! Sets uniform state for the given ray-tracing shader program.
Standard_Boolean setUniformState (const OpenGl_Vec3* theOrigins,
const OpenGl_Vec3* theDirects,
const OpenGl_Mat4& theViewMat,
const OpenGl_Mat4& theUnviewMat,
const Standard_Integer theProgramId,
const Handle(OpenGl_Context)& theGlContext);
@@ -959,6 +963,7 @@ protected: //! @name methods related to ray-tracing
const Standard_Integer theSizeY,
const OpenGl_Vec3* theOrigins,
const OpenGl_Vec3* theDirects,
const OpenGl_Mat4& theViewMat,
const OpenGl_Mat4& theUnviewMat,
Graphic3d_Camera::Projection theProjection,
OpenGl_FrameBuffer* theReadDrawFbo,