Archived issue #0031225
Visualization, TKOpenGl - support cubemap for environment texture within Ray-Tracing
Description
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).
It is desired supporting Cubemaps within Ray-Tracing engine as well (for IBL and as background).
Steps to reproduce
v3d/raytrace/pbr_spheres
Public activity
30 archived notes
Participants are labeled by their role within this record.
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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: Commenter 3
Date: Fri Dec 13 13:30:36 2019 +0300
remarks from kgv
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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: Commenter 3
Date: Fri Dec 13 13:30:36 2019 +0300
remarks from kgv
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
The patch CR31225 is ready to review
- 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.
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
The patch CR31225 is ready to review
Branch [archived branch] has been created by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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
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).
New variable just duplicates existing uSphereMapEnabled.
Please use single variable.
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;
> }
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;
> }
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
The patch CR31225 is ready to review
Branch [archived branch] has been updated by Commenter 3.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Tue Dec 24 15:39:55 2019 +0300
replaced textureCube() with texture()
[revision removed]
Detailed log of new commits:
Author: Commenter 3
Date: Tue Dec 24 15:39:55 2019 +0300
replaced textureCube() with texture()
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Commenter 3.
[revision removed]
[revision removed]
Branch [archived branch] has been created by Author.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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.
[revision removed]
Detailed log of new commits:
Author: Commenter 3
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.
Remarks have been pushed to CR31225_3.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
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.
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
Related records
- #0031279 · related to · closedVisualization, TKOpenGl - environment background is misplaced within Ray-Tracing
- #0031584 · related to · newVisualization, TKOpenGl - support cubemap Ambient lighting within Graphic3d_TOSM_FRAGMENT shading
- #0031129 · child of · newVisualization - revise background / environment API