Skip to content

Commit

Permalink
one less division for bilinear filtering
Browse files Browse the repository at this point in the history
makes more sense that way anyway
  • Loading branch information
Uriopass committed Dec 14, 2023
1 parent 6406c30 commit 85c9efd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geom/src/heightmap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,8 +124,8 @@ impl<const RESOLUTION: usize, const SIZE: u32> Heightmap<RESOLUTION, SIZE> {
self.height_nearest(p + Vec2::y(Self::CELL_SIZE)),
self.height_nearest(p + vec2(Self::CELL_SIZE, Self::CELL_SIZE)),
) {
let x = (p.x % Self::CELL_SIZE) / Self::CELL_SIZE;
let y = (p.y % Self::CELL_SIZE) / Self::CELL_SIZE;
let x = (p.x / Self::CELL_SIZE).fract();
let y = (p.y / Self::CELL_SIZE).fract();

let h01 = ll + x * (lr - ll);
let h23 = ul + x * (ur - ul);
Expand Down

0 comments on commit 85c9efd

Please sign in to comment.