X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2F3d%2Fview.cpp;h=9fd5684f6ab50851f82c42c8ba10a25da16b3abc;hb=d06a1e1ab34e5ecb4bb7011d44298a0b5e6162be;hp=69049e0b3e8e2232277ad4d0ee0f93e374424075;hpb=6aa6e3a60c31d71e8f8117be1ddf547897d19bd8;p=r2c2.git diff --git a/source/3d/view.cpp b/source/3d/view.cpp index 69049e0..9fd5684 100644 --- a/source/3d/view.cpp +++ b/source/3d/view.cpp @@ -25,6 +25,7 @@ View3D::View3D(Layout3D &l, unsigned w, unsigned h): pipeline.add_renderable_for_pass(layout.get_scene(), "translucent"); GL::Pipeline::Pass *pass = &pipeline.add_pass("sky"); + pass->set_lighting(&layout.get_lighting()); pass = &pipeline.add_pass(0); pass->set_lighting(&layout.get_lighting()); @@ -59,7 +60,7 @@ Ray View3D::create_ray(float x, float y) const { const GL::Vector3 &start = camera.get_position(); GL::Vector4 ray = camera.unproject(GL::Vector4(x, y, 0, 0)); - return Ray(start, Vector(ray)); + return Ray(start, ray.slice<3>(0)); } void View3D::compute_bounds(Vector &minp, Vector &maxp) @@ -98,7 +99,7 @@ void View3D::update_shadow_area() { Vector minp, maxp; compute_bounds(minp, maxp); - shadow.set_target((minp+maxp)/2.0f, (maxp-minp).norm()/2.0f); + shadow.set_target((minp+maxp)/2.0f, max((maxp-minp).norm()/2.0f, 0.1f)); } } // namespace R2C2