MONKEY (p0): WGSL fixes found by the world-scene run
naga_oil refuses a composable-module identifier that naga's namer would rewrite (a trailing digit gets a '_'), which failed every pipeline that imports monkey_frame / enhanced_water (models, WMOs, liquid invisible). MonkeyFrame rows are renamed fog_a..fog_d, wind_a/b, wet_a (same order and layout), and enhanced_water's padding member _sh_c16 becomes _sh_quad. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8f39296513
commit
dff6556867
+7
-7
@@ -65,13 +65,13 @@ is its own module, documented in `WATER.md`.
|
||||
|
||||
| row | x | y | z | w |
|
||||
|---|---|---|---|---|
|
||||
| `fog0` | height_fog_density | height_fog_height | height_fog_falloff | curve_blend |
|
||||
| `fog1` | sun_fog r | g | b | sun_fog_strength |
|
||||
| `fog2` | end_fog r | g | b | end_fog_distance |
|
||||
| `fog3` | fog_model (0 classic, 1 modern) | sun_fog_angle | 0 | 0 |
|
||||
| `wind0` | dir_x | dir_y | speed | gust |
|
||||
| `wind1` | time_s | sway_strength | grass_strength | tree_strength |
|
||||
| `wet0` | rain_rate | wetness | ripple_time_s | snow |
|
||||
| `fog_a` | height_fog_density | height_fog_height | height_fog_falloff | curve_blend |
|
||||
| `fog_b` | sun_fog r | g | b | sun_fog_strength |
|
||||
| `fog_c` | end_fog r | g | b | end_fog_distance |
|
||||
| `fog_d` | fog_model (0 classic, 1 modern) | sun_fog_angle | 0 | 0 |
|
||||
| `wind_a` | dir_x | dir_y | speed | gust |
|
||||
| `wind_b` | time_s | sway_strength | grass_strength | tree_strength |
|
||||
| `wet_a` | rain_rate | wetness | ripple_time_s | snow |
|
||||
| `misc` | bender_count | time_of_day 0..1 | night 0..1 | 0 |
|
||||
| `benders[8]` | world x | world y | world z | radius |
|
||||
|
||||
|
||||
@@ -54,13 +54,13 @@ struct WaterParams {
|
||||
const MONKEY_ROW: u32 = 533u;
|
||||
fn water_monkey() -> monkey_frame::MonkeyFrame {
|
||||
var m: monkey_frame::MonkeyFrame;
|
||||
m.fog0 = water_light[MONKEY_ROW + 0u];
|
||||
m.fog1 = water_light[MONKEY_ROW + 1u];
|
||||
m.fog2 = water_light[MONKEY_ROW + 2u];
|
||||
m.fog3 = water_light[MONKEY_ROW + 3u];
|
||||
m.wind0 = water_light[MONKEY_ROW + 4u];
|
||||
m.wind1 = water_light[MONKEY_ROW + 5u];
|
||||
m.wet0 = water_light[MONKEY_ROW + 6u];
|
||||
m.fog_a = water_light[MONKEY_ROW + 0u];
|
||||
m.fog_b = water_light[MONKEY_ROW + 1u];
|
||||
m.fog_c = water_light[MONKEY_ROW + 2u];
|
||||
m.fog_d = water_light[MONKEY_ROW + 3u];
|
||||
m.wind_a = water_light[MONKEY_ROW + 4u];
|
||||
m.wind_b = water_light[MONKEY_ROW + 5u];
|
||||
m.wet_a = water_light[MONKEY_ROW + 6u];
|
||||
m.misc = water_light[MONKEY_ROW + 7u];
|
||||
for (var i = 0u; i < 8u; i++) { m.benders[i] = water_light[MONKEY_ROW + 8u + i]; }
|
||||
return m;
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
// `mix(fog_rgb, rgb, factor)`. The expressions below are the ones the receivers carried, in the
|
||||
// same order, so the classic result is bit-identical.
|
||||
//
|
||||
// Extension point for the FOG lane: `fog_sample` branches on `mf.fog3.x` (`MonkeyFrame.fog_model`,
|
||||
// Extension point for the FOG lane: `fog_sample` branches on `mf.fog_d.x` (`MonkeyFrame.fog_model`,
|
||||
// 0 classic / 1 modern). The modern arm currently returns the classic result.
|
||||
|
||||
#import benilla::monkey_frame::MonkeyFrame
|
||||
@@ -39,9 +39,9 @@ fn fog_sample(
|
||||
mf: MonkeyFrame,
|
||||
) -> vec4<f32> {
|
||||
let classic = vec4<f32>(fog_rgb, fog_linear(eye_z, span));
|
||||
if (mf.fog3.x > 0.5) {
|
||||
if (mf.fog_d.x > 0.5) {
|
||||
// FOG lane: the modern model (height / sun / end-colour / curve fog) goes here, reading
|
||||
// mf.fog0..fog3. Until it lands, the modern arm is the classic law.
|
||||
// mf.fog_a..fog_d. Until it lands, the modern arm is the classic law.
|
||||
return classic;
|
||||
}
|
||||
return classic;
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
//
|
||||
// Coordinates are Bevy world space (Y up, 1 unit = 1 yd), the space of the receivers'
|
||||
// `world_position`: WoW `(x, y, z)` is Bevy `(-y, z, -x)` (`benilla_assets::coords::wow_to_bevy`).
|
||||
// Member names carry no trailing digit: naga_oil refuses a composable-module identifier that
|
||||
// naga's namer would rewrite (`fog0` -> `fog0_`), so the rows are `fog_a..fog_d`, `wind_a/b`, `wet_a`.
|
||||
struct MonkeyFrame {
|
||||
fog0: vec4<f32>, // height_fog_density, height_fog_height (world Y, yd), height_fog_falloff, curve_blend
|
||||
fog1: vec4<f32>, // sun_fog_rgb (gamma 0..1), sun_fog_strength
|
||||
fog2: vec4<f32>, // end_fog_rgb (gamma 0..1), end_fog_distance (yd)
|
||||
fog3: vec4<f32>, // fog_model (0 classic, 1 modern), sun_fog_angle (cos), 0, 0
|
||||
wind0: vec4<f32>, // dir_x, dir_y (unit, world XZ: .x = world x, .y = world z), speed (yd/s), gust 0..1
|
||||
wind1: vec4<f32>, // time_s, sway_strength, grass_strength, tree_strength
|
||||
wet0: vec4<f32>, // rain_rate 0..1, wetness 0..1, ripple_time_s, snow 0..1
|
||||
fog_a: vec4<f32>, // height_fog_density, height_fog_height (world Y, yd), height_fog_falloff, curve_blend
|
||||
fog_b: vec4<f32>, // sun_fog_rgb (gamma 0..1), sun_fog_strength
|
||||
fog_c: vec4<f32>, // end_fog_rgb (gamma 0..1), end_fog_distance (yd)
|
||||
fog_d: vec4<f32>, // fog_model (0 classic, 1 modern), sun_fog_angle (cos), 0, 0
|
||||
wind_a: vec4<f32>, // dir_x, dir_y (unit, world XZ: .x = world x, .y = world z), speed (yd/s), gust 0..1
|
||||
wind_b: vec4<f32>, // time_s, sway_strength, grass_strength, tree_strength
|
||||
wet_a: vec4<f32>, // rain_rate 0..1, wetness 0..1, ripple_time_s, snow 0..1
|
||||
misc: vec4<f32>, // bender_count, time_of_day 0..1 (packer), night 0..1 (packer), 0
|
||||
benders: array<vec4<f32>, 8>, // world xyz (Bevy space) + radius (yd); the first bender_count are live
|
||||
}
|
||||
|
||||
@@ -14,13 +14,13 @@
|
||||
//!
|
||||
//! | row | xyz / x,y,z | w |
|
||||
//! |---|---|---|
|
||||
//! | 0 `fog0` | height_fog_density, height_fog_height, height_fog_falloff | curve_blend |
|
||||
//! | 1 `fog1` | sun_fog_rgb | sun_fog_strength |
|
||||
//! | 2 `fog2` | end_fog_rgb | end_fog_distance |
|
||||
//! | 3 `fog3` | fog_model (0 classic, 1 modern), sun_fog_angle, 0 | 0 |
|
||||
//! | 4 `wind0` | dir_x, dir_y, speed | gust |
|
||||
//! | 5 `wind1` | time_s, sway_strength, grass_strength | tree_strength |
|
||||
//! | 6 `wet0` | rain_rate, wetness, ripple_time_s | snow |
|
||||
//! | 0 `fog_a` | height_fog_density, height_fog_height, height_fog_falloff | curve_blend |
|
||||
//! | 1 `fog_b` | sun_fog_rgb | sun_fog_strength |
|
||||
//! | 2 `fog_c` | end_fog_rgb | end_fog_distance |
|
||||
//! | 3 `fog_d` | fog_model (0 classic, 1 modern), sun_fog_angle, 0 | 0 |
|
||||
//! | 4 `wind_a` | dir_x, dir_y, speed | gust |
|
||||
//! | 5 `wind_b` | time_s, sway_strength, grass_strength | tree_strength |
|
||||
//! | 6 `wet_a` | rain_rate, wetness, ripple_time_s | snow |
|
||||
//! | 7 `misc` | bender_count, time_of_day 0..1, night 0..1 | 0 |
|
||||
//! | 8-15 `benders` | world x, y, z | radius |
|
||||
//!
|
||||
@@ -38,7 +38,7 @@ pub const MONKEY_FRAME_ROWS: usize = 16;
|
||||
/// How many benders (grass/foliage pushers: the player and nearby units) the block carries.
|
||||
pub const MAX_BENDERS: usize = 8;
|
||||
|
||||
/// The fog model selector, `fog3.x`.
|
||||
/// The fog model selector, `fog_d.x`.
|
||||
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
|
||||
pub enum FogModel {
|
||||
/// Today's linear 1.12 fog, byte-identical.
|
||||
|
||||
Reference in New Issue
Block a user