X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Frender%2Foccludedscene.h;h=1f447c39b2efec06ea25c3e0287185d5fb92d12e;hb=016f0f0dd51511f98d0bf398d99199d7dec1543c;hp=d51b29b36c87def2ef0ed1e7c30544a0aabea148;hpb=5bb193f930fb8738d099d630c4d625d82c1215b5;p=libs%2Fgl.git diff --git a/source/render/occludedscene.h b/source/render/occludedscene.h index d51b29b3..1f447c39 100644 --- a/source/render/occludedscene.h +++ b/source/render/occludedscene.h @@ -15,8 +15,11 @@ class Mesh; class Program; /** -A scene that performs occlusion queries on renderables to skip those that are +A scene which performs occlusion queries on renderables to skip those which are entirely occluded by others. + +Renderables must have valid model matrices and bounding spheres to participate +in occlusion culling. Those lacking one or both are always rendered. */ class OccludedScene: public Scene { @@ -26,23 +29,21 @@ public: private: struct OccludedRenderable { - Renderable *renderable; - const Geometry::BoundingSphere *bounding_sphere; - bool in_frustum; - bool occluder; - - OccludedRenderable(); + Renderable *renderable = 0; + const Geometry::BoundingSphere *bounding_sphere = 0; + bool in_frustum = false; + bool occluder = false; }; const Mesh &bounding_mesh; const Program &bounding_shader; Blend no_color_write; - DepthTest no_depth_write; - std::set renderables; - float occluder_min_size; + DepthTest no_depth_write = { LEQUAL, false }; + std::vector content; + float occluder_min_size = 0.25f; mutable QueryPool queries; mutable std::vector occluded_cache; - mutable bool cache_dirty; + mutable bool cache_dirty = false; public: OccludedScene();