DiscussionsIssue archiveOCCT:Visualization

Archived issue #0031597

Visualization, TKOpenGl - allow disabling Alpha component writes within OpenGl_Context::ColorMask()

Open CASCADEOCCT:Visualizationclosed7 public notes

Search issues

Description

Current 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

Public activity

7 archived notes

Participants are labeled by their role within this record.

01Commenter 3
Branch [archived branch] has been created by Author.

[revision removed]


Detailed log of new commits:

Author: Author
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.
02Commenter 3
Branch [archived branch] has been updated forcibly by Author.

[revision removed]
03Author
Patch is ready for review
- OCCT branch: [archived branch]

http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31597-master-KGV/
04Commenter 4
The patch was reviewed without remarks
05Commenter 1
Combination -
OCCT branch : [archived branch]
master SHA - [revision removed]
[revision removed]
Products branch : [archived branch] SHA - [revision removed]
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
06Commenter 3
Branch [archived branch] has been deleted by Participant.

[revision removed]
07Author
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 records