Increase header length to 12 bytes, add CompressType and PacketHeader struct, and implement decode_packet_header. Update CMake to find zstd and link against it, adding Findzstd module.
Add `update_player_chunk()` method to `ClientPlayer` that triggers a chunk request when the player moves more than 2 chunks away from the last recorded chunk. Introduce an atomic `m_requesting_chunk` flag in `ClientWorld` to prevent concurrent requests. Rename `m_player_chunk_pos` to `m_last_chunk_pos` for clarity.
Remove monolithic World, Player, Chunk classes. Introduce ClientWorld, ServerWorld, ClientPlayer, and related networked components. Add Abseil dependency for logging and checks. Rename old files to pre_remove_* and update all includes and references accordingly.
Restructure world generation to trigger chunk loading based on player
movement. Replace player name with UUID for identification. Implement
chunk request/response protocol. Improve thread management for gen
thread.
Introduce packet header and ID mapping for protobuf messages.
Refactor session and server_world to use new packet wrapper.
Fix missing semicolons in proto files.
Add Protobuf dependency, define proto messages for player requests, positions, and chunk data. Refactor Session to use strand and async write. Implement player join/exit and position sync in ServerWorld.
* refactor(gameplay): remove unused includes and members, clear vertex data after upload
* feat(shader-tools): add recursive #include support for shader sources
* refactor(shaders): extract noise and sky color functions into shared GLSL includes
* feat(gameplay): implement greedy meshing for chunk generation
Replace the per-face vertex generation with a greedy meshing algorithm that merges adjacent faces of the same block type into larger quads. Introduce `FaceKey` struct and helper functions (`axis_dir_to_face`, `get_block_safe`, `is_face_culled`, `choose_buf`) to support the new algorithm. Comment out the old `gen_vertices` implementation.
In texture management, rename `m_pbr_texture_array` to `m_normal_texture_array` to reflect its actual usage, and set texture wrap mode to `GL_REPEAT` for both the block and normal texture arrays.
* fix(primitive_data): correct back face texture coordinates and tangents
* fix(texture-manager): correct texture deletion and refactor reload
Make hot_reload private and add public need_reload method. Update UI to call need_reload instead of hot_reload. Fix incorrect use of glDeleteBuffers for normal texture array by using glDeleteTextures.
* refactor(chunk): add ChunkInfo and switch to shared_mutex for chunk access
Introduced ChunkInfo struct to expose chunk metadata (position, seed, biome). Replaced std::mutex with std::shared_mutex for chunk map to allow concurrent read access. Added World::get_chunk_info() method. Temporarily disabled cave/river cleanup and debug biome reporting.
* refactor(cave,river,chunk): use ChunkPos as key for paths and track cave existence
* refactor(gameplay): use deterministic origin-based cave and river generation
Compute cave and river paths on-the-fly per chunk from a deterministic origin instead of storing them globally. Remove concurrent hash map storage, shared mutexes, and related cleanup methods. This simplifies concurrency and reduces memory overhead.
* refactor(world): remove unused chunk generation progress tracking
* feat(renderer): add fog effect based on render distance
* refactor(gameplay): remove dead code and simplify chunk neighbor context
Remove the large commented-out `init_chunks()` function, and eliminate the `affected_neighbor` tracking in `gen_chunks_internal()`. This simplifies the neighbor context building and removes unused vertex data regeneration for affected neighbors.
* refactor(gameplay): move chunk generation phases into gen_chunk method
Consolidate multiple phase generation calls into a single gen_chunk() method on Chunk, which handles neighbor generation and ensures thread safety. Simplify World::gen_chunks_internal by using gen_chunk() instead of manual phase orchestration.
* fix(gameplay): use gen_phase_one to get seed
* feat(world): integrate thread pool and async chunk generation
* fix(renderer): correct shader uniform name and remove unused uniform
* feat(gameplay): add temporary chunk flag to prevent path clearing
* fix: add thread safety for cave and river path mutexes
* refactor: remove unused uniforms and set cameraPos uniform outside lambda
* feat(world): add dynamic thread pool resizing
* feat(world): add thread pool size management and UI controls
* feat(world): add ChunkLoadStyle enum and rename chunk_pos to get_chunk_pos
* feat(player): add configurable fly Y speed
* refactor(world): add thread pool start/stop and auto-detect threads
Extract thread pool starting and stopping into dedicated methods. Set default pool threads to 0 to enable automatic detection of available cores, and ensure thread pool is properly managed during world rebuild.
* fix: include shared_mutex header
* fix(gameplay): simplify set_chunk_load_style switch and fix fallthrough bug
* fix(world): add missing include for <utility>
* feat(shaders): add lighting to block accumulation OIT shaders
* feat(renderer): add water rendering with OIT and new shaders
* feat(water): implement screen-space reflection and refraction for water with depth fade and perturbation
* refactor(shader): replace glUniform calls with generic set_loc and remove cached locations
* feat(water): add noise-based caustics and configurable fog density
* fix(water shader): update depth fade and remove underwater check
- Increase DEPTH_FADE_DISTANCE from 8 to 10
- Remove conditional so depth fade always applies
- Darken deepColor from (0, 0.08, 0.15) to (0, 0.015, 0.045)
* feat(underwater): add volume scattering and shadow mapping for light shafts
* feat(rendering): add basic diffuse and ambient lighting to block rendering
* feat(world): add day/night cycle with server tick system
* feat(renderer): make ambient strength adjustable via dev panel
* fix(game_time): use unsigned tick type and enforce positive tick speed
* feat(renderer): add shadow mapping with PCF soft shadows
Introduce shadow mapping using a dedicated depth framebuffer and shader. The block fragment shader now performs percentage-closer filtering (PCF) with Poisson disk sampling and random rotation for soft shadows. The vertex shader outputs light-space coordinates. A new depth shader pair handles rendering from the light's perspective, discarding transparent fragments. The renderer sets up the light projection based on the camera position and sun direction, and applies the shadow factor to diffuse lighting. Day/night cycle can now be toggled off in the world server thread.
* perf(shadow): increase depth map resolution and refine PCF sampling
* feat(dev-panel): add tick freeze toggle and fix TickType sign
Add checkbox to freeze tick advancement in dev panel.
Change TickType from unsigned long long to signed long long to prevent underflow.
* chore(world): add missing <numbers> include
* feat(renderer): add runtime shader and shadow mode controls
Introduce user-controllable shader on/off, shadow mode (rotated Poisson disk, 3x3 grid, or off), light cull face, and discard transparent in depth pass. Expose all settings in new dev panel "shader" tab. Move ambient strength slider to the new tab.
* fix(texture): set texture wrap mode to clamp to edge
* feat(renderer): smooth shadow sun direction transitions using quantized directions and slerp
* feat(renderer): add PCSS shadow mode with configurable samples and softness
Implement Percentage Closer Soft Shadows (PCSS) as shadow mode 3.
Add a FindBlocker function and three Poisson disk arrays (8, 16, 32 samples).
Expose new uniforms (lightSizeUV, minRadius, maxRadius, samples) and provide
slider/combo controls in the dev panel for sample count, light size, and penumbra radius limits.
* feat(renderer): add roughness-based specular lighting to blocks
* feat(renderer): compute ambient and sunlight colors based on sun height
* feat(renderer): add moonlight and smooth day/night light blending
* refactor(renderer): extract day/night calculation and add billboard shaders
Add a new ParallelLight struct to encapsulate lighting parameters.
Move day-night cycle computation from render_world() to a new
day_night_calculation() method. Update sky shaders to use procedural
colors based on sun position. Add separate billboard shaders for sun/moon.
* feat(sky): add animated clouds to sky shader with speed control
* feat(renderer): add configurable cloud thresholds and white mix
* refactor: use TBB for concurrent hash maps and parallelize chunk processing
* fix: tbb link fail
* refactor(chunk): remove biome check for caves in rivers and oceans
* refactor(random): replace std distributions with custom implementations
Avoid overhead and platform-dependent behavior of `<random>` distributions by using direct engine operations and integer arithmetic. This ensures deterministic, cross-platform results and improves performance.
* refactor(generation): use chunk seed for cave and river paths
- Use per-chunk seed instead of global path_id for cave and river generation.
- Remove unused m_sum variables and m_path_id members.
- Clamp river yaw within 10 degrees of initial direction.
- Fix river radius interpolation (use t instead of 1-t).
- Lower sea level from 64 to 63.
* feat(gameplay): add Ocean biome with water generation and heightmap adjustments
- Introduce Ocean biome enum, builder, and detection logic.
- Add ocean water building to all existing biomes and modify heightmap thresholds for low mountainous areas.
- Skip cave and river generation in Ocean (and River) biomes; avoid carving water blocks.
- Comment out border blending call and update block fill logic.
* fix(gameplay): re-enable border blending and protect water in cave gen
* refactor(generation): move ocean water build to later phase
* feat(block): add is_transitional property and refine border blending
* fix(block): set stone block as transitional
* fix(world): generate temporary chunks for surface blend neighbor data
* fix(gameplay): simplify block fill logic in blend_surface_blocks_borders
* refactor(tree): remove debug logging and unused include
* refactor(renderer): centralize VAO setup and rename init_underwater
* refactor(gameplay): replace VBO with VAO for vertex data
* fix(renderer): move depth test enable to world rendering
The `glEnable(GL_DEPTH_TEST)` call was incorrectly placed in the general `render()` function, affecting UI and text rendering. Moved it to the start of the world rendering loop to ensure depth testing is only active during 3D world pass.
* refactor: update water texture
* feat(gameplay): implement transparent block rendering with depth sorting
* fix(world): use camera pos for distance calculations, make water passable
* refactor(player): use ivec3 for block pass check
* feat(camera): add underwater detection
* feat(renderer): add underwater effect with framebuffer post-processing
* feat(block): add gas property and refactor solid block check
* fix(assets): set leaf block transparency to false
* fix(block): set leaf as transparent
* feat: add grass texture and update grass_block texture
* feat: add block data
* feat: add blocks_tool
* feat: add sync info and change function in blocks_tools
* feat: add check and new function
* refactor: make block texture loading data-driven
* feat: add rendering for grass
* feat: passable grass
* feat: random grass place
* fix: memory leak in TextureManager::load_cross_plane_texture