diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2020-04-30 10:03:10 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-30 10:03:10 +0200 |
commit | deddf9c4f8135bd99b95a0a99788131cb6d5a0b0 (patch) | |
tree | 7b4d130d38500c6fc1957ceb9c453c8656bbfa55 /servers/rendering | |
parent | a6e3c84c68c0d60430afef6694551526453ecd4c (diff) | |
parent | 87ba4daf4bd627af033b4fbd784f783d9c58988b (diff) |
Merge pull request #38344 from ExpiredPopsicle/culling5_master
Fixed false positives in the culling system (master branch version).
Diffstat (limited to 'servers/rendering')
-rw-r--r-- | servers/rendering/rendering_server_scene.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/servers/rendering/rendering_server_scene.cpp b/servers/rendering/rendering_server_scene.cpp index 337eb5995f..2c3c2730d5 100644 --- a/servers/rendering/rendering_server_scene.cpp +++ b/servers/rendering/rendering_server_scene.cpp @@ -1850,12 +1850,13 @@ bool RenderingServerScene::_light_instance_update_shadow(Instance *p_instance, c real_t z = i == 0 ? -1 : 1; Vector<Plane> planes; - planes.resize(5); + planes.resize(6); planes.write[0] = light_transform.xform(Plane(Vector3(0, 0, z), radius)); planes.write[1] = light_transform.xform(Plane(Vector3(1, 0, z).normalized(), radius)); planes.write[2] = light_transform.xform(Plane(Vector3(-1, 0, z).normalized(), radius)); planes.write[3] = light_transform.xform(Plane(Vector3(0, 1, z).normalized(), radius)); planes.write[4] = light_transform.xform(Plane(Vector3(0, -1, z).normalized(), radius)); + planes.write[5] = light_transform.xform(Plane(Vector3(0, 0, -z), 0)); int cull_count = p_scenario->octree.cull_convex(planes, instance_shadow_cull_result, MAX_INSTANCE_CULL, RS::INSTANCE_GEOMETRY_MASK); Plane near_plane(light_transform.origin, light_transform.basis.get_axis(2) * z); |