Archived issue #0031597
Visualization, TKOpenGl - allow disabling Alpha component writes within OpenGl_Context::ColorMask()
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.
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.
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.
[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.
Branch [archived branch] has been updated forcibly by Author.
[revision removed]
[revision removed]
Patch is ready for review
- OCCT branch: [archived branch]
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31597-master-KGV/
- OCCT branch: [archived branch]
http://jenkins-test-12.nnov.opencascade.com:8080/view/CR31597-master-KGV/
The patch was reviewed without remarks
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
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
Branch [archived branch] has been deleted by Participant.
[revision removed]
[revision removed]
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
https://www.khronos.org/registry/EGL/extensions/EXT/EGL_EXT_present_opaque.txt
Related records
- #0031581 · related to · newVisualization, Graphic3d - add dedicated structure defining rasterization Pipeline parameters
- #0031964 · related to · newVisualization, TKOpenGl - add option to disable background color filling for external render buffer
- #0032113 · parent of · closedVisualization, TKOpenGl - broken PBR diffuse map within OpenGl_Caps::buffersOpaqueAlpha() on OpenGL ES 2.0
- #0032301 · parent of · closedVisualization, TKOpenGl - depth peeling is broken with OpenGl_Caps::buffersOpaqueAlpha option
- #0031988 · related to · closedVisualization - use Quantity_ColorRGBA as background rather than Quantity_Color to support alpha channel
- #0032077 · related to · assignedVisualization - setting custom default frame buffer object for OpenGl context