Balder: Silverlight 3D Engine

Balder was one of the first 3d prototype engines in Silverlight and it has evolved quite nicely.  Balder by Einar Ingebrigtsen is described as a “Managed GameEngine with both 2D and 3D support targetting Silverlight, Xna and OpenGL.”

The sample browser will show you what Balder is capable of and it has come pretty far since the first version showing a wireframe teapot.

You know you’ve made it as a 3D engine when there are Augmented Reality apps for it.

Here’s a glance at what some of the C# source looks like for a feel of the engine code from the Silverlight4 TestApp:

using Balder.Core.Execution;
using Balder.Core.Objects.Geometries;
using System;
using Balder.Core.Lighting;
using Balder.Core;
using Colors=System.Windows.Media.Colors;
 
namespace Balder.Silverlight4.TestApp
{
    public class MyGame : Game
    {
        public override void OnInitialize()
        {
 
            Camera.Position.X = 0;
            Camera.Position.Y = 0;
            Camera.Position.Z = -80;
 
            var light = new OmniLight();
            light.Diffuse = Color.FromSystemColor(Colors.Green);
            light.Ambient = Color.FromSystemColor(Colors.Green);
            light.Specular = Color.FromSystemColor(Colors.White);
            light.Position.X = 0;
            light.Position.Y = 0;
            light.Position.Z = -130;
 
            Scene.AddNode(light);
 
            base.OnInitialize();
        }
 
 
        public override void OnLoadContent()
        {
            var teapot = ContentManager.Load("teapot.ase");
            Scene.AddNode(teapot);
            base.OnLoadContent();
        }
 
 
        private double _sin;
 
        public override void OnUpdate()
        {
 
            Camera.Position.X = (float)(Math.Sin(_sin)*80);
            Camera.Position.Y = 0;
            Camera.Position.Z = (float)(Math.Cos(_sin) * 80);
 
            _sin += 0.05;
            base.OnUpdate();
        }
 
    }
}

Tags: , , , , , ,

  • wonderwhyer

    Would be interesting to see polygon count and FPS there for comparison with other Silverlight/Flash stuff.
    From those demos though seems to me that it is more or less on par with Flash engines but still is faster and environmental mapping looks better then those I seen in Flash. Also works well in fullscreen. Can't say the same about Flash.

    • http://drawlabs.com drawcode

      Yeh that would be a great test. Making the same models and testing the same effects and features in Silverlight and Flash. I think that Flash engines and platform is more mature at this point. But it would be great to see a comparison. Maybe if I have time :)

  • Jeff

    Its the same low quality level Papervision and Alternativa have in Flash: check the Box in the examples with Reflection mapping: im sure you shouldn't be able to see the edge between two polygons on the same cube-face. Also: what's all the jittery crap near the surface edges? The faces are shaded very nice, but the edges hurt.

    So yeah, it's a new browser 3D, that's nice. But that in itself stopped being impressive 2 years ago. If it would have proper Anti Aliasing i'd be really impressed.

  • Roland_K

    Is there any alternative silverlight 3d engine to balder?