--- /dev/null
+#ifndef MSP_GL_INSTANCESCENE_H_
+#define MSP_GL_INSTANCESCENE_H_
+
+#include <map>
+#include <set>
+#include <msp/core/inttypes.h>
+#include "scene.h"
+
+namespace Msp {
+namespace GL {
+
+/**
+A Scene optimized for rendering instanced Renderables, such as ObjectInstances.
+All Renderables with the same instance key are rendered consecutively; within
+the same key rendering order is unspecified.
+*/
+class InstanceScene: public Scene
+{
+private:
+ typedef std::set<Renderable *> RenderableSet;
+ typedef std::map<IntPtr, RenderableSet> InstanceMap;
+
+ InstanceMap renderables;
+
+public:
+ virtual void add(Renderable &);
+ virtual void remove(Renderable &);
+
+ virtual void setup_frame(Renderer &);
+ virtual void finish_frame();
+
+ virtual void render(Renderer &, const Tag &tag = Tag()) const;
+};
+
+} // namespace GL
+} // namespace Msp
+
+#endif