]> git.tdb.fi Git - r2c2.git/blobdiff - source/3d/view.cpp
Convert Catalogue to a Collection
[r2c2.git] / source / 3d / view.cpp
index 673daef0c5ca4d7e2443ffeb9f127bfab451ea52..ef03c4b7139f42cdb7d357c7310c8d6fc09f85dd 100644 (file)
@@ -13,13 +13,17 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h):
        layout(l),
        width(w),
        height(h),
-       pipeline(w, h)
+       pipeline(w, h),
+       sky(layout.get_catalogue())
 {
        pipeline.set_camera(&camera);
+       pipeline.add_renderable(sky);
        pipeline.add_renderable_for_pass(layout.get_scene(), 0);
        pipeline.add_renderable_for_pass(layout.get_scene(), "translucent");
 
-       GL::Pipeline::Pass *pass = &pipeline.add_pass(0);
+       GL::Pipeline::Pass *pass = &pipeline.add_pass("sky");
+
+       pass = &pipeline.add_pass(0);
        pass->set_lighting(&layout.get_lighting());
        pass->set_depth_test(&GL::DepthTest::lequal());
 
@@ -66,6 +70,7 @@ void View3D::view_all(bool tight)
        GL::Vector3 center = (minp+maxp)/2.0f;
        const GL::Vector3 &look = camera.get_look_direction();
        camera.set_position(center-look*dist);
+       camera.set_depth_clip(dist*0.02, dist*50);
 }
 
 void View3D::render()