Current approach has a lot of overhead and boilerplate. New approach:
Add a Rendered component that gets added to an entity when it is added to a scene
Create a new EntityRendererSync system that subscribes to ECS events and removes entities from scenes when their Rendered component gets removed. See the GenericDrawableSystem for what needs to be done in there
Add a new path to scene object removal for above system to call into in order to not create cycles/deadlocks when entities are removed by events. Current path should remove component, new path should not
Move default pipelines to DrawableBase component as virtual methods
Remove GenericDrawableSystem and all instantiations
TBD: Should scene add be done by:
Create Rendered component and ECS subscriber does scene add
Call into scene and the scene creates the Rendered component
Some other approach?
Overall idea is twofold:
Remove the need for more than one system to sync objects to scenes
Simplify the creation of new renderable components to simply creating the component itself and providing a draw command
Current approach has a lot of overhead and boilerplate. New approach:
Rendered
component that gets added to an entity when it is added to a sceneEntityRendererSync
system that subscribes to ECS events and removes entities from scenes when theirRendered
component gets removed. See theGenericDrawableSystem
for what needs to be done in thereDrawableBase
component as virtual methodsGenericDrawableSystem
and all instantiationsRendered
component and ECS subscriber does scene addRendered
componentOverall idea is twofold: