mirror of
https://github.com/zhenyan121/Cubed.git
synced 2026-06-21 18:17:03 +08:00
* 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
190 B
190 B