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

0027607: Visualization - Implement adaptive screen space sampling in path tracing

This commit provides useful functionality for path tracing rendering core.

1) Graphic3d_RenderingParams class was extended with additional AdaptiveScreenSampling option (disabled by default).
   If this option is enabled, path tracing tries to adjust the number of samples for different screen areas.

   In this way, the more complex areas (from the point of light conditions) are sampled more intensively,
   while the simple areas are sampled very rarely.
   For example, caustics and glossy reflections are typical candidates for more precise sampling.

   In general, this allows to equalize image convergence and not to waste resources for already converged areas.
   It is also possible to visualize sampling densities by enabling ShowSamplingTiles option
   (activating and deactivating this option does not affect on the accumulated image).

2) Mixing OpenGL and ray-tracing output has been changed.
   Now blending is performed using OpenGL functionality, while ray-tracing shaders only output correct Z-value.

Test case bugs vis bug27083 has been updated,
since the alpha value is now correctly set by Ray-Tracing to 1, opaque.
This commit is contained in:
dbp
2016-07-13 12:19:27 +03:00
committed by kgv
parent 6a24c6ded9
commit 3a9b5dc86a
22 changed files with 1303 additions and 378 deletions

View File

@@ -61,6 +61,8 @@ public:
IsTransparentShadowEnabled (Standard_False),
UseEnvironmentMapBackground (Standard_False),
CoherentPathTracingMode (Standard_False),
AdaptiveScreenSampling (Standard_False),
ShowSamplingTiles (Standard_False),
// stereoscopic parameters
StereoMode (Graphic3d_StereoMode_QuadBuffer),
AnaglyphFilter (Anaglyph_RedCyan_Optimized),
@@ -99,6 +101,8 @@ public:
Standard_Boolean IsTransparentShadowEnabled; //!< enables/disables light propagation through transparent media, False by default
Standard_Boolean UseEnvironmentMapBackground; //!< enables/disables environment map background
Standard_Boolean CoherentPathTracingMode; //!< enables/disables 'coherent' tracing mode (single RNG seed within 16x16 image blocks)
Standard_Boolean AdaptiveScreenSampling; //!< enables/disables adaptive screen sampling mode for path tracing, FALSE by default
Standard_Boolean ShowSamplingTiles; //!< enables/disables debug mode for adaptive screen sampling, FALSE by default
Graphic3d_StereoMode StereoMode; //!< stereoscopic output mode, Graphic3d_StereoMode_QuadBuffer by default
Anaglyph AnaglyphFilter; //!< filter for anaglyph output, Anaglyph_RedCyan_Optimized by default

View File

@@ -17,12 +17,15 @@
//! Type of graphic resource limit.
enum Graphic3d_TypeOfLimit
{
Graphic3d_TypeOfLimit_MaxNbLights, //!< maximum number of active light sources
Graphic3d_TypeOfLimit_MaxNbClipPlanes, //!< maximum number of active clipping planes
Graphic3d_TypeOfLimit_MaxNbViews, //!< maximum number of views
Graphic3d_TypeOfLimit_MaxTextureSize, //!< maximum size of texture
Graphic3d_TypeOfLimit_MaxMsaa, //!< maximum number of MSAA samples
Graphic3d_TypeOfLimit_NB //!< number of elements in this enumeration
Graphic3d_TypeOfLimit_MaxNbLights, //!< maximum number of active light sources
Graphic3d_TypeOfLimit_MaxNbClipPlanes, //!< maximum number of active clipping planes
Graphic3d_TypeOfLimit_MaxNbViews, //!< maximum number of views
Graphic3d_TypeOfLimit_MaxTextureSize, //!< maximum size of texture
Graphic3d_TypeOfLimit_MaxMsaa, //!< maximum number of MSAA samples
Graphic3d_TypeOfLimit_HasRayTracing, //!< indicates whether ray tracing is supported
Graphic3d_TypeOfLimit_HasRayTracingTextures, //!< indicates whether ray tracing textures are supported
Graphic3d_TypeOfLimit_HasRayTracingAdaptiveSampling, //!< indicates whether adaptive screen sampling is supported
Graphic3d_TypeOfLimit_NB //!< number of elements in this enumeration
};
#endif // _Graphic3d_TypeOfLimit_HeaderFile