MantisBT - Open CASCADE
View Issue Details
0031225Open CASCADE[OCCT] OCCT:Visualizationpublic2019-12-06 10:332020-05-27 23:25
kgv 
bugmaster 
normalminor 
verifiedfixed 
 
[OCCT] 7.5.0 
v3d/raytrace/pbr_spheres
0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
Currently environment Cubemaps are supported only by PBR renderer.
It is desired supporting Cubemaps within Ray-Tracing engine as well (for IBL and as background).
v3d/raytrace/pbr_spheres
No tags attached.
related to 0031279verified bugmaster Visualization, TKOpenGl - environment background is misplaced within Ray-Tracing 
related to 0031584new kgv Visualization, TKOpenGl - support cubemap Ambient lighting within Graphic3d_TOSM_FRAGMENT shading 
child of 0031129new kgv Visualization - revise background / environment API 
Issue History
2019-12-06 10:33kgvNew Issue
2019-12-06 10:33kgvAssigned To => mzernova
2019-12-06 10:33kgvRelationship addedchild of 0031129
2019-12-06 10:34kgvSummaryVisualization, TKOpenGl - support cubemap for environment texture with Ray-Tracing => Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
2019-12-13 12:01gitNote Added: 0089488
2019-12-13 13:37gitNote Added: 0089496
2019-12-13 13:37gitNote Added: 0089497
2019-12-13 13:38mzernovaNote Added: 0089498
2019-12-13 13:38mzernovaAssigned Tomzernova => kgv
2019-12-13 13:38mzernovaStatusnew => resolved
2019-12-13 13:38mzernovaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22339#r22339
2019-12-13 14:09kgvNote Added: 0089499
2019-12-13 14:10kgvAssigned Tokgv => mzernova
2019-12-13 14:10kgvStatusresolved => assigned
2019-12-13 14:11kgvNote Edited: 0089499bug_revision_view_page.php?bugnote_id=89499#r22341
2019-12-16 13:21gitNote Added: 0089565
2019-12-16 13:21gitNote Added: 0089566
2019-12-16 15:16mzernovaNote Added: 0089570
2019-12-16 15:16mzernovaNote Added: 0089571
2019-12-16 15:16mzernovaAssigned Tomzernova => kgv
2019-12-16 15:16mzernovaStatusassigned => resolved
2019-12-16 16:19gitNote Added: 0089577
2019-12-16 16:25kgvNote Added: 0089578
2019-12-16 16:25kgvAssigned Tokgv => mzernova
2019-12-16 16:25kgvStatusresolved => assigned
2019-12-24 14:11gitNote Added: 0089734
2019-12-24 14:11gitNote Added: 0089735
2019-12-24 14:11gitNote Added: 0089737
2019-12-24 14:13mzernovaNote Added: 0089738
2019-12-24 14:13mzernovaAssigned Tomzernova => kgv
2019-12-24 14:13mzernovaStatusassigned => resolved
2019-12-24 14:13mzernovaSteps to Reproduce Updatedbug_revision_view_page.php?rev_id=22405#r22405
2019-12-24 15:46gitNote Added: 0089741
2019-12-24 15:47gitNote Added: 0089742
2019-12-24 15:47gitNote Added: 0089743
2019-12-26 13:45gitNote Added: 0089777
2019-12-26 13:53kgvRelationship addedrelated to 0031279
2019-12-26 14:28kgvNote Added: 0089778
2019-12-26 16:11gitNote Added: 0089780
2019-12-26 16:13gitNote Added: 0089781
2019-12-26 17:50gitNote Added: 0089782
2019-12-26 20:05gitNote Added: 0089783
2019-12-26 20:15kgvNote Added: 0089784
2019-12-26 21:26kgvNote Added: 0089785
2019-12-26 21:26kgvAssigned Tokgv => bugmaster
2019-12-26 21:26kgvStatusresolved => reviewed
2019-12-27 16:17bugmasterTest case number => v3d/raytrace/pbr_spheres
2019-12-28 13:37bugmasterChangeset attached => occt master 89d855ba
2019-12-28 13:37bugmasterStatusreviewed => verified
2019-12-28 13:37bugmasterResolutionopen => fixed
2019-12-28 15:23gitNote Added: 0089797
2019-12-28 15:23gitNote Added: 0089799
2019-12-28 15:23gitNote Added: 0089800
2019-12-28 15:24gitNote Added: 0089801
2020-05-27 23:25kgvRelationship addedrelated to 0031584

Notes
(0089488)
git   
2019-12-13 12:01   
Branch CR31225 has been created by mzernova.

SHA-1: 885e56ead2c9b423e7e00fae4f862db6b709c0ca


Detailed log of new commits:

Author: mzernova
Date: Fri Dec 13 11:55:50 2019 +0300

    0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
    
    Added supporting environment Cubemaps within Ray-Tracing engine for IBL and as background
(0089496)
git   
2019-12-13 13:37   
Branch CR31225_1 has been created by mzernova.

SHA-1: 5e9f4a3b728c0029b270f691cfd86344f9283069


Detailed log of new commits:

Author: mzernova
Date: Fri Dec 13 11:55:50 2019 +0300

    0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
    
    Added supporting environment Cubemaps within Ray-Tracing engine for IBL and as background

Author: mzernova
Date: Fri Dec 13 13:30:36 2019 +0300

    remarks from kgv
(0089497)
git   
2019-12-13 13:37   
Branch CR31225 has been updated forcibly by mzernova.

SHA-1: 3e01549c66bf9aaf831d4e9241754371de206dd4
(0089498)
mzernova   
2019-12-13 13:38   
The patch CR31225 is ready to review
(0089499)
kgv   
2019-12-13 14:09   
(edited on: 2019-12-13 14:11)
-    if (theDepth + uSphereMapForBack == 0) // view ray and map is hidden
+    if (bool(uCubemapForBack))
+    {
+      aTotalRadiance = textureCube (uRaytraceCubemapTexture, cubemapVectorTransform (theRay.Direct, 
uYCoeff, uZCoeff)).rgb;
+    }
+    else if (theDepth + uSphereMapForBack == 0) // view ray and map is hidden

It is expected that FetchEnvironment() function will be updated instead.

+//! Environment cubemap texture.
+uniform samplerCube uRaytraceCubemapTexture;
...
//! Environment map texture.
uniform sampler2D uEnvironmentMapTexture;

Please use #ifdef for switching between CubeMap and Spherical panorama images instead of defining both of them at once.
Please use the same variable name with different sampler type (samplerCube / sampler2D) basing on macros.

(0089565)
git   
2019-12-16 13:21   
Branch CR31225_1 has been updated forcibly by mzernova.

SHA-1: bd792cfd78f9c08e5b9daadc09f0356528c1d096
(0089566)
git   
2019-12-16 13:21   
Branch CR31225 has been updated forcibly by mzernova.

SHA-1: 293d77682c6ca9bcf3b092191c363958dc4508d5
(0089570)
mzernova   
2019-12-16 15:16   
http://vm-jenkins-test-12.nnov.opencascade.com:8080/view/CR31225-master-mzernova [^]
(0089571)
mzernova   
2019-12-16 15:16   
The patch CR31225 is ready to review
(0089577)
git   
2019-12-16 16:19   
Branch CR31225_2 has been created by mzernova.

SHA-1: ac2a253c2198ae3e52c88f4a46a86e0545d8e385


Detailed log of new commits:

Author: mzernova
Date: Fri Dec 13 11:55:50 2019 +0300

    0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
    
    Added supporting environment Cubemaps within Ray-Tracing engine for IBL and as background
(0089578)
kgv   
2019-12-16 16:25   
Test case is missing for the new feature.
New test can be based on v3d/glsl/pbr_spheres using vrenderparams -gi mode for the same scene (to be put into v3d/raytrace/pbr_spheres).

+//! Enables/disables cubemap background.
+uniform int uCubemapForBack;

New variable just duplicates existing uSphereMapEnabled.
Please use single variable.

+  if (myBackgroundType == Graphic3d_TOB_CUBEMAP)
+  {
+    aPrefixString += TCollection_AsciiString("\n#define BACKGROUND_CUBEMAP");
+  }

As this parameter requires GLSL program re-compilation, it should be tracked within OpenGl_View::initRaytraceResources() to set aToRebuildShaders on change:
> if (myRenderParams.ToneMappingMethod != myRaytraceParameters.ToneMappingMethod)
> {
> myRaytraceParameters.ToneMappingMethod = myRenderParams.ToneMappingMethod;
> aToRebuildShaders = true;
> }
(0089734)
git   
2019-12-24 14:11   
Branch CR31225 has been updated forcibly by mzernova.

SHA-1: c6d52110850b007fbaeb5262771d09d97beafdcd
(0089735)
git   
2019-12-24 14:11   
Branch CR31225_1 has been updated forcibly by mzernova.

SHA-1: ba3d9237a3a207295cf11063357ed4214a529def
(0089737)
git   
2019-12-24 14:11   
Branch CR31225_2 has been updated forcibly by mzernova.

SHA-1: 7de342bd7addb2fa0461dd2007fd333903c40236
(0089738)
mzernova   
2019-12-24 14:13   
The patch CR31225 is ready to review
(0089741)
git   
2019-12-24 15:46   
Branch CR31225_1 has been updated by mzernova.

SHA-1: 05d76336c8bc7eaebe61f6d4e047661735212d77


Detailed log of new commits:

Author: mzernova
Date: Tue Dec 24 15:39:55 2019 +0300

    replaced textureCube() with texture()

(0089742)
git   
2019-12-24 15:47   
Branch CR31225 has been updated forcibly by mzernova.

SHA-1: 849754f400ec7d254363f30fb0962abce0bf5b06
(0089743)
git   
2019-12-24 15:47   
Branch CR31225_2 has been updated forcibly by mzernova.

SHA-1: 08ef1f0f19835d769620c203a0bdeba192758012
(0089777)
git   
2019-12-26 13:45   
Branch CR31225_3 has been created by kgv.

SHA-1: d216f5f1e50eea11bfed8913580e33181ddaa687


Detailed log of new commits:

Author: mzernova
Date: Fri Dec 13 11:55:50 2019 +0300

    0031225: Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
    
    Ray-Tracing now handles IBL and background cubemaps in similar way as PBR.
    Ambient light source is handled by Ray-Tracing in similar way as PBR,
    e.g. as coefficient for environment map (IBL) or as constant light source.
    
    Test script generating PBR spheres has been moved to Samples
    and now shared by PBR and Path-Tracing tests.
(0089778)
kgv   
2019-12-26 14:28   
Remarks have been pushed to CR31225_3.
(0089780)
git   
2019-12-26 16:11   
Branch CR31225_3 has been updated forcibly by kgv.

SHA-1: 0fa4979ee6a6b99ad8db645d55033b7f010de50a
(0089781)
git   
2019-12-26 16:13   
Branch CR31225_3 has been updated forcibly by kgv.

SHA-1: 07d3c8b40885810458f3a3f04a4b9b9b2b64ee25
(0089782)
git   
2019-12-26 17:50   
Branch CR31225_3 has been updated forcibly by kgv.

SHA-1: 59e418b0ceca2860f4c4ce7caa1994f52074c952
(0089783)
git   
2019-12-26 20:05   
Branch CR31225_3 has been updated forcibly by kgv.

SHA-1: 71c879af7315b8b5f2ad170da8d3ce485dd75eca
(0089784)
kgv   
2019-12-26 20:15   
texture() from cubemap within FetchEnvironment() produced visual artifacts (visible boundaries of cube), so that it was replaced by textureLod(), which was already used for texture lookup from sphere.
(0089785)
kgv   
2019-12-26 21:26   
Please raise the patch.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31225_3-master-KGV/ [^]
(0089797)
git   
2019-12-28 15:23   
Branch CR31225_3 has been deleted by inv.

SHA-1: 71c879af7315b8b5f2ad170da8d3ce485dd75eca
(0089799)
git   
2019-12-28 15:23   
Branch CR31225_1 has been deleted by inv.

SHA-1: 05d76336c8bc7eaebe61f6d4e047661735212d77
(0089800)
git   
2019-12-28 15:23   
Branch CR31225_2 has been deleted by inv.

SHA-1: 08ef1f0f19835d769620c203a0bdeba192758012
(0089801)
git   
2019-12-28 15:24   
Branch CR31225 has been deleted by inv.

SHA-1: 849754f400ec7d254363f30fb0962abce0bf5b06