1 #ifndef MSP_GL_OCCLUDEDSCENE_H_
2 #define MSP_GL_OCCLUDEDSCENE_H_
17 A scene that performs occlusion queries on renderables to skip those that are
18 entirely occluded by others.
20 class OccludedScene: public Scene
26 struct OccludedRenderable
28 Renderable *renderable;
29 const Geometry::BoundingSphere<float, 3> *bounding_sphere;
36 const Mesh &bounding_mesh;
37 const Program &bounding_shader;
39 DepthTest no_depth_write;
40 std::set<Renderable *> renderables;
41 float occluder_min_size;
42 mutable QueryPool queries;
43 mutable std::vector<OccludedRenderable> occluded_cache;
44 mutable bool cache_dirty;
49 virtual void add(Renderable &);
50 virtual void remove(Renderable &);
53 void populate_cache() const;
56 virtual void setup_frame(Renderer &);
57 virtual void finish_frame();
59 virtual void render(Renderer &, Tag = Tag()) const;