mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Reduce LoD zone size
This commit is contained in:
parent
d7f2e84e16
commit
3559a85922
BIN
assets/voxygen/voxel/mini_tree.vox
(Stored with Git LFS)
BIN
assets/voxygen/voxel/mini_tree.vox
(Stored with Git LFS)
Binary file not shown.
@ -1617,7 +1617,7 @@ impl Client {
|
||||
}
|
||||
|
||||
pub fn nearby_zones(&self) -> Option<impl Iterator<Item = Vec2<i32>>> {
|
||||
const ZONE_RADIUS: u32 = 1;
|
||||
const ZONE_RADIUS: u32 = 2;
|
||||
let player_zone = self.position()?.xy().map2(TerrainChunkSize::RECT_SIZE, |e, sz| e as i32 / (sz * LodZone::SIZE) as i32);
|
||||
Some(Spiral2d::new()
|
||||
.take((ZONE_RADIUS * 2 + 1).pow(2) as usize)
|
||||
|
@ -8,7 +8,7 @@ pub struct LodZone {
|
||||
|
||||
impl LodZone {
|
||||
/// Size in chunks
|
||||
pub const SIZE: u32 = 64;
|
||||
pub const SIZE: u32 = 32;
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize)]
|
||||
|
@ -49,6 +49,7 @@ impl Lod {
|
||||
Segment::from(&DotVoxAsset::load_expect("voxygen.voxel.mini_tree").read().0),
|
||||
(&mut greedy, &mut mesh, false),
|
||||
);
|
||||
println!("Tree mesh has {} vertices", mesh.vertices().len());
|
||||
(
|
||||
renderer.create_model(&mesh).expect("Failed to upload sprite model data to the GPU!"),
|
||||
ShadowPipeline::create_col_lights(renderer, &greedy.finalize())
|
||||
|
@ -85,8 +85,8 @@ impl StructureGen2d {
|
||||
let freq_offset = Self::freq_offset(freq);
|
||||
assert!(freq_offset * 2 == freq);
|
||||
|
||||
let min_index = Self::sample_to_index_internal(freq, min) - 1;
|
||||
let max_index = Self::sample_to_index_internal(freq, max) + 1;
|
||||
let min_index = Self::sample_to_index_internal(freq, min - spread) - 1;
|
||||
let max_index = Self::sample_to_index_internal(freq, max + spread) + 1;
|
||||
assert!(min_index.x < max_index.x);
|
||||
// NOTE: xlen > 0
|
||||
let xlen = (max_index.x - min_index.x) as u32;
|
||||
|
Loading…
Reference in New Issue
Block a user