Hello SunBurn community!
You've asked to hear more about upcoming features and updates, and to get a behind the scenes look at the SunBurn Game Engine's development. We thought this was an excellent idea, so a couple of us are starting development journals to talk about the new things we're working on and how they can be used in your projects.
With the SunBurn 2.0.11 update right around the corner there are a lot of exciting new features and enhancement coming up, but to kickoff my development journal I want to talk about the new scenegraph optimizations which are available in the release.
Background
When we originally developed SunBurn's scenegraph the goal was a lightweight system focused on retrieving objects as quickly as possible. While the system was not very sophisticated – it only determined an object's containment in the search bounds using spatial partitioning (with tighter filtering performed by the caller – eg: the ObjectManager or LightManager) – it was decently fast.
Since then we've continued to enhance and optimize the scenegraph, we've exposed the core spatial partitioning for use in SunBurn games (via the ObjectGraph class), and added new methods like FindFast() for even faster though less accurate retrieval.
However the core design remained relatively unchanged, and we felt there was a lot of room for improvement. The port to XNA 4.0 also introduced performance issues related to the CLR runtime. In most scenes the performance differences were not noticeable, however in large complex scenes (thousands of individual objects) they did add up.
We decided rework the scenegraph in SunBurn 2.0.11 to be faster, more intelligent, and to avoid any performance issues related to the CLR runtime.
Optimizations
My first task was to create an overkill scene that would stress the scenegraph and help identify any performance issues. I put together a quick city scene using building models found on TurboSquid and procedurally placed them in code.
The scene contains 10,000 individual scene objects, with 250 – 300 visible at a time (a total of 2,000 – 2,200 rendered meshes per frame), dynamic lighting / shadows, and HDR.

Initially the performance was poor and only pushed 7 fps on the Xbox. Profiling showed that while the CLR was a big factor, the scenegraph itself was also performing more work than necessary.
To speed things up I:
- Made the scenegraph more intelligent – node recursion and tests to determine if node objects are in the search bounds, were reduced around 50%
- Manager Find() methods now perform object-type filtering on the resultset returned from the scenegraph – no more intermediate results
- Changed ObjectManager to store SceneEntity and derived objects instead of ISceneEntity (likewise LightManager now stores BaseLight and derived objects) – side effect of the CLR changes
- Adjusted all managers to use the most optimal Find() overload when querying objects and lights – as an example the CollisionManager now runs faster by using the “slower” Find() method (instead of FindFast()) as it returns much fewer objects
With these optimizations SunBurn is now able to push the city scene between 23 – 20 frames per second on the Xbox!
That's a considerable performance increase. :) Even better the optimizations improved performance across the entire engine, including SunBurn's collision system, rendering, and shadow generation.
For 99% of SunBurn users these changes are transparent and everything will continue working as normal, only faster. :)
However some people may notice the differences, which are:
- Results from Find() methods may contain null entries
- Objects stored in the ObjectManager must derive from SceneEntity, SceneObject, or one of their descendents
- Lights stored in the LightManager must derive from BaseLight or one of its descendents
Lots of Awesome!
There are still a ton of great new features and enhancements to talk about, including some amazing editor UI updates. :)
So stay tuned for more development journals from our team!
-John Kabus
Other SunBurn 2.0 Blogs:
Announcing the SunBurn 2.0 Game Engine - free upgrade, new editions, and updated features
SunBurn 2.0 Collisions, Scenegraph, and Components - new collision system, components, and more
SunBurn 2.0 upgrade for our Torque customers - upgrade path for all of our previous TLK technology customers
SunBurn 2.0 goes Mobile on Windows Phone 7! - full Windows Phone 7 support, light mapping, and more
Holiday, Components, and more! - read about the new components and more
SunBurn 2.0: components, perfabs, and more! - more details about SunBurn's new component system
Festive SunBurn 2.0 Starter Kits, yum, yum! - first release of the new SunBurn Starter kit
SunBurn 2.0.10 update available - streamlined user experience and integrated starter kits

Posted
01-27-2011 6:36 PM
by
JohnK "bobthecbuilder"