diff options
| author | Valentin Popov <valentin@popov.link> | 2026-11-14 18:58:15 +0300 |
|---|---|---|
| committer | Valentin Popov <valentin@popov.link> | 2026-11-14 18:58:15 +0300 |
| commit | 0d6706145699a51e27e5013f48f59844dc662b9e (patch) | |
| tree | f35fe13a62b478dea6a48ab71c08ad8249091fd0 /apps | |
| parent | 55c4aa3ad801b0599fab9e4f669898d02f38c627 (diff) | |
| download | fparkan-0d6706145699a51e27e5013f48f59844dc662b9e.tar.xz fparkan-0d6706145699a51e27e5013f48f59844dc662b9e.zip | |
fix(render): composite celestial disks behind transparent world
Рисуем диск до полупрозрачной геометрии мира и оставляем ореол поверх. Порядок проверен в тесте очереди, штатный старт миссии 2 запускается с Vulkan validation.
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/fparkan-game/src/main.rs | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/apps/fparkan-game/src/main.rs b/apps/fparkan-game/src/main.rs index 4760a1b0..e176fd13 100644 --- a/apps/fparkan-game/src/main.rs +++ b/apps/fparkan-game/src/main.rs @@ -3132,6 +3132,12 @@ impl EnvironmentGpuScene { ) }) .map(|layer| layer.range.range_index) + .chain(self.sprites.iter().filter_map(|sprite| { + sprite + .flare_index + .is_none() + .then_some(sprite.range.range_index) + })) .collect() } @@ -3516,8 +3522,8 @@ impl EnvironmentGpuScene { ); // Preserve the native sky order while keeping the indexed mesh - // contiguous. The screen gradient must be the first draw, and the - // cloud dome follows all directional sprites. Reordering the range + // contiguous. The screen gradient comes first. Disks are drawn before + // the transparent world queue and flares follow it. Reordering the range // metadata alone would leave first_index values pointing into the old // segment order, so move each index segment together with its range. let range_for_kind = |kind: SkyPassKind| { @@ -3660,10 +3666,9 @@ impl EnvironmentGpuScene { projected_sun, viewport, view_forward: camera.forward(), - // Flares use the same terrain/object ray query as the native - // visibility gate. The sun sprite itself deliberately stays - // independent of this test, matching the native layer's - // `requires_occlusion` split. + // The glare samples world occlusion at the sun's center. The + // disk is behind the transparent world queue so foliage can + // cover it per fragment and leave its cutouts visible. unoccluded: native_sun_unoccluded_with_world( terrain, mesh, |
