Skip to content

Commit

Permalink
conservative occlusion culling
Browse files Browse the repository at this point in the history
- do not "overcull" objects that does not fit into visibility buffer
  • Loading branch information
mrDIMAS committed Sep 1, 2024
1 parent 7046082 commit 6502534
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion fyrox-impl/src/renderer/visibility.rs
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,13 @@ impl OcclusionTester {
return;
};

let mut objects_visibility = vec![false; self.objects_to_test.len()];
let mut objects_visibility = vec![true; self.objects_to_test.len()];
for tile in self.tiles.tiles.iter() {
for object_index in tile.objects.iter().take(tile.count as usize) {
objects_visibility[*object_index as usize] = false;
}
}

for y in 0..self.h_tiles {
let img_y = self.h_tiles.saturating_sub(1) - y;
let tile_offset = y * self.w_tiles;
Expand Down

0 comments on commit 6502534

Please sign in to comment.