25Nov/091
Split Screen in Sunburn
Nick "I do too much, but still can't stop" Gravelyn continues his series about using Sunburn with a new tutorial, where he shows us how to enable Split Screen when using the Sunburn rendering engine. Go take a look at it and grab the source here.
He's also asking about future stuff to do with Sunburn, so if you want to see anything in particular, let him know!

May 4th, 2010 - 12:05
Hi Nick! I tried this in the latest version of SunBurn, and the shadows dont work properly anymore. The directional light makes sure the non-lit sides of the models in the scene are covered in shadows, but casting shadows on other objects isnt working.
Now the way you load and submit your tank model is a bit different then a standard Sunburn project loads a model. I cant really submit anything to the renderer like you do in your code. I use:
//load
Model scene = Content.Load(“example/scene”);
world = Matrix.Identity;
sceneInterface.ObjectManager.SubmitStaticSceneObject(scene, world, ObjectVisibility.RenderedAndCastShadows);
//draw
if (splitScreen)
{
// set a viewport and then render the scene
GraphicsDevice.SetViewport(ViewportLocation.TopHalf);
DrawScene(gameTime, view1, projection);
// set a viewport and then render the scene
GraphicsDevice.SetViewport(ViewportLocation.BottomHalf);
DrawScene(gameTime, view2, projection);
}
private void DrawScene(GameTime gameTime, Matrix view, Matrix proj)
{
// draw all frame objects here since frame objects are flushed
// each time you call renderManager.Render()
//tank.Draw(
//tankWorld,
//renderManager,
//ObjectVisibility.CastShadows | ObjectVisibility.Rendered,
//ObjectLifeSpan.Frame);
// draw the scene
sceneState.BeginFrameRendering(view, proj, gameTime, environment);
sceneInterface.RenderManager.BeginFrameRendering(sceneState);
sceneInterface.RenderManager.Render();
sceneInterface.EndFrameRendering();
sceneState.EndFrameRendering();
}
Now its obvious where the problem is: Its why you draw the tank again, it gets flushed.
But how can I do this with the scene I use, since it has no Draw method?