def update_virtual_light(light, cascade)
      virtual_light = light.shadow_cascade_array[cascade]

      virtual_light.position.copy(light.position)
      virtual_light.target.position.copy(light.target.position)
      virtual_light.look_at(virtual_light.target)

      virtual_light.shadow_camera_visible = light.shadow_camera_visible
      virtual_light.shadow_darkness = light.shadow_darkness

      virtual_light.shadow_bias = light.shadow_cascade_bias[cascade]

      near_z = light.shadow_cascade_near_z[cascade]
      far_z = light.shadow_cascade_far_z[cascade]

      points_frustum = virtual_light.points_frustum

      points_frustum[0].z = near_z
      points_frustum[1].z = near_z
      points_frustum[2].z = near_z
      points_frustum[3].z = near_z

      points_frustum[4].z = far_z
      points_frustum[5].z = far_z
      points_frustum[6].z = far_z
      points_frustum[7].z = far_z
    end
def update_virtual_light(light, cascade)
      virtual_light = light.shadow_cascade_array[cascade]

      virtual_light.position.copy(light.position)
      virtual_light.target.position.copy(light.target.position)
      virtual_light.look_at(virtual_light.target)

      virtual_light.shadow_camera_visible = light.shadow_camera_visible
      virtual_light.shadow_darkness = light.shadow_darkness

      virtual_light.shadow_bias = light.shadow_cascade_bias[cascade]

      near_z = light.shadow_cascade_near_z[cascade]
      far_z = light.shadow_cascade_far_z[cascade]

      points_frustum = virtual_light.points_frustum

      points_frustum[0].z = near_z
      points_frustum[1].z = near_z
      points_frustum[2].z = near_z
      points_frustum[3].z = near_z

      points_frustum[4].z = far_z
      points_frustum[5].z = far_z
      points_frustum[6].z = far_z
      points_frustum[7].z = far_z
    end
synchronize virtual light with the original light