|
@@ -1850,12 +1850,13 @@ bool RenderingServerScene::_light_instance_update_shadow(Instance *p_instance, c
|
|
|
|
|
|
real_t z = i == 0 ? -1 : 1;
|
|
real_t z = i == 0 ? -1 : 1;
|
|
Vector<Plane> planes;
|
|
Vector<Plane> planes;
|
|
- planes.resize(5);
|
|
|
|
|
|
+ planes.resize(6);
|
|
planes.write[0] = light_transform.xform(Plane(Vector3(0, 0, z), radius));
|
|
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[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[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[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[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);
|
|
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);
|
|
Plane near_plane(light_transform.origin, light_transform.basis.get_axis(2) * z);
|