Custom scene renderers

ISceneRenderer or use a delegate through the DelegateSceneRenderer.

Implement an ISceneRenderer

SceneRendererBase provides a default implementation of ISceneRenderer. It automatically binds the output defines on the renderer to the GraphicsDevice before calling the DrawCore method.

  1. [DataContract("MyCustomRenderer")][Display("My Custom Renderer")]public sealed class MyCustomRenderer : SceneRendererBase{ // Implements the DrawCore method protected override void DrawCore(RenderContext context, RenderFrame output) { // Access to the graphics device var graphicsDevice = context.GraphicsDevice; // Clears the currrent render target graphicsDevice.Clear(output.RenderTargets[0], Color.CornflowerBlue); // [...] }}

Use a delegate

DelegateSceneRenderer:

  1. var sceneRenderer = new DelegateSceneRenderer( (renderContext, frame) => { // Access to the graphics device var graphicsDevice = context.GraphicsDevice; // Clears the currrent render target graphicsDevice.Clear(output.RenderTargets[0], Color.CornflowerBlue); // [...] });

See also

  • Scene renderers
  • Debug renderers