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