From: Mikko Rasa Date: Sun, 1 Jul 2018 10:05:11 +0000 (+0300) Subject: Add a function to set depth clip of EnvironmentMap X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=698e78ecfa30cc3580050996bc236c3ebe65aa2a;p=libs%2Fgl.git Add a function to set depth clip of EnvironmentMap --- diff --git a/source/environmentmap.cpp b/source/environmentmap.cpp index b55dd2c7..95e2c439 100644 --- a/source/environmentmap.cpp +++ b/source/environmentmap.cpp @@ -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::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) diff --git a/source/environmentmap.h b/source/environmentmap.h index aa95630f..5f3b6a14 100644 --- a/source/environmentmap.h +++ b/source/environmentmap.h @@ -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();