1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-29 14:00:49 +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

@@ -157,6 +157,9 @@ OpenGl_Context::OpenGl_Context (const Handle(OpenGl_Caps)& theCaps)
myIsInitialized (Standard_False),
myIsStereoBuffers (Standard_False),
myIsGlNormalizeEnabled (Standard_False),
myHasRayTracing (Standard_False),
myHasRayTracingTextures (Standard_False),
myHasRayTracingAdaptiveSampling (Standard_False),
#if !defined(GL_ES_VERSION_2_0)
myPointSpriteOrig (GL_UPPER_LEFT),
myRenderMode (GL_RENDER),
@@ -2302,6 +2305,20 @@ void OpenGl_Context::init (const Standard_Boolean theIsCoreProfile)
arbTBO = (OpenGl_ArbTBO* )(&(*myFuncs));
arbIns = (OpenGl_ArbIns* )(&(*myFuncs));
// check whether ray tracing mode is supported
myHasRayTracing = has31
&& arbTboRGB32
&& arbFBOBlit != NULL;
// check whether textures in ray tracing mode are supported
myHasRayTracingTextures = myHasRayTracing
&& arbTexBindless != NULL;
// check whether adaptive screen sampling in ray tracing mode is supported
myHasRayTracingAdaptiveSampling = myHasRayTracing
&& has44
&& CheckExtension ("GL_NV_shader_atomic_float");
if (!has32)
{
checkWrongVersion (3, 2);