}
//! Checks if scene contains textured objects.
- Standard_Integer HasTextures() const
+ Standard_Boolean HasTextures() const
{
return !myTextures.IsEmpty();
}
//! Actual ray-tracing depth (number of ray bounces).
Standard_Integer NbBounces;
- //! Sets light propagation through transparent media.
+ //! Enables/disables light propagation through transparent media.
Standard_Boolean TransparentShadows;
+ //! Enables/disables the use of OpenGL bindless textures.
+ Standard_Boolean UseBindlessTextures;
+
//! Creates default compile-time ray-tracing parameters.
RaytracingParams()
: StackSize (THE_DEFAULT_STACK_SIZE),
NbBounces (THE_DEFAULT_NB_BOUNCES),
- TransparentShadows (Standard_False)
+ TransparentShadows (Standard_False),
+ UseBindlessTextures (Standard_False)
{
//
}
aPrefixString += TCollection_AsciiString ("\n#define TRANSPARENT_SHADOWS");
}
- // If OpenGL driver supports bindless textures,
- // activate texturing in ray-tracing mode
- if (theGlContext->arbTexBindless != NULL)
+ // If OpenGL driver supports bindless textures and texturing
+ // is actually used, activate texturing in ray-tracing mode
+ if (myRaytraceParameters.UseBindlessTextures && theGlContext->arbTexBindless != NULL)
{
aPrefixString += TCollection_AsciiString ("\n#define USE_TEXTURES") +
TCollection_AsciiString ("\n#define MAX_TEX_NUMBER ") + TCollection_AsciiString (OpenGl_RaytraceGeometry::MAX_TEX_NUMBER);
aToRebuildShaders = Standard_True;
}
+ if (myRaytraceGeometry.HasTextures() != myRaytraceParameters.UseBindlessTextures)
+ {
+ myRaytraceParameters.UseBindlessTextures = myRaytraceGeometry.HasTextures();
+ aToRebuildShaders = Standard_True;
+ }
+
if (theCView.RenderParams.IsTransparentShadowEnabled != myRaytraceParameters.TransparentShadows)
{
myRaytraceParameters.TransparentShadows = theCView.RenderParams.IsTransparentShadowEnabled;