average composite on terrain sprites

This commit is contained in:
2025-05-06 22:31:31 +01:00
parent 6f82b904fe
commit 6f4de57f1b
6 changed files with 93 additions and 115 deletions
+7 -5
View File
@@ -46,6 +46,7 @@ pub fn handle_tile_occlusion_updates(
)>,
mut cwss: ResMut<CurrentWorldSpriteState>,
) {
println!("updating tile occlusion");
query_set
.p0()
.par_iter_mut()
@@ -91,7 +92,8 @@ pub fn calculate_visibility(pos: IVec3, tilemap: &TileMap) -> [u32; 8] {
let mut is_occluded = false;
'vertical_check: for z_offset in 1..15 {
let v_check_height: i32 = Z_TOTAL as i32 - (camera_z / ITILE_SIZE) + Z_BELOW as i32 + 1;
'vertical_check: for z_offset in 1..v_check_height {
let above_pos = IVec3::new(pos.x, pos.y, pos.z + (z_offset * ITILE_SIZE));
if above_pos.z <= camera_z {
if let Some(&(_, opaque, _, _, _)) = tilemap.floor_tiles.get(&above_pos) {
@@ -194,13 +196,13 @@ fn generate_chunks_from_algo(
);
let pos_ivec = position.as_ivec3();
if z < -8 {
if z < -5 {
let noise_value = cave_noise.get([
world_x as f64 * 0.05,
world_y as f64 * 0.05,
z as f64 * 0.05,
z as f64 * (0.15 * -z as f64),
]);
if noise_value < -0.5 {
if noise_value < -0.65 {
FloorTilePrefab::air(position).spawn(&mut commands);
tilemap
.floor_tiles
@@ -275,7 +277,7 @@ fn generate_chunks_from_algo(
fn setup_initial_chunks(mut event_writer: EventWriter<LoadChunkEvent>) {
println!("setup_initial_chunks");
for x in -2..=2 {
for x in -3..=3 {
for y in -2..=2 {
event_writer.write(LoadChunkEvent {
chunk_position: IVec2::new(x, y),