From 2de6c85fc9cde12d5877f18fc62d9937ac527e11 Mon Sep 17 00:00:00 2001 From: rdb Date: Tue, 10 Jan 2017 19:36:03 +0100 Subject: [PATCH] glsl: fix shadowMatrix for point lights --- panda/src/display/graphicsStateGuardian.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/panda/src/display/graphicsStateGuardian.cxx b/panda/src/display/graphicsStateGuardian.cxx index d5b2f769a0..7f87e87d8e 100644 --- a/panda/src/display/graphicsStateGuardian.cxx +++ b/panda/src/display/graphicsStateGuardian.cxx @@ -1684,8 +1684,11 @@ fetch_specified_member(const NodePath &np, CPT_InternalName attrib, LMatrix4 &t) t = get_external_transform()->get_mat() * get_scene()->get_camera_transform()->get_mat() * np.get_net_transform()->get_inverse()->get_mat() * - LMatrix4::convert_mat(_coordinate_system, lens->get_coordinate_system()) * - lens->get_projection_mat() * biasmat; + LMatrix4::convert_mat(_coordinate_system, lens->get_coordinate_system()); + + if (!node->is_of_type(PointLight::get_class_type())) { + t *= lens->get_projection_mat() * biasmat; + } return &t; } else {