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

0024887: Visualization - revise and extend Raytracing controls

Fix material test case.
Fix ray-tracing test case and sample.
This commit is contained in:
dbp
2014-05-22 18:57:34 +04:00
committed by apn
parent dc9ef964d2
commit bc8c79bbd5
18 changed files with 568 additions and 320 deletions

View File

@@ -363,9 +363,34 @@ protected:
};
//! Default ray-tracing depth.
static const Standard_Integer THE_DEFAULT_RAY_DEPTH = 3;
//! Default size of traversal stack.
static const Standard_Integer THE_DEFAULT_STACK_SIZE = 24;
//! Compile-time ray-tracing parameters.
struct RaytracingParams
{
//! Actual size of traversal stack in shader program.
Standard_Integer StackSize;
//! Actual ray-tracing depth (number of ray bounces).
Standard_Integer TraceDepth;
//! Sets light propagation through transparent media.
Standard_Boolean TransparentShadows;
//! Creates default compile-time ray-tracing parameters.
RaytracingParams()
: StackSize (THE_DEFAULT_STACK_SIZE),
TraceDepth (THE_DEFAULT_RAY_DEPTH),
TransparentShadows (Standard_False)
{
//
}
};
protected: //! @name methods related to ray-tracing
//! Updates 3D scene geometry for ray-tracing.
@@ -444,7 +469,7 @@ protected: //! @name methods related to ray-tracing
Standard_Boolean SafeFailBack (const TCollection_ExtendedString& theMessage);
//! Initializes OpenGL/GLSL shader programs.
Standard_Boolean InitRaytraceResources();
Standard_Boolean InitRaytraceResources (const Graphic3d_CView& theCView);
//! Releases OpenGL/GLSL shader programs.
void ReleaseRaytraceResources();
@@ -493,8 +518,8 @@ protected: //! @name fields related to ray-tracing
//! Scene epsilon to prevent self-intersections.
Standard_ShortReal myRaytraceSceneEpsilon;
//! Actual size of traversal stack in shader program.
Standard_Integer myTraversalStackSize;
//! Compile-time ray-tracing parameters.
RaytracingParams myRaytraceParameters;
//! OpenGL/GLSL source of ray-tracing fragment shader.
ShaderSource myRaytraceShaderSource;