Merge pull request #447 from dpaulat/hotfix/bad-radar-color-tables

Make sure shared uniforms are updated correctly per-map pane
This commit is contained in:
Dan Paulat 2025-05-17 19:05:26 -05:00 committed by GitHub
commit 38d36d37f6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -58,6 +58,9 @@ public:
bool cfpEnabled_ {false};
std::uint16_t rangeMin_ {0};
float scale_ {1.0f};
bool colorTableNeedsUpdate_ {false};
bool sweepNeedsUpdate_ {false};
};
@ -298,6 +301,9 @@ void RadarProductLayer::Render(
gl.glUniform1i(p->uCFPEnabledLocation_, p->cfpEnabled_ ? 1 : 0);
gl.glUniform1ui(p->uDataMomentOffsetLocation_, p->rangeMin_);
gl.glUniform1f(p->uDataMomentScaleLocation_, p->scale_);
gl.glActiveTexture(GL_TEXTURE0);
gl.glBindTexture(GL_TEXTURE_1D, p->texture_);
gl.glBindVertexArray(p->vao_);
@ -553,8 +559,8 @@ void RadarProductLayer::UpdateColorTable(
colorTable.data());
gl.glGenerateMipmap(GL_TEXTURE_1D);
gl.glUniform1ui(p->uDataMomentOffsetLocation_, rangeMin);
gl.glUniform1f(p->uDataMomentScaleLocation_, scale);
p->rangeMin_ = rangeMin;
p->scale_ = scale;
}
} // namespace scwx::qt::map