fixed panic when trying to create too small shadow map
@@ -62,8 +62,8 @@ pub struct SpotShadowMapRenderer {
fn cascade_size(base_size: usize, cascade: usize) -> usize {
match cascade {
0 => base_size,
- 1 => base_size / 2,
- 2 => base_size / 4,
+ 1 => (base_size / 2).max(1),
+ 2 => (base_size / 4).max(1),
_ => unreachable!(),
}
}
