MantisBT
Mantis Bug Tracker Workflow

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0032403Community[OCCT] OCCT:Visualizationpublic2021-05-31 10:002021-06-16 09:58
ReporterVico Liang 
Assigned Tokgv 
PrioritynormalSeverityminor 
StatusassignedResolutionno change required 
PlatformOSOS Version
Product Version[OCCT] 7.5.0 
Target Version[OCCT] 7.6.0*Fixed in Version 
Summary0032403: Visualization - RayTracing renders all object as white color in view with white background
DescriptionTest with package OCCT7.5.2 on android device.
The result looks great in view with black background.
The render result with other background are diffrerent too.
Please see detail pictures.

    // Rendering options setting
    Graphic3d_RenderingParams& aParams = occtView->ChangeRenderingParams(); // specifies rendering mode
    aParams.Method = Graphic3d_RM_RAYTRACING; // maximum ray-tracing depth
    aParams.RaytracingDepth = 3; // enable shadows rendering
    aParams.IsShadowEnabled = true; // enable specular reflections.
    aParams.IsReflectionEnabled = true; // enable adaptive anti-aliasing
    aParams.IsAntialiasingEnabled = true; // enable light propagation through transparent media.
    aParams.IsTransparentShadowEnabled = true;
    aParams.NbMsaaSamples = 2;
TagsNo tags attached.
Test case number
Attached Filesjpg file icon white-background-raytracing.jpg (195,179 bytes) 2021-05-31 10:00
jpg file icon black-background-raytracing.jpg (275,657 bytes) 2021-05-31 10:00

- Relationships
related to 0027898newdbp Open CASCADE Visualization, Ray Tracing - Use OpenGL background drawing subroutines in ray tracing 
related to 0032302verifiedbugmaster Open CASCADE Visualization, TKOpenGles - do not use window buffer by default 
child of 0031196verifiedbugmaster Community Visualization, TKOpenGl - enable Ray-Tracing using OpenGL ES 3.2 

-  Notes
(0101843)
kgv (developer)
2021-06-15 16:26

Have you tried enabling option OpenGl_Caps::buffersOpaqueAlpha=true (within up-to-date OCCT development branch)?
(0101844)
kgv (developer)
2021-06-15 16:29

> Test with package OCCT7.5.2 on android device
I guess you are taking about OCCT 7.6.0dev branch, as 0031196 is not included into OCCT 7.5.2.
(0101847)
Vico Liang (developer)
2021-06-15 18:15
edited on: 2021-06-15 18:20

I might use the latest OCCT 7.6dev branch.

I tried to use this flag: OpenGl_Caps::buffersOpaqueAlpha=true, the result is correct. Looks great.

So congratulation! You have identified the problem.

(0101849)
kgv (developer)
2021-06-15 19:26

Great!
(0101850)
kgv (developer)
2021-06-15 19:26

Dear bugmaster,

please close the issue.
(0101856)
Vico Liang (developer)
2021-06-16 08:16
edited on: 2021-06-16 08:25

Dear Kirill,

why not working when OpenGl_Caps::buffersOpaqueAlpha=false? Do you think we must set OpenGl_Caps::buffersOpaqueAlpha=true when using RayTracing? If this is the case, the document should be updated to explain this. Otherwise, this should be an issue need to be fixed.

(0101857)
kgv (developer)
2021-06-16 09:33

Dear Vico,

the current handling of background in Ray-Tracing engine is hackish - it is not fully consistent with non-Ray-Tracing engine.
So, indeed, there is some issue with Ray-Tracing engine writing alpha zero values for pixels.

There is already a dedicated issue 0027898 for improving this aspect in Ray-Tracing engine, but as it has a low priority (and tricky to implement), so far nobody works on it.

Practically speaking, user almost never want using OpenGl_Caps::buffersOpaqueAlpha=false, but in most cases it just doesn't matter - save rare window setups blending RGBA with system background.
So probably it worth changing OpenGl_Caps::buffersOpaqueAlpha=true by default...
(0101858)
Vico Liang (developer)
2021-06-16 09:58

Dear Kirill,

Thanks for detialed explanation. So this can be closed if there is already a dedicated issue. We should not dependent on the default value, we can set it on application side.

- Issue History
Date Modified Username Field Change
2021-05-31 10:00 Vico Liang New Issue
2021-05-31 10:00 Vico Liang Assigned To => kgv
2021-05-31 10:00 Vico Liang File Added: white-background-raytracing.jpg
2021-05-31 10:00 Vico Liang File Added: black-background-raytracing.jpg
2021-05-31 10:03 Vico Liang Description Updated View Revisions
2021-05-31 10:14 kgv Product Version => 7.5.0
2021-05-31 10:14 kgv Target Version 7.5.2 => 7.6.0*
2021-05-31 10:14 kgv Summary raytracing render all object as white color in view with white background => Visualization - RayTracing renders all object as white color in view with white background
2021-06-15 16:26 kgv Note Added: 0101843
2021-06-15 16:27 kgv Relationship added child of 0031196
2021-06-15 16:29 kgv Note Added: 0101844
2021-06-15 18:15 Vico Liang Note Added: 0101847
2021-06-15 18:20 Vico Liang Note Edited: 0101847 View Revisions
2021-06-15 19:26 kgv Note Added: 0101849
2021-06-15 19:26 kgv Note Added: 0101850
2021-06-15 19:26 kgv Assigned To kgv => bugmaster
2021-06-15 19:26 kgv Status new => feedback
2021-06-15 19:26 kgv Resolution open => no change required
2021-06-16 08:16 Vico Liang Note Added: 0101856
2021-06-16 08:18 Vico Liang Note Edited: 0101856 View Revisions
2021-06-16 08:25 Vico Liang Note Edited: 0101856 View Revisions
2021-06-16 09:22 kgv Relationship added related to 0027898
2021-06-16 09:24 kgv Relationship added related to 0032302
2021-06-16 09:33 kgv Note Added: 0101857
2021-06-16 09:33 kgv Assigned To bugmaster => kgv
2021-06-16 09:33 kgv Status feedback => assigned
2021-06-16 09:58 Vico Liang Note Added: 0101858


Copyright © 2000 - 2021 MantisBT Team
Powered by Mantis Bugtracker