Toasty Update #6

Published November 12, 2013
Advertisement
So in this update the big change is proper depth ordering, until now the depth of things drawn on screen using the SFMLRenderSystem was based on what order the component was added to the system. The new way just utilises the z component in the entities position property and sorts the vector every update and while may not be that great in my tests has almost no performance loss.

I also changed the render system so that it no longer directly handles the texture caching responsibility and it is now handled by the TextureResourceLoader which it holds, I also plan on doing the same thing with culling and sorting which will sort of work like this:

  • User adds a bunch of render components to some entities, then on every update:
  • RenderSystem request a cull by the assigned CullingMechanism (If one is assigned).
  • RenderSystem requests a sort from the culled components using the SortingMechanism (If one is assigned).
  • RenderSystem draws the culled and sorted vector.

Actually just talking about it I decided to do it, at the moment it just compares the bounds of all components against the current main view every update. I need to come up with a better way to cull objects though, a QuadTree comes to mind, but not sure how to update it I might have to add an isDirty flag to an entity and whenever it's position is changed update that.

So here is culling and sorting working on 7k+ entities:

CulledStuff.PNG

Compared to no culling but sorting:

NoCullSortOnly.png

That's a difference of ~180 FPS!

Pretty good IMO!
Previous Entry Toasty Update #5
Next Entry Toasty Inspiration
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement

Latest Entries

Dimins V2018.2

1840 views

Dimins V2018.1

2352 views

Octree Voxel Planet

3857 views

Toasty Update #9

2288 views

Toasty Update #8

2081 views

Toasty Update #7

2153 views

Toasty Inspiration

2076 views

Toasty Update #6

1873 views

Toasty Update #5

1975 views
Advertisement