mirror of
https://github.com/ciphervance/supercell-wx.git
synced 2025-10-30 15:10:06 +00:00
Make sure shared uniforms are updated correctly per-map pane
- Broken by shaders being shared between map panes
This commit is contained in:
parent
f08a7d9a8d
commit
68fcecdc15
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue