Closed cruseDD closed 2 months ago
I could create a PR but it seems i am lacking permissions to create a branch.
To submit a PR you need to fork the repository and create the branch from your fork.
Thanks. I have added a minimal PR.
Thank you! Merged.
osgEarth Version (required): 3.4, maybe also master
What is the problem? We are using shared ImageLayer with Rex and a custom shader effect to render a gloss effect. When removing the gloss layer, the sampler bindings seem to remain and can interfere with other rendering passes.
The problem seems to come from RexTerrainEngineNode::removeImageLayer where binding usage is cleared, and the unit is unassigned. However, the binding keeps its sourceUID. However, when purging orphaned layers PurgeOrphanedLayers::apply, the method TileNode::refreshSharedSamplers is called which in turn does:
if (bindings[i].isActive() == false) { _renderModel.clearSharedSampler(i); }
isActive returns true, as long as the sourceUID is assigned and thus the sampler is not cleared.
How have you tried to resolve it?
I suggest to make RexTerrainEngineNode::removeImageLayer also unassign the sourceUID