mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Fixed shadow distance culling
This commit is contained in:
parent
7e6eede740
commit
b0a1619698
@ -223,7 +223,7 @@ impl Scene {
|
|||||||
.join()
|
.join()
|
||||||
.filter(|(pos, _)| {
|
.filter(|(pos, _)| {
|
||||||
(pos.0.distance_squared(player_pos) as f32)
|
(pos.0.distance_squared(player_pos) as f32)
|
||||||
< self.loaded_distance.powf(2.0).min(SHADOW_MAX_DIST) + SHADOW_DIST_RADIUS
|
< (self.loaded_distance.min(SHADOW_MAX_DIST) + SHADOW_DIST_RADIUS).powf(2.0)
|
||||||
})
|
})
|
||||||
.map(|(pos, scale)| Shadow::new(pos.0, scale.map(|s| s.0).unwrap_or(1.0)))
|
.map(|(pos, scale)| Shadow::new(pos.0, scale.map(|s| s.0).unwrap_or(1.0)))
|
||||||
.collect::<Vec<_>>();
|
.collect::<Vec<_>>();
|
||||||
|
@ -207,6 +207,7 @@ impl<'a> Sampler<'a> for ColumnGen<'a> {
|
|||||||
let wposf3d = Vec3::new(wposf.x, wposf.y, alt as f64);
|
let wposf3d = Vec3::new(wposf.x, wposf.y, alt as f64);
|
||||||
|
|
||||||
let marble_small = (sim.gen_ctx.hill_nz.get((wposf3d.div(3.0)).into_array()) as f32)
|
let marble_small = (sim.gen_ctx.hill_nz.get((wposf3d.div(3.0)).into_array()) as f32)
|
||||||
|
.powf(3.0)
|
||||||
.add(1.0)
|
.add(1.0)
|
||||||
.mul(0.5);
|
.mul(0.5);
|
||||||
let marble = (sim.gen_ctx.hill_nz.get((wposf3d.div(48.0)).into_array()) as f32)
|
let marble = (sim.gen_ctx.hill_nz.get((wposf3d.div(48.0)).into_array()) as f32)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user