feat(render): clouds, foliage wind, additive fog, immediate-mode shadows, Windows fixes#69
Open
proggeramlug wants to merge 4 commits into
Open
feat(render): clouds, foliage wind, additive fog, immediate-mode shadows, Windows fixes#69proggeramlug wants to merge 4 commits into
proggeramlug wants to merge 4 commits into
Conversation
…te-mode, Windows fixes Rendering features behind the shooter's visual pass: - Sky: analytic drifting cloud layer in the procedural-sky shader (env.rs); time fed via the unused SkyUniforms.intensity.y. - Fog: manual height-fog march now runs additively with procedural sky (post.rs) instead of only as the aerial-LUT else-branch, so haze works at sub-km scene scale. - Foliage: wind sway + backlit translucency for alpha-cutout materials in the scene shader (core.rs); wind appended to LightingUniforms (types.rs) with widened UBO visibility (lighting.rs, mod.rs). - Shadows: shadow pass renders immediate-mode + cached-model draws, not just scene nodes (shadow_pass.rs), so immediate-mode games cast shadows. - Device: raise max_sampled_textures/samplers per stage to the adapter max so refractive materials (19 sampled textures) compile (windows). - FFI: bloom_set_bloom_intensity/tonemap/auto_exposure_*, mesh scratch-buffer upload (createMesh i64 ABI fix), drawModelRotated re-export (visual.rs, models.rs, src/*). - Windows build: jolt default features, panic=abort, Jolt libDirs, LTCG off for lld-link (build.rs, Cargo.toml, package.json).
added 3 commits
June 16, 2026 20:53
Trees/grass/leaves cast opaque rest-pose blobs because the shadow pass is depth-only. Added a SECOND shadow pipeline (pipeline_cutout, SHADOW_SHADER_CUTOUT) that samples the caster's base-colour alpha and discards below the material cutoff, so cutout cards drop their real (dappled) shape. The opaque shadow pipeline is byte-identical/untouched — only cutout cached models use the new path. GpuMesh gains a per-mesh cutout shadow bind group (base colour + sampler + cutoff), built in cache_model_if_static for alpha_cutoff>0; shadow_pass.rs selects the pipeline per caster and binds group 1 for cutout entries.
The planar reflection probe only rendered material-system draws, so immediate-mode games (which draw the world via drawModel) got a black/empty probe. Added a single-target reflection pipeline (REFLECT_SCENE_WGSL: base-colour x sun N.L + ambient, alpha-cutout discard) that renders every cached model (trees, house, foliage) into the probe with a mirrored, oblique-clipped VP. Owned bind-group layouts (dynamic per-draw model uniform + sun/ambient); reuses scene_material_bg for base colour. Probe clears to transparent so geometry writes alpha 1 and the water shader blends the probe over its analytic sky dome by alpha. Lazily built on first dispatch; no change to the opaque/main pass.
The planar-reflection scene shader negated the sun dir for N.L, which only matched when the caller passed a below-horizon (travel-direction) sun. Engine convention is direction-TO-sun everywhere (scene diffuse, shadow fit, sky LUT mu_s=sun.y), so use +sun_dir.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rendering features added while building the Bloom Shooter's visual pass on Windows.
Sky
env.rs). Per-pixel view ray projected onto a virtual cloud plane (perspective convergence at the horizon), value-noise fBm coverage, faded near horizon + thinned around the sun. Time is fed through the previously-unusedSkyUniforms.intensity.y(no struct-layout change) so the clouds drift.Fog
post.rs) instead of only as theelseof the aerial-perspective branch. The procedural aerial LUT is km-scaled and negligible over a small (tens-of-metres) scene, so this restores controllable haze at scene scale. Guarded to skip sky pixels.Foliage
core.rs), gated on the cutout flag so opaque geometry is untouched.wind: vec4appended toLightingUniforms(types.rs); UBO visibility widened to VERTEX_FRAGMENT (lighting.rs,mod.rs).Shadows
shadow_pass.rs). Immediate-mode games (drawCube/drawModel) created no scene nodes and so cast no shadows before.Materials / device
max_sampled_textures_per_shader_stage+max_samplers_per_shader_stageto the adapter maximum (windows device request). The refractive material profile binds 19 sampled textures in the fragment stage; the default limit of 16 made it fail to compile.FFI
bloom_set_bloom_intensity/tonemap/auto_exposure_key/auto_exposure_rate; mesh scratch-buffer upload path (works around the createMesh i64 ABI break on Perry 0.5.1171);drawModelRotatedre-export from the main index (visual.rs,models.rs,src/*).Windows build
panic = abort, JoltlibDirs, and LTCG off so lld-link can read the Jolt objects (build.rs,Cargo.toml,package.json).Paired with Bloom-Engine/shooter PR (the visual overhaul that consumes these).