Which are set by various engine systems to inform it that some parts need to be updated - which is an optimization allowing most of the updates to be skipped each frame.
When multiple layer compositions are used at the same time (main scene with the lightmapper or the picker), those dirty flags are consumed and reset by the first composition that updates, and other compositions end up not being updated correctly. This manifests itself in various ways:
when LayerComposition.Update returns flags indicating lights where updated, lit shaders should be recreated - but they do not. This created an issue in https://github.com/playcanvas/engine/pull/2838 engine example and shader rebuild had to be manually triggered by app.scene.updateLitShaders = true;
When blend mode on a material is changes, composition needs to re-sort objects into opaque and transparent lists. This only happens on the first composition that updates.
Layer composition stores dirty flags:
https://github.com/playcanvas/engine/blob/8b86603a6a489ff383e3049dfb9a31f55cbe2b0d/src/scene/composition/layer-composition.js#L66-L69
Which are set by various engine systems to inform it that some parts need to be updated - which is an optimization allowing most of the updates to be skipped each frame.
When multiple layer compositions are used at the same time (main scene with the lightmapper or the picker), those dirty flags are consumed and reset by the first composition that updates, and other compositions end up not being updated correctly. This manifests itself in various ways:
app.scene.updateLitShaders = true;