]> git.tdb.fi Git - libs/gl.git/commitdiff
Add a function to set depth clip of EnvironmentMap
authorMikko Rasa <tdb@tdb.fi>
Sun, 1 Jul 2018 10:05:11 +0000 (13:05 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 1 Jul 2018 10:05:11 +0000 (13:05 +0300)
source/environmentmap.cpp
source/environmentmap.h

index b55dd2c7c6cca956d000a4823859b102b9513086..95e2c4394c809a8c05be4515159b2da4fdc02d84 100644 (file)
@@ -23,13 +23,17 @@ EnvironmentMap::EnvironmentMap(unsigned s, Renderable &r, Renderable &e):
                fbo[i].require_complete();
        }
 
-       // XXX Make the depth range configurable
        camera.set_field_of_view(Geometry::Angle<float>::right());
        camera.set_aspect_ratio(1);
        camera.set_depth_clip(0.1, 100);
 
 }
 
+void EnvironmentMap::set_depth_clip(float n, float f)
+{
+       camera.set_depth_clip(n, f);
+}
+
 void EnvironmentMap::setup_frame(Renderer &renderer)
 {
        if(rendered)
index aa95630f1d4886815930201abbdbea8c4dd3c999..5f3b6a14b81b0493ac0e9fe2acbdb78bff7d5726 100644 (file)
@@ -39,6 +39,8 @@ private:
 public:
        EnvironmentMap(unsigned size, Renderable &rend, Renderable &env);
 
+       void set_depth_clip(float, float);
+
        virtual void setup_frame(Renderer &);
        virtual void finish_frame();