playcanvas / engine

Powerful web graphics runtime built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.72k stars 1.36k forks source link

Outline renderer robustness #7047

Open MAG-AdrianMeredith opened 1 month ago

MAG-AdrianMeredith commented 1 month ago

Description

When combining the new Outline Renderer with an LOD system there is a race condition that cause it to get out of sync leave a "zombie" mesh in the outline layer that cannot be removed. This occurs as a result of showing/hiding at the same time as modifying the outliner. When calling removeEntity() it attempts to only remove the currently visible meshinstances which in this case have changed since it was added.

https://github.com/user-attachments/assets/86aa75eb-6207-470e-b976-c0b68ceddfd8

Steps to Reproduce

  1. add an animated model to outline
  2. change mesh visibility
  3. remove the outline
MAG-AdrianMeredith commented 1 month ago

Fix incoming, just a matter of ensuring all meshInstances are removed when calling removeEntity (not just the visible ones)

mvaligursky commented 3 days ago

@MAG-AdrianMeredith - any update on the PR with the fix?

MAG-AdrianMeredith commented 3 days ago

Somewhere, I did a fix on our fork just need to port it over will have a look tomorrow or if you're desperate for it you can find it here https://github.com/magnopus/playcanvas-engine/commit/f5ca71a07b2d3929fcdbde2fafa85ad5d20ce542