v0.3: Large world 4096x3072 + momentum waves + zoom-scaled lighting
- World expanded to 4096x3072 (16x area, tiled 4x4 copies) - Active region margin increased to 200px - Liquid momentum system (FLAG_MOMENTUM) for wave sloshing - Zoom-at-cursor support (camera.zoomAt) - Smoother zoom steps (0.2 per scroll tick) - Light propagation scaled by zoom (passes & falloff) - AGENTS.md updated with all current features
This commit is contained in:
@@ -7,6 +7,7 @@ pub struct RenderBuffer {
|
||||
pub height: u32,
|
||||
light: Vec<u8>,
|
||||
block: Vec<u8>,
|
||||
zoom: f32,
|
||||
}
|
||||
|
||||
impl RenderBuffer {
|
||||
@@ -19,6 +20,7 @@ impl RenderBuffer {
|
||||
height,
|
||||
light: vec![0; lsize],
|
||||
block: vec![0; lsize],
|
||||
zoom: 1.0,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +29,8 @@ impl RenderBuffer {
|
||||
let rh = self.height as i32;
|
||||
let total = (rw * rh) as usize;
|
||||
|
||||
self.zoom = zoom;
|
||||
|
||||
for i in 0..total {
|
||||
self.light[i] = 0;
|
||||
self.block[i] = 0;
|
||||
@@ -49,7 +53,8 @@ impl RenderBuffer {
|
||||
}
|
||||
}
|
||||
|
||||
for _pass in 0..12 {
|
||||
let max_passes = (16.0 / zoom).max(6.0).min(24.0) as u32;
|
||||
for _pass in 0..max_passes {
|
||||
let dir = _pass & 1;
|
||||
let mut changed = false;
|
||||
if dir == 0 {
|
||||
@@ -157,7 +162,8 @@ impl RenderBuffer {
|
||||
let ni = (ny * rw + nx) as usize;
|
||||
let nlight = self.light[ni] as u32;
|
||||
if nlight <= 1 { continue; }
|
||||
let falloff = (if nx == px || ny == py { 2 } else { 3 }) + blk;
|
||||
let base_falloff = if nx == px || ny == py { 2.0 } else { 3.0 };
|
||||
let falloff = (base_falloff / self.zoom) as u32 + blk;
|
||||
if nlight > falloff {
|
||||
let incoming = nlight - falloff;
|
||||
if incoming > best {
|
||||
|
||||
Reference in New Issue
Block a user