Fixed minor LoD issues

This commit is contained in:
Joshua Barretto 2022-05-11 15:00:44 +01:00
parent f21a64e898
commit 01e1cb34b0
3 changed files with 5 additions and 5 deletions

View File

@ -33,11 +33,11 @@ layout(location = 3) out vec3 model_pos;
layout(location = 4) out float snow_cover;
void main() {
vec3 tree_pos = inst_pos - focus_off.xyz;
f_pos = tree_pos + v_pos;
vec3 obj_pos = inst_pos - focus_off.xyz;
f_pos = obj_pos + v_pos;
model_pos = v_pos;
float pull_down = 1.0 / pow(distance(focus_pos.xy, tree_pos.xy) / (view_distance.x * 0.95), 150.0);
float pull_down = 1.0 / pow(distance(focus_pos.xy, obj_pos.xy) / (view_distance.x * 0.95), 150.0);
#ifndef EXPERIMENTAL_NOTERRAINPOP
f_pos.z -= pull_down;
#else

View File

@ -658,7 +658,7 @@ impl Client {
tick: 0,
state,
view_distance: None,
lod_distance: 4.0, // TODO: Make configurable
lod_distance: 4.0,
loaded_distance: 0.0,
pending_chunks: HashMap::new(),

View File

@ -103,7 +103,7 @@ impl Lod {
));
}
// Create new LoD groups new a new zone has loaded
// Create new LoD groups when a new zone has loaded
for (p, zone) in client.lod_zones() {
self.zone_objects.entry(*p).or_insert_with(|| {
let mut objects = HashMap::<_, Vec<_>>::new();