Merge gfx/wet into integration
# Conflicts: # LIGHTING.md # crates/benilla-app/assets/ui/OptionsFrame.xml # crates/benilla-app/src/cvars.rs # crates/benilla-app/src/monkey_gfx.rs # crates/benilla-assets/src/materials.rs # crates/benilla-assets/src/shaders/fog_hook.wgsl # crates/benilla-assets/src/shaders/monkey_frame.wgsl # crates/benilla-world/src/lighting/monkey_frame.rs # crates/benilla-world/src/shaders/static_gx.wgsl
This commit is contained in:
@@ -1627,6 +1627,23 @@ pub(super) const ON_DEMAND: &[Scenario] = &[
|
||||
minute: 1170,
|
||||
ui: None,
|
||||
},
|
||||
// MONKEY (wet): rain on surfaces. Run with rain forced and the ground pre-soaked, e.g.
|
||||
// `WOW_WEATHER=1,0.8 WOW_WETNESS=1 WOW_WET_T=3`, and A/B with `WOW_RAIN_SURFACES=0|1`.
|
||||
// Goldshire's square: the road, the grass, the inn's roofs and walls.
|
||||
Scenario {
|
||||
name: "wet-goldshire", map: Some(MAP_AZEROTH),
|
||||
eye: [-9460.0, 70.0, 59.5], look: [-9452.0, 30.0, 55.0], minute: 720, ui: None,
|
||||
},
|
||||
// The Elwynn river bank, close enough (< 25 yd) for the rain rings.
|
||||
Scenario {
|
||||
name: "wet-river", map: Some(MAP_AZEROTH),
|
||||
eye: [-9514.0, -330.0, 64.0], look: [-9500.0, -352.0, 61.4], minute: 720, ui: None,
|
||||
},
|
||||
// A Stormwind Trade District street: exterior WMO paving, walls, eaves.
|
||||
Scenario {
|
||||
name: "wet-stormwind", map: Some(MAP_AZEROTH),
|
||||
eye: [-8833.38, 628.63, 98.5], look: [-8815.0, 662.0, 93.5], minute: 720, ui: None,
|
||||
},
|
||||
];
|
||||
|
||||
/// MONKEY (p0 baseline): the Elwynn programme view, above the canopy east of Goldshire looking
|
||||
|
||||
@@ -952,6 +952,13 @@ pub(crate) const REGISTERED: &[Registered] = &[
|
||||
"0",
|
||||
"benilla's own: distance fog, 0 Classic (1.12 linear) / 1 Modern (soft, sun-coloured horizon)",
|
||||
),
|
||||
// MONKEY (wet): rain darkens and glosses sky-exposed surfaces and rings the water. Default 1
|
||||
// (only visible while it rains or the ground dries); the Graphics preset's High sets 1.
|
||||
ours(
|
||||
"rainSurfaces",
|
||||
"1",
|
||||
"benilla's own: rain wets sky-exposed surfaces and rings the water, 0 Off / 1 On",
|
||||
),
|
||||
ours(
|
||||
"waterQuality",
|
||||
"1",
|
||||
@@ -3791,6 +3798,9 @@ mod tests {
|
||||
app.init_resource::<benilla_world::ffx_glow::SkyDither>();
|
||||
// MONKEY (fog)
|
||||
app.init_resource::<benilla_world::lighting::FogModelSetting>();
|
||||
// MONKEY (wind)
|
||||
app.init_resource::<benilla_world::wind::FoliageWind>();
|
||||
app.init_resource::<benilla_world::weather::RainSurfaces>(); // MONKEY (wet)
|
||||
app.add_observer(crate::monkey_gfx::on_cvar);
|
||||
},
|
||||
|app| {
|
||||
|
||||
@@ -7,11 +7,13 @@
|
||||
//! | `skyDither` | 0 Off / 1 On | 0 | 1 | `benilla_world::ffx_glow::SkyDither` |
|
||||
//! | `foliageWind` | 0 Off / 1 Grass / 2 Grass + trees | 2 | 2 | `benilla_world::wind::FoliageWind` |
|
||||
//! | `fogModel` | 0 Classic / 1 Modern | 0 | 1 | `benilla_world::lighting::FogModelSetting` |
|
||||
//! | `rainSurfaces` | 0 Off / 1 On | 1 | 1 | `benilla_world::weather::RainSurfaces` |
|
||||
|
||||
use benilla_world::ffx_glow::SkyDither;
|
||||
use benilla_world::lighting::FogModelSetting;
|
||||
use benilla_world::wind::FoliageWind;
|
||||
use bevy::prelude::*;
|
||||
use benilla_world::weather::RainSurfaces; // MONKEY (wet)
|
||||
|
||||
/// The programme's cvar observer (registered by [`MonkeyGfxPlugin`]).
|
||||
pub(crate) fn on_cvar(
|
||||
@@ -20,6 +22,7 @@ pub(crate) fn on_cvar(
|
||||
mut foliage_wind: ResMut<FoliageWind>,
|
||||
// MONKEY (fog)
|
||||
mut fog_model: ResMut<FogModelSetting>,
|
||||
mut rain: ResMut<RainSurfaces>, // MONKEY (wet)
|
||||
) {
|
||||
match ev.key().as_str() {
|
||||
"skydither" => {
|
||||
@@ -43,6 +46,13 @@ pub(crate) fn on_cvar(
|
||||
}
|
||||
// MONKEY (fog): `WOW_FOGMODEL` still wins for the session (captures).
|
||||
"fogmodel" => fog_model.set_from_cvar(ev.num()),
|
||||
// MONKEY (wet): wet surfaces + rain ripples.
|
||||
"rainsurfaces" => {
|
||||
let want = ev.num() >= 0.5;
|
||||
if rain.0 != want {
|
||||
rain.0 = want;
|
||||
}
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
}
|
||||
@@ -56,6 +66,7 @@ impl Plugin for MonkeyGfxPlugin {
|
||||
app.init_resource::<SkyDither>()
|
||||
.init_resource::<FoliageWind>()
|
||||
.init_resource::<FogModelSetting>()
|
||||
.init_resource::<RainSurfaces>() // MONKEY (wet)
|
||||
.add_observer(on_cvar);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user