From 6607eb0e56fcbef3790c50f9a7dd9989d1683af7 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 be3218c5..c495e23a 100644 --- a/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp +++ b/scwx-qt/source/scwx/qt/map/radar_product_layer.cpp @@ -262,6 +262,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();