From 902a35de4b715ce2df136e555f2f4e034719769f Mon Sep 17 00:00:00 2001 From: Dan Paulat Date: Thu, 3 Aug 2023 22:40:20 -0500 Subject: [PATCH] Fix transparency in color table layer and radar product layer --- scwx-qt/source/scwx/qt/map/color_table_layer.cpp | 3 +++ scwx-qt/source/scwx/qt/map/radar_product_layer.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp index 3b0d89e4..f6181b5c 100644 --- a/scwx-qt/source/scwx/qt/map/color_table_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/color_table_layer.cpp @@ -134,6 +134,9 @@ void ColorTableLayer::Render( p->shaderProgram_->Use(); + // Set OpenGL blend mode for transparency + gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + gl.glUniformMatrix4fv( p->uMVPMatrixLocation_, 1, GL_FALSE, glm::value_ptr(projection)); diff --git a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp index 710ca3d6..8fb2bbde 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -264,6 +264,9 @@ void RadarProductLayer::Render( p->shaderProgram_->Use(); + // Set OpenGL blend mode for transparency + gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + if (p->colorTableNeedsUpdate_) { UpdateColorTable();