Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1708917
allocate chunk meshes from budgeted arenas and evict far columns when…
Purdze Oct 30, 2026
39bfbe3
share draw lists across chunk arenas and keep a spare memory block
Purdze Oct 30, 2026
c512ea0
retry starved columns that eviction can make room for, evict stale fa…
Purdze Oct 30, 2026
9f0a2d4
Merge remote-tracking branch 'origin/master' into rd-chunk-garbage
Purdze Oct 30, 2026
411f67b
add ChunkPos::containing for block to column conversions
Purdze Oct 30, 2026
5423341
keep chunks the server forgets and draw them as distant terrain
Purdze Oct 30, 2026
c1314c6
merge distant tops into rectangles, grow arenas instead of dropping s…
Purdze Oct 30, 2026
d0873b2
save distant terrain to disk per server or world and load it back as …
Purdze Oct 30, 2026
e7510b7
budget arenas against the heaps they land in, keep evicting columns f…
Purdze Oct 30, 2026
7282b04
follow distant horizons for detail distances, parent fallback, micro …
Purdze Oct 30, 2026
53cb372
light distant sides facing nothing with the sky over their column
Purdze Oct 30, 2026
2cd72a4
close distant water off at the loaded edge with seams along chunk bor…
Purdze Oct 31, 2026
f7a721a
draw distant water see-through with the floor under it and give way t…
Purdze Oct 31, 2026
fc47ae2
texture distant terrain with each block's baked model
Purdze Oct 31, 2026
5000490
evict the farthest distant sections when full and let captures settle…
Purdze Oct 31, 2026
18a06fd
place distant terrain loaded from disk at the dimension's floor befor…
Purdze Oct 31, 2026
b218d45
cut distant leaf holes out at full detail
Purdze Oct 31, 2026
df6dbd0
fill distant leaf holes so coarse forests draw green
Purdze Oct 31, 2026
901e488
repeat distant textures per column, rebuild shaders on include change…
Purdze Oct 31, 2026
ae969be
add world sections at five levels of detail, voxelization and mipping…
Purdze Nov 1, 2026
30b00b7
mesh and draw the distant sections, traversed on the cpu until the gp…
Purdze Nov 1, 2026
47d4f16
bound distant terrain by the drawn chunks, blit it under the frame an…
Purdze Nov 1, 2026
ffd2006
build the distant draw list on the gpu from section records and a ras…
Purdze Nov 1, 2026
97ac37e
walk the distant node tree on the gpu with a hi-z and build the rende…
Purdze Nov 1, 2026
7c15478
drop the longest undrawn distant meshes on the gpu when the arena fills
Purdze Nov 1, 2026
47a9c7b
clear every section's distant bound when a chunk unloads
Purdze Nov 2, 2026
6d8cc6b
wind the distant boxes outward so the occlusion pass keeps the near f…
Purdze Nov 2, 2026
b34979e
draw distant terrain without an indirect count or multi-draw by the c…
Purdze Nov 2, 2026
c8bac6b
add a frame_times harness step reporting fps, 1% low and the cpu and …
Purdze Nov 2, 2026
998472a
keep chunk draw lists up to date on the gpu, cull water with them and…
Purdze Nov 2, 2026
a75cb98
draw block entities only within 64 blocks and outside occluded sections
Purdze Nov 2, 2026
5247699
resolve a text run's font set once instead of per glyph
Purdze Nov 2, 2026
f0d8283
bound distant terrain by the sections the chunk renderer draws, one b…
Purdze Nov 2, 2026
5c54cbe
reword the distant terrain comments and module docs
Purdze Nov 2, 2026
19c395c
request distant meshes for what is hidden or about to come into view
Purdze Nov 3, 2026
5374fe5
take distant requests before chunk captures and ingest captures in sl…
Purdze Nov 3, 2026
f500ff0
read distant requests only from frames whose traversal ran
Purdze Nov 3, 2026
b14ee6c
remove an unloaded column's visibility by key instead of filtering ev…
Purdze Nov 3, 2026
01dc315
Merge branch 'render-perf' into distant-terrain
Purdze Nov 3, 2026
958d42b
walk chunk occlusion on a thread that owns the visibility sets
Purdze Nov 3, 2026
9fd5ae4
upload the meshes that fit the frame's staging room and send the rest…
Purdze Nov 3, 2026
b8c7376
budget chunk packets per frame
Purdze Nov 3, 2026
108ace6
run the light engine on its own thread
Purdze Nov 3, 2026
0e5e706
present immediately when vsync is off, as vanilla does
Purdze Nov 3, 2026
7c62a32
time the frame's passes on the gpu and report them in f3 and frame_times
Purdze Nov 3, 2026
89b658c
count the sections and triangles the chunk cull draws and report them
Purdze Nov 3, 2026
e8e47a1
write the distant bounds per frame in flight
Purdze Nov 3, 2026
3f5429f
write panics into the log before the abort
Purdze Nov 3, 2026
af9c499
draw coarse fluid surfaces at their true height
Purdze Nov 3, 2026
4e33d2c
keep every lit chunk as distant terrain and write the store on the wa…
Purdze Nov 3, 2026
b5dc31b
cap the scatter list at what its staging holds and send the rest of t…
Purdze Nov 3, 2026
fc09129
hide block faces as shouldRenderFace decides: same-kind neighbours an…
Purdze Nov 3, 2026
176dd78
keep evicted chunk columns from bouncing back, and fix the arena revi…
Purdze Nov 3, 2026
fbf096b
hand starved columns back as section lists and sum arena free space i…
Purdze Nov 4, 2026
66621ed
settle claims per section, count free room for the frontier, compact …
Purdze Nov 4, 2026
bc8c70c
flag fragmented room when eviction finds nothing farther, and stop a …
Purdze Nov 4, 2026
5a3dc36
tie fragmentation to the columns it starves, and leave a defragmented…
Purdze Nov 4, 2026
5f0f827
unflag fragmented columns once compaction can't help them
Purdze Nov 4, 2026
e7dc127
drop the fragmentation prune, and let each flag drive one defragment …
Purdze Nov 4, 2026
0af4596
keep empty and placed columns off the waitlist, evict only what makes…
Purdze Nov 4, 2026
6651b79
retry on the first eye, take back a doomed arena before growing, doub…
Purdze Nov 4, 2026
83fc0d8
uncompile starved sections, track waiting need per section, defragmen…
Purdze Nov 4, 2026
8a66f11
set the eye at upload, retry only what the budget fits, defragment on…
Purdze Nov 4, 2026
ec3b67d
keep newer waiting sizes on eviction, retry after the batch, and shar…
Purdze Nov 4, 2026
8791c96
Merge remote-tracking branch 'origin/master' into rd-chunk-garbage
Purdze Nov 4, 2026
03751bd
Merge origin/rd-chunk-garbage into render-perf; barrier compaction mo…
Purdze Nov 4, 2026
89cc735
fade block entities in sections without geometry, rewrite column mask…
Purdze Nov 4, 2026
8cd901d
Merge origin/master into render-perf
Purdze Nov 4, 2026
5a66f4d
Merge origin/render-perf into distant-terrain; hold no tick behind a …
Purdze Nov 4, 2026
eb41333
Merge origin/master into distant-terrain
Purdze Nov 4, 2026
013b564
keep the distant worker draining queued captures, stop lava occluding…
Purdze Nov 4, 2026
089beb1
take in queued captures on a distant flush, free node ids once their …
Purdze Nov 4, 2026
41ce3d1
share the distant key decode
Purdze Nov 4, 2026
837ed00
take the server's view distance as announced, let the render distance…
Purdze Nov 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
77 changes: 77 additions & 0 deletions pomme-client/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ use std::path::Path;
// shaders via the generated packing.glsl.
include!("src/renderer/chunk/packing_consts.rs");

// The same for distant terrain's sizes and markers, shared via the generated
// distant_consts.glsl.
mod distant_consts {
include!("src/renderer/distant/shader_consts.rs");
}

/// `PackedVertex::uv` back to a sprite-local UV, for `packing.glsl`.
const UNPACK_SPRITE_UV: &str = "vec2 unpack_sprite_uv(uint uv) {
uint mask = (1u << TERRAIN_UV_BITS) - 1u;
Expand Down Expand Up @@ -52,6 +58,13 @@ fn main() {
)
.expect("failed to write packing.glsl");

println!("cargo:rerun-if-changed=src/renderer/distant/shader_consts.rs");
fs::write(
Path::new(&out_dir).join("distant_consts.glsl"),
distant_consts_glsl(),
)
.expect("failed to write distant_consts.glsl");

let compiler = shaderc::Compiler::new().expect("failed to create shaderc compiler");
let mut options = shaderc::CompileOptions::new().expect("failed to create compile options");
options.set_target_env(
Expand Down Expand Up @@ -84,6 +97,8 @@ fn main() {
"item_instance.glsl",
"lightmap.glsl",
"light.glsl",
"distant_models.glsl",
"distant_section.glsl",
] {
println!(
"cargo:rerun-if-changed={}",
Expand All @@ -96,6 +111,24 @@ fn main() {
("chunk.frag", shaderc::ShaderKind::Fragment),
("chunk_solid.frag", shaderc::ShaderKind::Fragment),
("water.frag", shaderc::ShaderKind::Fragment),
("distant.vert", shaderc::ShaderKind::Vertex),
("distant.frag", shaderc::ShaderKind::Fragment),
("distant_bound.vert", shaderc::ShaderKind::Vertex),
("distant_bound.frag", shaderc::ShaderKind::Fragment),
("distant_setup.frag", shaderc::ShaderKind::Fragment),
("distant_blit.frag", shaderc::ShaderKind::Fragment),
("distant_cull.vert", shaderc::ShaderKind::Vertex),
("distant_cull.frag", shaderc::ShaderKind::Fragment),
("distant_scatter.comp", shaderc::ShaderKind::Compute),
("distant_prep.comp", shaderc::ShaderKind::Compute),
("distant_cmdgen.comp", shaderc::ShaderKind::Compute),
("distant_prefix_sum.comp", shaderc::ShaderKind::Compute),
("distant_translucents.comp", shaderc::ShaderKind::Compute),
("distant_traversal.comp", shaderc::ShaderKind::Compute),
("distant_hiz.frag", shaderc::ShaderKind::Fragment),
("distant_cleaner_sort.comp", shaderc::ShaderKind::Compute),
("distant_cleaner_results.comp", shaderc::ShaderKind::Compute),
("distant_visibility_set.comp", shaderc::ShaderKind::Compute),
("cube.vert", shaderc::ShaderKind::Vertex),
("cube.frag", shaderc::ShaderKind::Fragment),
("panorama.vert", shaderc::ShaderKind::Vertex),
Expand Down Expand Up @@ -170,6 +203,50 @@ fn main() {
}
}

/// `distant_consts.glsl`: the `uint` constants as `u` literals; plain those
/// that layouts or the preprocessor take.
fn distant_consts_glsl() -> String {
use distant_consts::*;
let uints = [
("LEVELS", LEVELS),
("MAX_NODES", MAX_NODES),
("NULL_ID", NULL_ID),
("EMPTY_ID", EMPTY_ID),
("CLEANER_SENTINEL", CLEANER_SENTINEL),
("MAX_REQUESTS", MAX_REQUESTS),
("MAX_LISTED", MAX_LISTED),
("QUADS_PER_DRAW", QUADS_PER_DRAW),
("OPAQUE_DRAWS", OPAQUE_DRAWS),
("TRANSLUCENT_DRAWS", TRANSLUCENT_DRAWS),
("TEMPORAL_DRAWS", TEMPORAL_DRAWS),
("TRANSLUCENT_OFFSET", TRANSLUCENT_OFFSET),
("TEMPORAL_OFFSET", TEMPORAL_OFFSET),
("NODE_SCATTER_BIT", NODE_SCATTER_BIT),
("VISIBILITY_RESET_BIT", VISIBILITY_RESET_BIT),
("SEEN_BEFORE_BIT", SEEN_BEFORE_BIT),
];
let plain = [
("CLEANER_OUTPUT", u64::from(CLEANER_OUTPUT)),
("TRANSLUCENT_BUCKETS", u64::from(TRANSLUCENT_BUCKETS)),
("COUNTS_OPAQUE", COUNTS_OPAQUE),
("COUNTS_TRANSLUCENT", COUNTS_TRANSLUCENT),
("COUNTS_TEMPORAL", COUNTS_TEMPORAL),
("COUNTS_CULL_DRAW", COUNTS_CULL_DRAW),
("LIST_GROUP", u64::from(LIST_GROUP)),
("TRAVERSAL_GROUP_BITS", u64::from(TRAVERSAL_GROUP_BITS)),
("CLEANER_SORT_THREADS", u64::from(CLEANER_SORT_THREADS)),
("CLEANER_SORT_ELEMS", u64::from(CLEANER_SORT_ELEMS)),
];
let mut glsl = String::from("#ifndef DISTANT_CONSTS_GLSL\n#define DISTANT_CONSTS_GLSL\n");
for (name, value) in uints {
glsl += &format!("#define {name} {value}u\n");
}
for (name, value) in plain {
glsl += &format!("#define {name} {value}\n");
}
glsl + "#endif\n"
}

/// Deflates every block data table into `OUT_DIR/block-data/`, which
/// `world::block` embeds: the JSON is mostly repeated shape and state data
/// and compresses about twentyfold.
Expand Down
Loading
Loading