Open mvaligursky opened 2 months ago
This issue reminds me a bit of gaussian splats which also have both global (shared) state and per-view state.
In the engine, meshes and materials are assumed identical in all camera views (except for shader pass and matrices) and it would be nice if we had a formal way of creating and updating arbitrary per-view state.
material.getShaderVariant()
without any parameters, and so we don't have access to camera rendering settings (gamma, tone mapping) - Fixed in https://github.com/playcanvas/engine/pull/6804complex property
of the ParticleComponent is changed, it rebuilds entire emitter from scratch. This is not particularly efficient. But what is worse is that if the same property is changed multiple times per frame, the emitter gets rebuilt each time. Ideally the emitter's resources are only destroyed at that point, and lazily recreated insideaddTime
at the start of the next frame. When the resources are destroyed, that includes mesh instance, and component uses the mesh instance to set few properties on it, and so a simple solution does not work. We could perhaps change the MeshInstance API to allow it to be created without mesh and mesh supplied later. Emitter would then keep the meshInstance permanently, allowing the component to set its properties.Ideally: