HD split into modules (#45, fork patch 26); clouds no longer jump at x or z = 0 (patch 27)
build / mod (push) Successful in 3m21s
build / mod (push) Successful in 3m21s
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
+36
-7
@@ -19,9 +19,13 @@ Horizon действует правило clean-room. Исключение — P
|
|||||||
|
|
||||||
| Что | Где |
|
| Что | Где |
|
||||||
|---|---|
|
|---|---|
|
||||||
| Весь HD-конвейер: цели, проходы, WGSL-шейдеры (строками), тайлы света, AO, тени, bloom, tonemap, TAA | `horizon/crates/horizon-client/src/gfx/hd.rs` |
|
| Оркестровка HD: `Hd`, общие цели, буфер кадра, `resize`/`write`, сборка шейдеров (`assemble`: прелюдия + тело), контракты цвета/глубины/альф/времени (комментарий в начале файла) | `horizon/crates/horizon-client/src/gfx/hd/mod.rs` |
|
||||||
| Объёмные облака (рэймарч слоя, тени облаков на землю) и объёмный туман (лучи света через тени каскадов), их цели и проходы; CPU-шум (2D, 3D Worley) | `horizon/crates/horizon-client/src/gfx/hd_volumes.rs`, `hd_noise.rs` |
|
| Униформ кадра `HdFrame` (Rust) и сцена `HdScene`/`HdLight`/`HdSettings`, свет солнца/луны/облаков (`light_of`, `cloud_light`); общая WGSL-прелюдия (`HdFrame`, `FullOut`, `vs_full`) | `gfx/hd/frame.rs`, `gfx/hd/prelude.wgsl` |
|
||||||
| Атмосфера: сборка текстуры неба (WGSL), чтение неба/дымки/тона света в шейдерах, цвет солнца (`sun_transmittance`) | `horizon/crates/horizon-client/src/gfx/hd_sky.rs` (+ `THIRD_PARTY_PHOTON.md`) |
|
| Тени (каскады, `Shadows`, `cascades()`); G-буфер (`GBuffer`, форматы) | `gfx/hd/shadows.rs`; `gfx/hd/gbuffer.rs` |
|
||||||
|
| AO (GTAO + блюр); освещение `fs_light` (+ тайлы источников: `tiles.rs`); вода (проход геометрии и композит) | `gfx/hd/ao.rs` + `ao.wgsl`, `ao_blur.wgsl`; `gfx/hd/lighting.rs` + `light.wgsl`, `gfx/hd/tiles.rs`; `gfx/hd/water.rs` + `water.wgsl` |
|
||||||
|
| TAA/TAAU и джиттер; bloom; tonemap (+ `Hd::finish`) | `gfx/hd/taa.rs` + `taa.wgsl`; `gfx/hd/bloom.rs` + `bloom.wgsl`; `gfx/hd/tonemap.rs` + `tonemap.wgsl` |
|
||||||
|
| Объёмные облака (рэймарч слоя, тени облаков на землю) и объёмный туман, их цели и проходы; CPU-шум (2D, 3D Worley) | `gfx/hd/volumes.rs` + `cloud_common.wgsl`, `cloud.wgsl`, `cloud_shadow.wgsl`, `fog.wgsl`; `gfx/hd/noise.rs` |
|
||||||
|
| Атмосфера: сборка текстуры неба (WGSL), чтение неба/дымки/тона света в шейдерах, цвет солнца (`sun_transmittance`) | `gfx/hd/sky.rs` + `sky.wgsl`, `sky_funcs.wgsl` (+ `THIRD_PARTY_PHOTON.md`) |
|
||||||
| Встраивание в кадр: G-буфер-проход, каскады теней, вызовы `hd.light` / `hd.finish`, джиттер, тайминги | `horizon/crates/horizon-client/src/gfx.rs` (`Renderer::render`, ищи `hd_on`, `AirDef fork:`) |
|
| Встраивание в кадр: G-буфер-проход, каскады теней, вызовы `hd.light` / `hd.finish`, джиттер, тайминги | `horizon/crates/horizon-client/src/gfx.rs` (`Renderer::render`, ищи `hd_on`, `AirDef fork:`) |
|
||||||
| G-буфер террейна: `fs_gbuffer`, `fs_shadow` | `horizon/crates/horizon-client/src/terrain.wgsl` |
|
| G-буфер террейна: `fs_gbuffer`, `fs_shadow` | `horizon/crates/horizon-client/src/terrain.wgsl` |
|
||||||
| G-буфер сущностей и моделей мода: `fs_entity_gbuffer`, `fs_entity_shadow` | `horizon/crates/horizon-client/src/entity.wgsl` |
|
| G-буфер сущностей и моделей мода: `fs_entity_gbuffer`, `fs_entity_shadow` | `horizon/crates/horizon-client/src/entity.wgsl` |
|
||||||
@@ -120,6 +124,28 @@ Bind groups кэшируются и пересоздаются только пр
|
|||||||
|
|
||||||
Композит воды (`WATER`, group 0): 0 `HdFrame`, 1 `lit`, 2 глубина G-буфера, 3 цвет воды, 4 нормаль воды, 5 глубина воды, 6–7 тени, 8 лайтмап, 9 сэмплер, 10 текстура неба. Проход неба (`SKY_PASS`, group 0): только `HdFrame`.
|
Композит воды (`WATER`, group 0): 0 `HdFrame`, 1 `lit`, 2 глубина G-буфера, 3 цвет воды, 4 нормаль воды, 5 глубина воды, 6–7 тени, 8 лайтмап, 9 сэмплер, 10 текстура неба. Проход неба (`SKY_PASS`, group 0): только `HdFrame`.
|
||||||
|
|
||||||
|
## Контракты (цвет, глубина, альфа, время)
|
||||||
|
|
||||||
|
Полная таблица «проход: что читает → что пишет» — в начале `gfx/hd/mod.rs`, подробности — в начале файла каждого прохода.
|
||||||
|
|
||||||
|
- **Цвет.** От освещения до tonemap всё в «показанном» пространстве ванили (гамма, основные цвета Rec. 709), значения могут быть > 1
|
||||||
|
(`Rgba16Float`); tonemap не трогает ≤ 0.8. Исключения: текстура неба — линейная яркость Rec. 709 (марш в Rec. 2020; показывают
|
||||||
|
читатели через `sky_show`); albedo G-буфера — `Rgba8Unorm` в том же показанном пространстве.
|
||||||
|
- **Глубина.** Камера: reversed-Z, `Depth32Float`, 1 — близко, 0 — далеко/ничего (очистка в 0; глубина воды 0 — воды нет). Тени:
|
||||||
|
обычная Z ортопроекции света (0 — у света, 1 — далеко), сравнение `<=`.
|
||||||
|
- **Альфа.** albedo.a — эмиссия (свет добавляет `rgb·a·1.5`); `lit.a`: 1 — обычный пиксель, 0.5 — вода (в rgb дно без воздуха),
|
||||||
|
0.6 — прозрачное перед водой; `air.a` — пропускание воздуха; облака и туман: `a` — пропускание (`c·a + rgb`); вода: цвет.a —
|
||||||
|
свет блоков, нормаль.a — свет неба; история TAA: a — дистанция; AO: x — окклюзия, y — дистанция.
|
||||||
|
- **Координаты.** Позиции относительно камеры; для узоров (волны, шум облаков, ветер) мировая координата передаётся по модулю периода
|
||||||
|
(256, 65536). Мировая проекция с джиттером; `prev_view_proj` — с джиттером для `fs_taa` и без для `fs_taau` (выбирает `Hd::write`).
|
||||||
|
- **Время.** Три разных часа: счётчик кадров (`params.w`, mod 64, вращение шума), время воды (`water.y`, секунды стенных часов mod 600),
|
||||||
|
игровое время (`clouds.w`, секунды `HdScene.seconds` mod 300000, ветер облаков). Реплей, замораживающий игровое время, не
|
||||||
|
останавливает воду.
|
||||||
|
- **Истории.** Две цели TAA и две цели облаков принадлежат своим проходам, создаются в `resize`, сбрасываются при resize, телепорте
|
||||||
|
(> 64 блоков), выключенном TAA; один `Hd` обслуживает одну камеру, истории разных камер не смешиваются.
|
||||||
|
- **Размеры.** world — масштабированная цель мира (G-буфер, AO ½, свет, вода, облака/туман ½), out — окно (TAA, bloom, tonemap).
|
||||||
|
- **Bind groups** кэшируются по видам, которые читают; пересоздаются при resize и смене входного вида; нет роста в установившемся кадре.
|
||||||
|
|
||||||
## Как проверять
|
## Как проверять
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@@ -129,8 +155,10 @@ cargo test -p horizon-client --lib hd # naga-разбор всех HD-ш
|
|||||||
cd ../airdef-mod && cargo horizon-mod build && cargo test # мод и его шейдер
|
cd ../airdef-mod && cargo horizon-mod build && cargo test # мод и его шейдер
|
||||||
```
|
```
|
||||||
|
|
||||||
WGSL-ошибки в `hd.rs` всплывают только в рантайме — поэтому каждый новый шейдер добавляй в naga-тест
|
WGSL-ошибки всплывают только в рантайме — поэтому каждый новый шейдер добавляй в список `shaders()` в тестах
|
||||||
`lighting_shader_parses`.
|
`gfx/hd/mod.rs`: `lighting_shader_parses` (naga-разбор каждого итогового шейдера), `every_wgsl_file_is_tested` (каждый `.wgsl`
|
||||||
|
входит в проверенный шейдер), `bindings_match_the_layouts` (привязки WGSL = `*_BINDINGS` в Rust: номера, виды, размерности),
|
||||||
|
`frame_layout_matches_the_prelude` (поля и размер `HdFrame` в Rust и в прелюдии).
|
||||||
|
|
||||||
Игра офскрин (только одна копия за раз; данные в `run-home/`, мир `Polygon`):
|
Игра офскрин (только одна копия за раз; данные в `run-home/`, мир `Polygon`):
|
||||||
|
|
||||||
@@ -190,11 +218,12 @@ HORIZON_HD_TAA=0 --out run-home-bench/out/taa-off` — A/B; `--baseline run-home
|
|||||||
| #35: ванильные облака (HD-облака выключены) красятся закатным цветом в собственном проходе (`hd::vanilla_cloud_tint` → цвет в `clouds::Input`), эвристика по глубине G-буфера убрана из `fs_light` | готово | в рабочем дереве форка |
|
| #35: ванильные облака (HD-облака выключены) красятся закатным цветом в собственном проходе (`hd::vanilla_cloud_tint` → цвет в `clouds::Input`), эвристика по глубине G-буфера убрана из `fs_light` | готово | в рабочем дереве форка |
|
||||||
| #37: воздух (ванильный туман, aerial, объёмный туман, лучи, ореолы) на воде считается до **поверхности** и кладётся один раз поверх готовой воды: `fs_light` пишет во вторую цель `air` (рассеяние + пропускание), `fs_water` применяет её после поглощения | готово | в рабочем дереве форка |
|
| #37: воздух (ванильный туман, aerial, объёмный туман, лучи, ореолы) на воде считается до **поверхности** и кладётся один раз поверх готовой воды: `fs_light` пишет во вторую цель `air` (рассеяние + пропускание), `fs_water` применяет её после поглощения | готово | в рабочем дереве форка |
|
||||||
| #36: ванильная вода не рисует цвет в HD (`fs_translucent` при `Globals.hd_flags.x`, глубину оставляет); прозрачное перед водой (`d` ближе `wd`) не отключает HD-воду: вода считается на освещённом дне и добавляется к сцене с весом 0.7; преломление не берёт тексели с таким прозрачным (`textureGather` по альфе) | готово (проверены стекло; частицы и scale 0.67 не проверялись) | в рабочем дереве форка |
|
| #36: ванильная вода не рисует цвет в HD (`fs_translucent` при `Globals.hd_flags.x`, глубину оставляет); прозрачное перед водой (`d` ближе `wd`) не отключает HD-воду: вода считается на освещённом дне и добавляется к сцене с весом 0.7; преломление не берёт тексели с таким прозрачным (`textureGather` по альфе) | готово (проверены стекло; частицы и scale 0.67 не проверялись) | в рабочем дереве форка |
|
||||||
|
| #45: `gfx/hd.rs` разделён на модуль `gfx/hd/` (по файлу на проход: `shadows`, `gbuffer`, `ao`, `sky`, `volumes`, `lighting`+`tiles`, `water`, `taa`, `bloom`, `tonemap`, `frame`), WGSL вынесен в `.wgsl` (`include_str!`, общая прелюдия), у каждого прохода своя структура ресурсов/пайплайнов; контракты цвета, глубины, альф и времени записаны в `hd/mod.rs` и в начале файлов проходов; тесты привязок и размера `HdFrame`. Вид не менялся (сверка `tools/hd_bench.py`) | готово | в рабочем дереве форка |
|
||||||
| #39: веер восхода `vanilla_sunrise_weight` отсекается до цикла по 16 треугольникам выше горизонта (знак x стороны солнца и наклон ≤ α/3; проверено перебором 200 тыс. лучей без пропусков); `hd lighting` на рассвете 5.3 → 3.3 мс (M-серия, 2560×1440) | готово | в рабочем дереве форка |
|
| #39: веер восхода `vanilla_sunrise_weight` отсекается до цикла по 16 треугольникам выше горизонта (знак x стороны солнца и наклон ≤ α/3; проверено перебором 200 тыс. лучей без пропусков); `hd lighting` на рассвете 5.3 → 3.3 мс (M-серия, 2560×1440) | готово | в рабочем дереве форка |
|
||||||
|
|
||||||
## План (по порядку) и ТЗ
|
## План (по порядку) и ТЗ
|
||||||
|
|
||||||
Каждый пункт — самостоятельная задача. Перед началом прочитай `hd.rs` целиком.
|
Каждый пункт — самостоятельная задача. Перед началом прочитай `gfx/hd/mod.rs` (контракты) и файл нужного прохода.
|
||||||
|
|
||||||
1. **TAAU — временной апскейлер** (поверх TAA) — СДЕЛАНО (патч 18, см. статус; масштаб — `HORIZON_HD_SCALE`, переопределяет «масштаб разрешения» настроек Horizon только для HD; поля в `HdSettings` нет). Осталось: LOD-bias текстур террейна, MetalFX. Исходное ТЗ: Мир и G-буфер рендерятся в `render_scale` (например 0.67),
|
1. **TAAU — временной апскейлер** (поверх TAA) — СДЕЛАНО (патч 18, см. статус; масштаб — `HORIZON_HD_SCALE`, переопределяет «масштаб разрешения» настроек Horizon только для HD; поля в `HdSettings` нет). Осталось: LOD-bias текстур террейна, MetalFX. Исходное ТЗ: Мир и G-буфер рендерятся в `render_scale` (например 0.67),
|
||||||
TAA-проход восстанавливает полное разрешение: история в полном разрешении, текущий кадр семплируется с учётом
|
TAA-проход восстанавливает полное разрешение: история в полном разрешении, текущий кадр семплируется с учётом
|
||||||
@@ -266,7 +295,7 @@ HORIZON_HD_TAA=0 --out run-home-bench/out/taa-off` — A/B; `--baseline run-home
|
|||||||
- **Облака (24).** Слой 192.33…264.33 блока (`CLOUD_BASE/CLOUD_THICKNESS`), ветер 3 блока/с (`CLOUD_WIND`), шум — текстуры, сгенерированные на CPU при создании HD (`hd_noise.rs`: 2D 256² покрытие/форма, 3D 64³ Worley). Плотность — по `clouds_cumulus_density` Photon (порог покрытия × форма, «яйцо» по высоте, эрозия Worley, резкий верх), рассеяние — `clouds_cumulus_scattering` (октавы, пудра, фазы). Цвет света — `cloud_light` (Rust): пропускание атмосферы на высоте солнца; солнце светит облакам до −0.2 по высоте, дальше луна. Воздушная перспектива `exp(−d/3600)` к цвету дымки. История сбрасывается при resize, телепорте и без TAA. Опция ванильных облаков «выкл» → `frame.clouds` пуст → нет ни облаков, ни теней. Тень: `cloud_shadow` в `fs_light` (карта оптической толщины; гаснет при солнце ниже ~0.1–0.25 по высоте).
|
- **Облака (24).** Слой 192.33…264.33 блока (`CLOUD_BASE/CLOUD_THICKNESS`), ветер 3 блока/с (`CLOUD_WIND`), шум — текстуры, сгенерированные на CPU при создании HD (`hd_noise.rs`: 2D 256² покрытие/форма, 3D 64³ Worley). Плотность — по `clouds_cumulus_density` Photon (порог покрытия × форма, «яйцо» по высоте, эрозия Worley, резкий верх), рассеяние — `clouds_cumulus_scattering` (октавы, пудра, фазы). Цвет света — `cloud_light` (Rust): пропускание атмосферы на высоте солнца; солнце светит облакам до −0.2 по высоте, дальше луна. Воздушная перспектива `exp(−d/3600)` к цвету дымки. История сбрасывается при resize, телепорте и без TAA. Опция ванильных облаков «выкл» → `frame.clouds` пуст → нет ни облаков, ни теней. Тень: `cloud_shadow` в `fs_light` (карта оптической толщины; гаснет при солнце ниже ~0.1–0.25 по высоте).
|
||||||
- **Туман (25).** `fs_fog`: 18 шагов, плотность `fog_sigma` (высотная дымка от y=62, масштаб 42; утренний туман — пока солнце на «утренней» стороне и низко; пятна из 3D-шума; дождь; затухание ниже y≈28–58, чтобы не светить в пещерах), свет — Photon-смесь двух HG, «вечернее свечение» ×1…3. Старые 14 шагов лучей остаются при `HORIZON_HD_VOLFOG=0`; ореолы вокруг источников мода — всегда.
|
- **Туман (25).** `fs_fog`: 18 шагов, плотность `fog_sigma` (высотная дымка от y=62, масштаб 42; утренний туман — пока солнце на «утренней» стороне и низко; пятна из 3D-шума; дождь; затухание ниже y≈28–58, чтобы не светить в пещерах), свет — Photon-смесь двух HG, «вечернее свечение» ×1…3. Старые 14 шагов лучей остаются при `HORIZON_HD_VOLFOG=0`; ореолы вокруг источников мода — всегда.
|
||||||
- **Тайминги.** Метки Metal (`HORIZON_SHADER_PACK_TIMING=1`, Hills, 2560×1440): `hd clouds` ≈ 6 мс (завышено: метка ловит ожидание соседних проходов), `hd cloud shadows` 0.2–3 (шум), `hd fog` ≈ 1.3. По среднему кадру GPU «оба выкл → оба вкл»: +0.2…3.7 мс (замеры шумные: рядом шла чужая игра на том же GPU). Как удешевить: у облаков — длина шага (14) и потолок шагов (26) в `fs_cloud`, 3 шага света, 4 октавы, облака в четверть разрешения; у тумана — `FOG_STEPS`.
|
- **Тайминги.** Метки Metal (`HORIZON_SHADER_PACK_TIMING=1`, Hills, 2560×1440): `hd clouds` ≈ 6 мс (завышено: метка ловит ожидание соседних проходов), `hd cloud shadows` 0.2–3 (шум), `hd fog` ≈ 1.3. По среднему кадру GPU «оба выкл → оба вкл»: +0.2…3.7 мс (замеры шумные: рядом шла чужая игра на том же GPU). Как удешевить: у облаков — длина шага (14) и потолок шагов (26) в `fs_cloud`, 3 шага света, 4 октавы, облака в четверть разрешения; у тумана — `FOG_STEPS`.
|
||||||
- **Разработка шейдеров.** `HORIZON_HD_SHADER_DIR=<папка>`: каждый HD-шейдер читается из `<папка>/<метка>.wgsl` (записывается из встроенного, если файла нет) — правки видны после перезапуска игры без пересборки; готовое переносится в константы вручную.
|
- **Разработка шейдеров.** `HORIZON_HD_SHADER_DIR=<папка>`: каждый HD-шейдер читается из `<папка>/<метка>.wgsl` (записывается из встроенного, если файла нет; это тело без прелюдии, она добавляется всегда) — правки видны после перезапуска игры без пересборки; готовое переносится в `gfx/hd/*.wgsl` вручную.
|
||||||
- **Слабые места.** Облака не отражаются в воде (SSR берёт небо без облаков); не закрывают далёкую землю выше слоя (только небо); карта теней облаков ±1200 блоков и почти не работает при солнце ниже ~10°; туман не знает рельефа (только высоту над y=62); нет перистых облаков; на быстром повороте камеры история облаков отбрасывается (кратковременный шум).
|
- **Слабые места.** Облака не отражаются в воде (SSR берёт небо без облаков); не закрывают далёкую землю выше слоя (только небо); карта теней облаков ±1200 блоков и почти не работает при солнце ниже ~10°; туман не знает рельефа (только высоту над y=62); нет перистых облаков; на быстром повороте камеры история облаков отбрасывается (кратковременный шум).
|
||||||
|
|
||||||
## Заметки по исправлениям #35–#41 (преемнику)
|
## Заметки по исправлениям #35–#41 (преемнику)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 3de7a6875140a107e28563cc44489b55f5794517 Mon Sep 17 00:00:00 2001
|
From 3de7a6875140a107e28563cc44489b55f5794517 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 12:37:45 +0300
|
Date: Wed, 28 Oct 2026 12:37:45 +0300
|
||||||
Subject: [PATCH 01/25] Mod API (AirDef fork): world models, client particles,
|
Subject: [PATCH 01/27] Mod API (AirDef fork): world models, client particles,
|
||||||
sounds, ground heights
|
sounds, ground heights
|
||||||
|
|
||||||
render.set-models draws block models with an interpolated pose per id;
|
render.set-models draws block models with an interpolated pose per id;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From a6d64e6415bf618539af464e521091e72b72d72f Mon Sep 17 00:00:00 2001
|
From a6d64e6415bf618539af464e521091e72b72d72f Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 12:39:45 +0300
|
Date: Wed, 28 Oct 2026 12:39:45 +0300
|
||||||
Subject: [PATCH 02/25] cargo-horizon-mod: report particles and sounds
|
Subject: [PATCH 02/27] cargo-horizon-mod: report particles and sounds
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From ee79b3562feebe51959a01f1585a9e85bd53ccb5 Mon Sep 17 00:00:00 2001
|
From ee79b3562feebe51959a01f1585a9e85bd53ccb5 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 13:33:10 +0300
|
Date: Wed, 28 Oct 2026 13:33:10 +0300
|
||||||
Subject: [PATCH 03/25] Mod API (AirDef fork): full-screen post pass for mods
|
Subject: [PATCH 03/27] Mod API (AirDef fork): full-screen post pass for mods
|
||||||
|
|
||||||
render.set-post compiles a mod's WGSL after a prelude (camera matrices,
|
render.set-post compiles a mod's WGSL after a prelude (camera matrices,
|
||||||
time, 256 vec4 of params, the world's colour and depth) and runs it after
|
time, 256 vec4 of params, the world's colour and depth) and runs it after
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 2b137dbbedd540daeebc7f5e387847aeb56a1355 Mon Sep 17 00:00:00 2001
|
From 2b137dbbedd540daeebc7f5e387847aeb56a1355 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 22:09:30 +0300
|
Date: Wed, 28 Oct 2026 22:09:30 +0300
|
||||||
Subject: [PATCH 04/25] Mod models: draw far models as scaled impostors past
|
Subject: [PATCH 04/27] Mod models: draw far models as scaled impostors past
|
||||||
the far plane, cull at 4096
|
the far plane, cull at 4096
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From c8ebca6e0af68630e65211844b34d25c5b985c03 Mon Sep 17 00:00:00 2001
|
From c8ebca6e0af68630e65211844b34d25c5b985c03 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 22:31:00 +0300
|
Date: Wed, 28 Oct 2026 22:31:00 +0300
|
||||||
Subject: [PATCH 05/25] Mod cameras: render.set-views draws the world from
|
Subject: [PATCH 05/27] Mod cameras: render.set-views draws the world from
|
||||||
other points into pictures that HUD view shapes show (API level 9)
|
other points into pictures that HUD view shapes show (API level 9)
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 8d2261fc4f8072c32e454139cfea7a8c0cd9d664 Mon Sep 17 00:00:00 2001
|
From 8d2261fc4f8072c32e454139cfea7a8c0cd9d664 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 23:08:21 +0300
|
Date: Wed, 28 Oct 2026 23:08:21 +0300
|
||||||
Subject: [PATCH 06/25] Mods: more fuel per tick and per event (AirDef plans
|
Subject: [PATCH 06/27] Mods: more fuel per tick and per event (AirDef plans
|
||||||
raids)
|
raids)
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 6c548de34def8e4a624d734243418090798bd16a Mon Sep 17 00:00:00 2001
|
From 6c548de34def8e4a624d734243418090798bd16a Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Wed, 28 Oct 2026 23:25:29 +0300
|
Date: Wed, 28 Oct 2026 23:25:29 +0300
|
||||||
Subject: [PATCH 07/25] Mod cameras up to 1920x1080 (full-screen replays)
|
Subject: [PATCH 07/27] Mod cameras up to 1920x1080 (full-screen replays)
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
---
|
---
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 9b9e93269d67401cc620567a884d5ce97f68d76e Mon Sep 17 00:00:00 2001
|
From 9b9e93269d67401cc620567a884d5ce97f68d76e Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 11:15:11 +0300
|
Date: Thu, 29 Oct 2026 11:15:11 +0300
|
||||||
Subject: [PATCH 08/25] Mod cameras: distant terrain tiles, fog measured from
|
Subject: [PATCH 08/27] Mod cameras: distant terrain tiles, fog measured from
|
||||||
the camera, no impostors while one is shown
|
the camera, no impostors while one is shown
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 065d9fa02966238a5bd9ff460392a1a809db0b11 Mon Sep 17 00:00:00 2001
|
From 065d9fa02966238a5bd9ff460392a1a809db0b11 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 11:25:45 +0300
|
Date: Thu, 29 Oct 2026 11:25:45 +0300
|
||||||
Subject: [PATCH 09/25] Mods: game.world-id, so mods keep state per world (API
|
Subject: [PATCH 09/27] Mods: game.world-id, so mods keep state per world (API
|
||||||
level 9)
|
level 9)
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 1bf28135fd9a31f837323dc3a8d81ed73343d816 Mon Sep 17 00:00:00 2001
|
From 1bf28135fd9a31f837323dc3a8d81ed73343d816 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 12:01:08 +0300
|
Date: Thu, 29 Oct 2026 12:01:08 +0300
|
||||||
Subject: [PATCH 10/25] cargo-horizon-mod: trial runs behind feature full, so a
|
Subject: [PATCH 10/27] cargo-horizon-mod: trial runs behind feature full, so a
|
||||||
packing-only tool skips wasmtime
|
packing-only tool skips wasmtime
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0a56f5616df4699588cbcc529d4720661baa810f Mon Sep 17 00:00:00 2001
|
From 0a56f5616df4699588cbcc529d4720661baa810f Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 13:18:43 +0300
|
Date: Thu, 29 Oct 2026 13:18:43 +0300
|
||||||
Subject: [PATCH 11/25] HD lighting: G-buffer pass, per-pixel mod point lights
|
Subject: [PATCH 11/27] HD lighting: G-buffer pass, per-pixel mod point lights
|
||||||
in HDR, bloom and tone curve; render.set-lights and render.set-lighting (API
|
in HDR, bloom and tone curve; render.set-lights and render.set-lighting (API
|
||||||
level 10)
|
level 10)
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 9ebf0031fe9ba6b7f02afb26e4fd3a1ba4ddb0d0 Mon Sep 17 00:00:00 2001
|
From 9ebf0031fe9ba6b7f02afb26e4fd3a1ba4ddb0d0 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 13:59:43 +0300
|
Date: Thu, 29 Oct 2026 13:59:43 +0300
|
||||||
Subject: [PATCH 12/25] HD lighting stage 2: sun and moon shadow cascades, the
|
Subject: [PATCH 12/27] HD lighting stage 2: sun and moon shadow cascades, the
|
||||||
world relit (sun by face angle and shadow, sky and block light through the
|
world relit (sun by face angle and shadow, sky and block light through the
|
||||||
lightmap), light shafts and halos, fog over it again, a light colour grade
|
lightmap), light shafts and halos, fog over it again, a light colour grade
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 7a5a38f68923aec62f10bfa0df50b436474ed612 Mon Sep 17 00:00:00 2001
|
From 7a5a38f68923aec62f10bfa0df50b436474ed612 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 16:19:53 +0300
|
Date: Thu, 29 Oct 2026 16:19:53 +0300
|
||||||
Subject: [PATCH 13/25] HD: bind groups cached until a resize or a new source,
|
Subject: [PATCH 13/27] HD: bind groups cached until a resize or a new source,
|
||||||
shadow passes draw only the entities that cast shadows
|
shadow passes draw only the entities that cast shadows
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 8020811e57d4b5a9ea1cd72d30ce859dc5095d35 Mon Sep 17 00:00:00 2001
|
From 8020811e57d4b5a9ea1cd72d30ce859dc5095d35 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 16:25:44 +0300
|
Date: Thu, 29 Oct 2026 16:25:44 +0300
|
||||||
Subject: [PATCH 14/25] HD: lights culled per 16x16 tile (surface and halo
|
Subject: [PATCH 14/27] HD: lights culled per 16x16 tile (surface and halo
|
||||||
lists built on the CPU), a naga test for the lighting shaders
|
lists built on the CPU), a naga test for the lighting shaders
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 72d3fddfea329e578162656151350f0aa2efd323 Mon Sep 17 00:00:00 2001
|
From 72d3fddfea329e578162656151350f0aa2efd323 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 16:43:36 +0300
|
Date: Thu, 29 Oct 2026 16:43:36 +0300
|
||||||
Subject: [PATCH 15/25] HD: GPU time per pass in the F3 timing list,
|
Subject: [PATCH 15/27] HD: GPU time per pass in the F3 timing list,
|
||||||
half-resolution GTAO with a depth-aware blur
|
half-resolution GTAO with a depth-aware blur
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 1fd83a821bf270879d8ece5aa583f200ed920d89 Mon Sep 17 00:00:00 2001
|
From 1fd83a821bf270879d8ece5aa583f200ed920d89 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 17:02:02 +0300
|
Date: Thu, 29 Oct 2026 17:02:02 +0300
|
||||||
Subject: [PATCH 16/25] HD: shadows draw only sun-facing quads and skip buried
|
Subject: [PATCH 16/27] HD: shadows draw only sun-facing quads and skip buried
|
||||||
sections, the far cascade every second frame; TAA (Halton jitter,
|
sections, the far cascade every second frame; TAA (Halton jitter,
|
||||||
reprojection by depth, YCoCg variance clipping) before bloom
|
reprojection by depth, YCoCg variance clipping) before bloom
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 1502d359d599228fe0f44ce6b99a3fded2ac5ea0 Mon Sep 17 00:00:00 2001
|
From 1502d359d599228fe0f44ce6b99a3fded2ac5ea0 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 17:02:02 +0300
|
Date: Thu, 29 Oct 2026 17:02:02 +0300
|
||||||
Subject: [PATCH 17/25] Mods: model handles (render.model-id, model-generation,
|
Subject: [PATCH 17/27] Mods: model handles (render.model-id, model-generation,
|
||||||
set-models-by-id; API level 11) so mods send no model names each tick;
|
set-models-by-id; API level 11) so mods send no model names each tick;
|
||||||
clear-post and set-lighting documented
|
clear-post and set-lighting documented
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 0f9d99b8ad3e4b72e621d84c2396cf1d3d2b7a33 Mon Sep 17 00:00:00 2001
|
From 0f9d99b8ad3e4b72e621d84c2396cf1d3d2b7a33 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 17:19:57 +0300
|
Date: Thu, 29 Oct 2026 17:19:57 +0300
|
||||||
Subject: [PATCH 18/25] HD: temporal upscaling (HORIZON_HD_SCALE: world,
|
Subject: [PATCH 18/27] HD: temporal upscaling (HORIZON_HD_SCALE: world,
|
||||||
G-buffer and lighting at a lower size, rebuilt to the window in the TAA
|
G-buffer and lighting at a lower size, rebuilt to the window in the TAA
|
||||||
pass); fix flickering shadows near the player (the near cascade lost its
|
pass); fix flickering shadows near the player (the near cascade lost its
|
||||||
sections on frames the far one was held, the held far matrix ignored the
|
sections on frames the far one was held, the held far matrix ignored the
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 38250c4392e27d5700842ca6ee47291dd1831b72 Mon Sep 17 00:00:00 2001
|
From 38250c4392e27d5700842ca6ee47291dd1831b72 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 17:47:52 +0300
|
Date: Thu, 29 Oct 2026 17:47:52 +0300
|
||||||
Subject: [PATCH 19/25] HD water: its own pass (colour, normal, depth), the
|
Subject: [PATCH 19/27] HD water: its own pass (colour, normal, depth), the
|
||||||
floor under it lit, a composite with world-space waves, refraction with depth
|
floor under it lit, a composite with world-space waves, refraction with depth
|
||||||
absorption in the biome colour, screen-space reflections, Fresnel and a
|
absorption in the biome colour, screen-space reflections, Fresnel and a
|
||||||
shadowed sun glint (HORIZON_HD_WATER=0 to switch off)
|
shadowed sun glint (HORIZON_HD_WATER=0 to switch off)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From dbc6f8a6e9c2eeabe1de15f1794013c90be7faa5 Mon Sep 17 00:00:00 2001
|
From dbc6f8a6e9c2eeabe1de15f1794013c90be7faa5 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 17:56:04 +0300
|
Date: Thu, 29 Oct 2026 17:56:04 +0300
|
||||||
Subject: [PATCH 20/25] HD water: no vanilla texture on the surface (the biome
|
Subject: [PATCH 20/27] HD water: no vanilla texture on the surface (the biome
|
||||||
colour only), a darker, deeper colour
|
colour only), a darker, deeper colour
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 13e74537dd6e63482e3613e0e416de1158944dfe Mon Sep 17 00:00:00 2001
|
From 13e74537dd6e63482e3613e0e416de1158944dfe Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 18:38:19 +0300
|
Date: Thu, 29 Oct 2026 18:38:19 +0300
|
||||||
Subject: [PATCH 21/25] HD sky and light: a physical atmosphere (Rayleigh, Mie,
|
Subject: [PATCH 21/27] HD sky and light: a physical atmosphere (Rayleigh, Mie,
|
||||||
ozone; constants and transmittance after Photon, MIT) for the sky, haze, fog
|
ozone; constants and transmittance after Photon, MIT) for the sky, haze, fog
|
||||||
and water reflections; warmer sunlight from the atmosphere's transmittance, a
|
and water reflections; warmer sunlight from the atmosphere's transmittance, a
|
||||||
gentle sky-coloured ambient, soft PCSS-lite shadows near the player, a haze
|
gentle sky-coloured ambient, soft PCSS-lite shadows near the player, a haze
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 6277e051a89c2537570982f6ef275887193c05cf Mon Sep 17 00:00:00 2001
|
From 6277e051a89c2537570982f6ef275887193c05cf Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 19:02:16 +0300
|
Date: Thu, 29 Oct 2026 19:02:16 +0300
|
||||||
Subject: [PATCH 22/25] HD water: a darker blue, a little clearer, ripples a
|
Subject: [PATCH 22/27] HD water: a darker blue, a little clearer, ripples a
|
||||||
little higher
|
little higher
|
||||||
|
|
||||||
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 982265d21bb9d74ec0040db03feb5a55762286ad Mon Sep 17 00:00:00 2001
|
From 982265d21bb9d74ec0040db03feb5a55762286ad Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 21:41:48 +0300
|
Date: Thu, 29 Oct 2026 21:41:48 +0300
|
||||||
Subject: [PATCH 23/25] HD: Photon-style sunsets (Rec. 2020 atmosphere, sun
|
Subject: [PATCH 23/27] HD: Photon-style sunsets (Rec. 2020 atmosphere, sun
|
||||||
tint, blue hour; MIT), volumetric clouds with ground shadows instead of
|
tint, blue hour; MIT), volumetric clouds with ground shadows instead of
|
||||||
vanilla's in HD, volumetric fog with sun shafts and morning mist
|
vanilla's in HD, volumetric fog with sun shafts and morning mist
|
||||||
(HORIZON_HD_CLOUDS=0, HORIZON_HD_VOLFOG=0)
|
(HORIZON_HD_CLOUDS=0, HORIZON_HD_VOLFOG=0)
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From 24971b3c67d8c87673eb2e0d204cedf8a2f46d1c Mon Sep 17 00:00:00 2001
|
From 24971b3c67d8c87673eb2e0d204cedf8a2f46d1c Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 21:43:22 +0300
|
Date: Thu, 29 Oct 2026 21:43:22 +0300
|
||||||
Subject: [PATCH 24/25] Mods: world queries for simulations (render.query-rays,
|
Subject: [PATCH 24/27] Mods: world queries for simulations (render.query-rays,
|
||||||
query-sections, world-changes; API level 12): block-exact rays and section
|
query-sections, world-changes; API level 12): block-exact rays and section
|
||||||
occupancy by collision, sight or sound, answered next tick within budgets,
|
occupancy by collision, sight or sound, answered next tick within budgets,
|
||||||
and a log of changed sections
|
and a log of changed sections
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
From fdec4960983bdff82f3793460f9a5234f0cd3f49 Mon Sep 17 00:00:00 2001
|
From fdec4960983bdff82f3793460f9a5234f0cd3f49 Mon Sep 17 00:00:00 2001
|
||||||
From: chexit <chexit@duck.com>
|
From: chexit <chexit@duck.com>
|
||||||
Date: Thu, 29 Oct 2026 22:56:15 +0300
|
Date: Thu, 29 Oct 2026 22:56:15 +0300
|
||||||
Subject: [PATCH 25/25] HD fixes: rain level from the world not from rain
|
Subject: [PATCH 25/27] HD fixes: rain level from the world not from rain
|
||||||
geometry (#41), TAA history on the jittered grid (#38), vanilla cloud tint
|
geometry (#41), TAA history on the jittered grid (#38), vanilla cloud tint
|
||||||
without a depth heuristic (#35), air fog once over water (#37), translucent
|
without a depth heuristic (#35), air fog once over water (#37), translucent
|
||||||
things in front of HD water (#36), cheaper sunrise fan (#39), halos in thick
|
things in front of HD water (#36), cheaper sunrise fan (#39), halos in thick
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,52 @@
|
|||||||
|
From 8d4cadbf8534309ac847d34e229f6d764770475d Mon Sep 17 00:00:00 2001
|
||||||
|
From: chexit <chexit@duck.com>
|
||||||
|
Date: Thu, 29 Oct 2026 23:22:19 +0300
|
||||||
|
Subject: [PATCH 27/27] HD clouds: noise scales that divide the camera's
|
||||||
|
65536-block wrap, so the clouds and their shadows no longer jump at x or z =
|
||||||
|
0
|
||||||
|
|
||||||
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
||||||
|
---
|
||||||
|
crates/horizon-client/src/gfx/hd/cloud_common.wgsl | 12 +++++++-----
|
||||||
|
1 file changed, 7 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/crates/horizon-client/src/gfx/hd/cloud_common.wgsl b/crates/horizon-client/src/gfx/hd/cloud_common.wgsl
|
||||||
|
index 393ea564b..e2352f008 100644
|
||||||
|
--- a/crates/horizon-client/src/gfx/hd/cloud_common.wgsl
|
||||||
|
+++ b/crates/horizon-client/src/gfx/hd/cloud_common.wgsl
|
||||||
|
@@ -21,6 +21,8 @@ fn dampen(x: f32) -> f32 {
|
||||||
|
}
|
||||||
|
|
||||||
|
// Where a camera-relative point lies in the world's cloud pattern (the wind moves the pattern).
|
||||||
|
+// The camera's x, z come wrapped to 65536 blocks: every noise scale below must divide that (powers
|
||||||
|
+// of two), or the pattern jumps where the wrap happens (at x or z = 0).
|
||||||
|
fn cloud_xz(pos: vec3<f32>) -> vec2<f32> {
|
||||||
|
return vec2<f32>(pos.x + frame.cloud_cam.x, pos.z + frame.cloud_cam.y)
|
||||||
|
+ vec2<f32>(0.8, 0.6) * (CLOUD_WIND * frame.clouds.w);
|
||||||
|
@@ -33,8 +35,8 @@ fn cloud_density(pos: vec3<f32>, detail: f32) -> f32 {
|
||||||
|
let h = (pos.y - frame.clouds.x) / frame.clouds.y;
|
||||||
|
if h <= 0.0 || h >= 1.0 { return 0.0; }
|
||||||
|
let w = cloud_xz(pos);
|
||||||
|
- let cover = textureSampleLevel(noise2, repeat_s, w / 16000.0, 0.0).r;
|
||||||
|
- let shape = textureSampleLevel(noise2, repeat_s, w / 3000.0, 0.0).g;
|
||||||
|
+ let cover = textureSampleLevel(noise2, repeat_s, w / 16384.0, 0.0).r;
|
||||||
|
+ let shape = textureSampleLevel(noise2, repeat_s, w / 4096.0, 0.0).g;
|
||||||
|
let cu = mix(0.56, 0.80, cover) + frame.cloud_cam.z;
|
||||||
|
var d = linear_step(1.0 - cu, 1.0, shape);
|
||||||
|
// Carve an egg shape, thin out the bottom.
|
||||||
|
@@ -43,9 +45,9 @@ fn cloud_density(pos: vec3<f32>, detail: f32) -> f32 {
|
||||||
|
if d < 0.002 { return 0.0; }
|
||||||
|
if detail > 0.0 {
|
||||||
|
let p3 = vec3<f32>(w.x, pos.y, w.y);
|
||||||
|
- let warp = (textureSampleLevel(noise3, repeat_s, p3 / 1100.0, 0.0).b - 0.5) * 0.4;
|
||||||
|
- let w0 = 1.0 - textureSampleLevel(noise3, repeat_s, p3 / 420.0 + vec3<f32>(warp), 0.0).r;
|
||||||
|
- let w1 = 1.0 - textureSampleLevel(noise3, repeat_s, p3 / 90.0 + vec3<f32>(warp * 3.0), 0.0).g;
|
||||||
|
+ let warp = (textureSampleLevel(noise3, repeat_s, p3 / 1024.0, 0.0).b - 0.5) * 0.4;
|
||||||
|
+ let w0 = 1.0 - textureSampleLevel(noise3, repeat_s, p3 / 512.0 + vec3<f32>(warp), 0.0).r;
|
||||||
|
+ let w1 = 1.0 - textureSampleLevel(noise3, repeat_s, p3 / 64.0 + vec3<f32>(warp * 3.0), 0.0).g;
|
||||||
|
let fade = 0.20 * smoothstep(0.85, 1.0, 1.0 - h) - 0.35 * smoothstep(0.05, 0.5, h) + 0.6;
|
||||||
|
d -= 0.55 * w0 * w0 * dampen(1.0 - d);
|
||||||
|
d -= 0.45 * w1 * w1 * dampen(1.0 - d) * fade;
|
||||||
|
--
|
||||||
|
2.54.0 (Apple Git-157)
|
||||||
|
|
||||||
Reference in New Issue
Block a user