From 9d05044a9f925ac8e4440023acd8bd34af75d96e Mon Sep 17 00:00:00 2001 From: rdb Date: Thu, 23 Mar 2017 12:22:34 +0100 Subject: [PATCH] shadows: force interocular distance to 0 for shadow cameras --- panda/src/pgraphnodes/directionalLight.cxx | 1 + panda/src/pgraphnodes/pointLight.cxx | 6 ++++++ panda/src/pgraphnodes/spotlight.cxx | 1 + 3 files changed, 8 insertions(+) diff --git a/panda/src/pgraphnodes/directionalLight.cxx b/panda/src/pgraphnodes/directionalLight.cxx index 127f994fbb..f0d84ffb9a 100644 --- a/panda/src/pgraphnodes/directionalLight.cxx +++ b/panda/src/pgraphnodes/directionalLight.cxx @@ -59,6 +59,7 @@ DirectionalLight(const string &name) : LightLensNode(name, new OrthographicLens()), _has_specular_color(false) { + _lenses[0]._lens->set_interocular_distance(0); } /** diff --git a/panda/src/pgraphnodes/pointLight.cxx b/panda/src/pgraphnodes/pointLight.cxx index 564116ecac..d3f7192248 100644 --- a/panda/src/pgraphnodes/pointLight.cxx +++ b/panda/src/pgraphnodes/pointLight.cxx @@ -66,21 +66,27 @@ PointLight(const string &name) : { PT(Lens) lens; lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(1, 0, 0, 0, -1, 0); set_lens(0, lens); lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(-1, 0, 0, 0, -1, 0); set_lens(1, lens); lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(0, 1, 0, 0, 0, 1); set_lens(2, lens); lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(0, -1, 0, 0, 0, -1); set_lens(3, lens); lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(0, 0, 1, 0, -1, 0); set_lens(4, lens); lens = new PerspectiveLens(90, 90); + lens->set_interocular_distance(0); lens->set_view_vector(0, 0, -1, 0, -1, 0); set_lens(5, lens); } diff --git a/panda/src/pgraphnodes/spotlight.cxx b/panda/src/pgraphnodes/spotlight.cxx index 638f89f93c..badf4544d9 100644 --- a/panda/src/pgraphnodes/spotlight.cxx +++ b/panda/src/pgraphnodes/spotlight.cxx @@ -68,6 +68,7 @@ Spotlight(const string &name) : LightLensNode(name), _has_specular_color(false) { + _lenses[0]._lens->set_interocular_distance(0); } /**