0027607: Visualization - Implement adaptive screen space sampling in path tracing
authordbp <dbp@opencascade.org>
Wed, 13 Jul 2016 09:19:27 +0000 (12:19 +0300)
committerkgv <kgv@opencascade.com>
Fri, 30 Sep 2016 08:17:10 +0000 (11:17 +0300)
commit3a9b5dc86a1d69f2deaf0f6f2e8b2a8c87668c39
tree6a77797257165fd446993e3e9043cd350dabf911
parent6a24c6ded983e9c29899ccb9454de8868a1c0c12
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.
22 files changed:
samples/tcl/pathtrace.tcl
src/Graphic3d/Graphic3d_RenderingParams.hxx
src/Graphic3d/Graphic3d_TypeOfLimit.hxx
src/OpenGl/FILES
src/OpenGl/OpenGl_Context.cxx
src/OpenGl/OpenGl_Context.hxx
src/OpenGl/OpenGl_GlCore11Fwd.hxx
src/OpenGl/OpenGl_GlFunctions.hxx
src/OpenGl/OpenGl_GraphicDriver.cxx
src/OpenGl/OpenGl_HaltonSampler.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_SceneGeometry.cxx
src/OpenGl/OpenGl_TileSampler.cxx [new file with mode: 0644]
src/OpenGl/OpenGl_TileSampler.hxx [new file with mode: 0644]
src/OpenGl/OpenGl_View.hxx
src/OpenGl/OpenGl_View_Raytrace.cxx
src/OpenGl/OpenGl_View_Redraw.cxx
src/Shaders/Display.fs
src/Shaders/PathtraceBase.fs
src/Shaders/RaytraceBase.fs
src/Shaders/RaytraceRender.fs
src/ViewerTest/ViewerTest_ViewerCommands.cxx
tests/bugs/vis/bug27083