After just 4 hours of dedicated optimizations with the aid of the EQATEC profiler for Silverlight – I managed to speed up the rendering pipeline of Balder quite dramatically. The profiler has a great comparison feature – simple and straight to the point. It shows that the rendering pipeline for Balder got optimized at an average og 2.28 times. (RenderingManagerRender) :
Category Archives: Optimizing
Upcoming Balder release – 0.8.8.6
Its been crazy weeks since I decided to pull 0.8.8.5, but it was for the better. The result is that the rendering speed and quality has gone up quite dramatically. The next version of Balder will be 0.8.8.6 and will contain at least the following:
– Optimized framebuffer management
– Optimized drawing/rendering
– Optimized lighting
– Proper polygon clipping against the viewport
– Completely refactored way of handling objects, no duplication in the type hierarchy for Balder, like in 0.8.8.0.
– New controls : NodesControl, NodesStack – similar as Canvas and StackPanel works with 2D elements in Silverlight
– New geometry types; Box, Cylinder, Plane
– Transparency for objects / materials
– Introducing the concept of View, you can now create custom cameras
– DebugLevel is no longer flag-based, but a self contained object with properties for all Debug options
– Rendering is now synchronously – gives better framerate in most scenarios, but hogs up rendering event. Ongoing process.
Its been crazy since december with a lot of work being put into Balder and more to come. I don't have a date yet for when I'll have the release, but I'll try to push it as soon as I'm content with the result.
.net (generic) type caching
The runtime for .net has a type caching mechanism that is really great. Every so often I write code where you need specific data based upon a type. Normally one tend to revert to a Dictionary with Type as the key and the datatype as the valuetype for the generic parameters.
Typically:
This will then rely on he dictionary and its implementation. Sure, it is not a bad solution, but there is a more effective and last but not least; cooler way of going about achieving the same effect:
The beauty of this is that the static constructor will run once per type and one can do type specific stuff in the constructor
The two implementations above lack a lot, so lets go for a more complete sample: