View Issue Details

IDProjectCategoryView StatusLast Update
0032403CommunityOCCT:Visualizationpublic2023-03-19 21:56
ReporterVico Liang Assigned Tovpozdyayev 
PrioritynormalSeverityminor 
Status closedResolutionfixed 
Product Version7.5.0 
Target Version7.6.0Fixed in Version7.6.0 
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 numberNot required

Attached Files

  • white-background-raytracing.jpg (195,179 bytes)
  • black-background-raytracing.jpg (275,657 bytes)

Relationships

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

Activities

Vico Liang

2021-05-31 10:00

developer  

white-background-raytracing.jpg (195,179 bytes)

Vico Liang

2021-05-31 10:00

developer  

black-background-raytracing.jpg (275,657 bytes)

kgv

2021-06-15 16:26

developer   ~0101843

Have you tried enabling option OpenGl_Caps::buffersOpaqueAlpha=true (within up-to-date OCCT development branch)?

kgv

2021-06-15 16:29

developer   ~0101844

> 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.

Vico Liang

2021-06-15 18:15

developer   ~0101847

Last edited: 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.

kgv

2021-06-15 19:26

developer   ~0101849

Great!

kgv

2021-06-15 19:26

developer   ~0101850

Dear bugmaster,

please close the issue.

Vico Liang

2021-06-16 08:16

developer   ~0101856

Last edited: 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.

kgv

2021-06-16 09:33

developer   ~0101857

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...

Vico Liang

2021-06-16 09:58

developer   ~0101858

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.

git

2021-08-25 10:56

administrator   ~0103427

Branch CR32403 has been created by kgv.

SHA-1: 9dc7445799283c7ebc6601da6a0d0f7f29746ea5


Detailed log of new commits:

Author: kgv
Date: Wed Aug 25 10:55:38 2021 +0300

    0032403: Visualization - RayTracing renders all object as white color in view with white background
    
    OpenGl_Caps::buffersOpaqueAlpha is now set to TRUE by default.

git

2021-08-25 12:26

administrator   ~0103431

Branch CR32403 has been updated forcibly by kgv.

SHA-1: 0d5ae38ffe9e44f5be7b685683fd459bc3aeb349

kgv

2021-08-25 13:57

developer   ~0103435

Please raise the patch
- OCCT: branch CR32403;
- OCC Products: branch CR32403.

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR32403-CR32403-KGV/

bugmaster

2021-08-28 15:43

administrator   ~0103472

Combination -
OCCT branch : IR-2021-08-27
master SHA - 8f70959571ab8999b47f88d673343587e733f364
a87b7ddc8cb44606b91e3f37113847c3f5f50fdc
Products branch : IR-2021-08-27 SHA - 71e8b69563894a6e7348c9bd5b0294a5e5e8fe3f
was compiled on Linux, MacOS and Windows platforms and tested in optimize mode.

Number of compiler warnings:
No new/fixed warnings

Regressions/Differences/Improvements:
No regressions/differences

CPU differences:
Debian80-64:
OCCT
Total CPU difference: 17432.060000000307 / 17364.750000000335 [+0.39%]
Products
Total CPU difference: 11534.270000000102 / 11550.27000000011 [-0.14%]
Windows-64-VC14:
OCCT
Total CPU difference: 19189.15625 / 19243.171875 [-0.28%]
Products
Total CPU difference: 12874.53125 / 12885.734375 [-0.09%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2021-08-28 16:00

administrator   ~0103486

Branch CR32403 has been deleted by mnt.

SHA-1: 0d5ae38ffe9e44f5be7b685683fd459bc3aeb349

Related Changesets

occt: master 8a77384b

2021-08-25 07:55:38

kgv


Committer: bugmaster Details Diff
0032403: Visualization - RayTracing renders all object as white color in view with white background

OpenGl_Caps::buffersOpaqueAlpha is now set to TRUE by default.
OpenGl_View::runPathtrace - fixed higlighting with PathTracing turned on and buffersOpaqueAlpha=true.
Affected Issues
0032403
mod - src/OpenGl/OpenGl_Caps.cxx Diff File
mod - src/OpenGl/OpenGl_Caps.hxx Diff File
mod - src/OpenGl/OpenGl_View_Raytrace.cxx Diff File
mod - tests/vselect/bugs/bug26726 Diff File

occt-products: master 71e8b695

2021-08-25 12:40:51

kgv


Committer: bugmaster Details Diff
0032403: Visualization - RayTracing renders all object as white color in view with white background

VolumeRender_RaytraceRenderer::ExtractSlice() now temporarily enables alpha writes.
Affected Issues
0032403
mod - diff Diff File
mod - tests/pmivis/import/duplicate Diff File

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
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
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
2021-06-16 08:25 Vico Liang Note Edited: 0101856
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
2021-08-25 10:56 git Note Added: 0103427
2021-08-25 12:26 git Note Added: 0103431
2021-08-25 13:57 kgv Note Added: 0103435
2021-08-25 13:57 kgv Assigned To kgv => bugmaster
2021-08-25 13:57 kgv Status assigned => resolved
2021-08-25 13:57 kgv Status resolved => reviewed
2021-08-28 15:43 bugmaster Note Added: 0103472
2021-08-28 15:43 bugmaster Status reviewed => tested
2021-08-28 15:45 bugmaster Test case number => Not required
2021-08-28 15:51 bugmaster Changeset attached => occt master 8a77384b
2021-08-28 15:51 bugmaster Status tested => verified
2021-08-28 15:51 bugmaster Resolution no change required => fixed
2021-08-28 16:00 git Note Added: 0103486
2021-12-17 18:41 bugmaster Changeset attached => occt-products master 71e8b695
2021-12-17 18:41 kgv Assigned To bugmaster => kgv
2021-12-17 18:41 kgv Status closed => verified
2022-10-19 15:50 smoskvin Assigned To kgv => vpozdyayev
2023-03-19 21:56 vglukhik Status verified => closed