Fix stencil rendering

This commit is contained in:
Maximilian Ammann 2022-01-07 17:10:07 +01:00
parent 3223e8e7fc
commit bdf905b6b4
2 changed files with 6 additions and 6 deletions

View File

@ -174,7 +174,7 @@ pub mod tile_mask {
&[wgpu::ColorTargetState {
format: COLOR_TEXTURE_FORMAT,
blend: None,
write_mask: wgpu::ColorWrites::empty(),
write_mask: wgpu::ColorWrites::ALL,
}],
);
}

View File

@ -371,8 +371,8 @@ impl State {
for tile in upload.iter() {
let new_coords = TileCoords {
x: tile.coords.x - MUNICH_X,
y: tile.coords.y - MUNICH_Y,
x: tile.coords.x,
y: tile.coords.y,
z: tile.coords.z,
};
@ -382,8 +382,8 @@ impl State {
let uniform = TileUniform::new(
[0.0, 0.0, 0.0, 1.0],
[
new_coords.x as f32 * 4096.0,
-1.0 * new_coords.y as f32 * 4096.0, // FIXME: Improve conversion to world tile coordinates
(new_coords.x - MUNICH_X) as f32 * 4096.0,
-1.0 * (new_coords.y - MUNICH_Y) as f32 * 4096.0, // FIXME: Improve conversion to world tile coordinates
],
);
self.queue.write_buffer(
@ -469,7 +469,7 @@ impl State {
// FIXME: Improve conversion
let world_x = x as i32 - MUNICH_X as i32;
let world_y = y as i32 - MUNICH_Y as i32 * -1;
let world_y = (y as i32 - MUNICH_Y as i32 + 1) * -1;
pass.set_pipeline(&self.render_pipeline);
let reference = match (world_x, world_y) {