The current implementation is really just for testing and getting something on the screen.
An optimised system should properly sort, group and batch rendering calls whenever possible.
- Implement static renderable as separate components.
- Organise renderables in Quadtree or octree to implement basic culling.
- Extract the renderables into render call like data structures
- Sort the "renderList" entities by shader, buffer, material Z etc..
- Batch static renderables together per sector.
- Test if PHP bottlenecks when frustum culling dynamic entities.
The current implementation is really just for testing and getting something on the screen.
An optimised system should properly sort, group and batch rendering calls whenever possible.