View Issue Details

IDProjectCategoryView StatusLast Update
0031597Open CASCADEOCCT:Visualizationpublic2021-09-22 17:29
Reporterkgv Assigned Tobugmaster  
PrioritynormalSeverityfeature 
Status closedResolutionfixed 
Target Version7.6.0Fixed in Version7.6.0 
Summary0031597: Visualization, TKOpenGl - allow disabling Alpha component writes within OpenGl_Context::ColorMask()
DescriptionCurrent implementation of OpenGl_Context::ColorMask() property allows enabling/disabling writes into all color components at once.

This is enough for most scenarios, however in some cases it is desired disabling writes into Alpha color component individually - to prevent unexpected blending of render target flushed by external compositor. This happens, for example, in case of WebGL canvas, and cannot be trivially disabled by canvas flags.
Steps To Reproduce
set aTexImg "t.png"
pload MODELING VISUALIZATION
box b 1 2 3
vclear
vinit View1
vdisplay -dispMode 1 b
vaspects b -shadingModel UNLIT -setColor GREEN -transparency 0.5
vtop
vfit
vdump $aTexImg -width 512 -height 512 -buffer rgba
vclear
vdisplay -dispMode 1 b
vaxo
vfit
vtexture b $aTexImg
vaspects b -alphaMode blend

TagsNo tags attached.
Test case numberNot required

Attached Files

  • bug31597_transp.png (3,808 bytes)
  • bug31597_opaque.png (4,335 bytes)
  • bug31597_textransp.png (2,226 bytes)
  • bug31597_texopaque.png (1,901 bytes)

Relationships

related to 0031581 newvpozdyayev Open CASCADE Visualization, Graphic3d - add dedicated structure defining rasterization Pipeline parameters 
related to 0031964 newvpozdyayev Community Visualization, TKOpenGl - add option to disable background color filling for external render buffer 
parent of 0032113 closedbugmaster Open CASCADE Visualization, TKOpenGl - broken PBR diffuse map within OpenGl_Caps::buffersOpaqueAlpha() on OpenGL ES 2.0 
parent of 0032301 closedbugmaster Open CASCADE Visualization, TKOpenGl - depth peeling is broken with OpenGl_Caps::buffersOpaqueAlpha option 
related to 0031988 closedbugmaster Community Visualization - use Quantity_ColorRGBA as background rather than Quantity_Color to support alpha channel 
related to 0032077 assignednds Open CASCADE Visualization - setting custom default frame buffer object for OpenGl context 

Activities

git

2020-12-12 13:08

administrator   ~0097528

Branch CR31597 has been created by kgv.

SHA-1: d2b8ae445d028f713eb89d6539b93e428eff5c1f


Detailed log of new commits:

Author: kgv
Date: Sat Dec 12 12:24:50 2020 +0300

    0031597: Visualization, TKOpenGl - allow disabling Alpha component writes within OpenGl_Context::ColorMask()
    
    Added OpenGl_Caps::buffersOpaqueAlpha option allowing to disable writes
    into alpha component of color buffer and keep it opaque.
    Added OpenGl_Context::SetColorMaskRGBA() method overriding each color component deliberately.

kgv

2020-12-12 13:09

developer  

bug31597_transp.png (3,808 bytes)

kgv

2020-12-12 13:09

developer  

bug31597_opaque.png (4,335 bytes)

kgv

2020-12-12 13:09

developer  

bug31597_textransp.png (2,226 bytes)

kgv

2020-12-12 13:10

developer  

bug31597_texopaque.png (1,901 bytes)

git

2020-12-12 14:00

administrator   ~0097551

Branch CR31597 has been updated forcibly by kgv.

SHA-1: 901610f1eb3885572c9ccef8e7cc3e9879614fc6

kgv

2020-12-12 22:12

developer   ~0097556

Patch is ready for review
- OCCT branch: CR31597.

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

osa

2020-12-14 11:05

developer   ~0097565

The patch was reviewed without remarks

bugmaster

2020-12-19 14:48

administrator   ~0097737

Combination -
OCCT branch : IR-2020-12-18
master SHA - 04114fd201c20efe9fbe85f00bec9a99ae3747ad
a206de37fbfa0bf71bd534ae47192bbec23b8522
Products branch : IR-2020-12-18 SHA - 290e5c74e8fef71947cadf90acb8e43c81ed10a1
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: 17709.570000000054 / 17744.450000000124 [-0.20%]
Products
Total CPU difference: 12258.480000000121 / 12330.210000000125 [-0.58%]
Windows-64-VC14:
OCCT
Total CPU difference: 19272.796875 / 19429.1875 [-0.80%]
Products
Total CPU difference: 13712.859375 / 13755.5 [-0.31%]


Image differences :
No differences that require special attention

Memory differences :
No differences that require special attention

git

2020-12-19 15:23

administrator   ~0097785

Branch CR31597 has been deleted by inv.

SHA-1: 901610f1eb3885572c9ccef8e7cc3e9879614fc6

kgv

2021-09-22 17:28

developer   ~0104291

Last edited: 2021-09-22 17:29

Funny that Linux developers have decided to implement EGL_EXT_present_opaque extension for similar issue, as Wayland treats alpha channel in window backbuffer for blending.
https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_present_opaque.txt

Related Changesets

occt: master 31174e1a

2020-12-12 09:24:50

kgv


Committer: bugmaster Details Diff
0031597: Visualization, TKOpenGl - allow disabling Alpha component writes within OpenGl_Context::ColorMask()

Added OpenGl_Caps::buffersOpaqueAlpha option allowing to disable writes
into alpha component of color buffer and keep it opaque.
Added OpenGl_Context::SetColorMaskRGBA() method overriding each color component deliberately.

New option is set within WebGL sample.
Affected Issues
0031597
mod - samples/webgl/WasmOcctView.cpp Diff File
mod - src/OpenGl/OpenGl_Caps.cxx Diff File
mod - src/OpenGl/OpenGl_Caps.hxx Diff File
mod - src/OpenGl/OpenGl_Context.cxx Diff File
mod - src/OpenGl/OpenGl_Context.hxx Diff File
mod - src/OpenGl/OpenGl_LayerList.cxx Diff File
mod - src/OpenGl/OpenGl_View_Redraw.cxx Diff File
mod - src/ViewerTest/ViewerTest_ViewerCommands.cxx Diff File

Issue History

Date Modified Username Field Change
2020-06-03 20:48 kgv New Issue
2020-06-03 20:48 kgv Assigned To => kgv
2020-06-03 20:48 kgv Relationship added related to 0031581
2020-09-21 17:42 kgv Target Version 7.5.0 => 7.6.0
2020-12-09 11:11 kgv Relationship added related to 0031988
2020-12-12 11:58 kgv Steps to Reproduce Updated
2020-12-12 12:05 kgv Steps to Reproduce Updated
2020-12-12 13:08 git Note Added: 0097528
2020-12-12 13:09 kgv File Added: bug31597_transp.png
2020-12-12 13:09 kgv File Added: bug31597_opaque.png
2020-12-12 13:09 kgv File Added: bug31597_textransp.png
2020-12-12 13:10 kgv File Added: bug31597_texopaque.png
2020-12-12 14:00 git Note Added: 0097551
2020-12-12 22:12 kgv Note Added: 0097556
2020-12-12 22:12 kgv Assigned To kgv => osa
2020-12-12 22:12 kgv Status new => resolved
2020-12-14 11:05 osa Note Added: 0097565
2020-12-14 11:05 osa Assigned To osa => bugmaster
2020-12-14 11:05 osa Status resolved => reviewed
2020-12-19 14:48 bugmaster Note Added: 0097737
2020-12-19 14:48 bugmaster Status reviewed => tested
2020-12-19 14:52 bugmaster Test case number => Not required
2020-12-19 15:06 bugmaster Changeset attached => occt master 31174e1a
2020-12-19 15:06 bugmaster Status tested => verified
2020-12-19 15:06 bugmaster Resolution open => fixed
2020-12-19 15:23 git Note Added: 0097785
2020-12-21 15:18 kgv Relationship added related to 0031964
2021-02-02 16:59 kgv Relationship added related to 0032077
2021-02-02 23:03 kgv Relationship added parent of 0032113
2021-04-15 16:40 kgv Relationship added parent of 0032301
2021-09-22 17:28 kgv Note Added: 0104291
2021-09-22 17:29 kgv Note Edited: 0104291