Files
benilla-octo/crates/benilla/assets/shaders/wmo_skybox.wgsl
T
SamandClaude Fable 5 03aa04e54d no world until a character is in one
- The login screen stops paying for a world nobody is in. It had been
  streaming and simulating all of Elwynn Forest behind a static image — the
  client began life as a terrain viewer and the streamers never had an off
  switch. The world now boots when you enter it, aimed at the map your
  character is actually on, and logging out releases it. Login frame cost:
  p50 18.6 to 10.3 cpu ms, worst paced frame 308 to 20 ms; entering
  Stratholme is a covered 1.2 s load.
- More login-screen honesty: the fullscreen glue image was re-uploaded to
  the GPU every frame — 22 MB a frame for a still picture — and the
  braziers' fire had been invisible since the 25th, simulating perfectly
  into a camera that is off, because two booths had computed the same render
  layer. Both fixed; the flames are back.
- Indoors got truer: the outdoor world draws only through the portal windows
  actually in frame, as the original does; the painted-skybox gate settled
  on the reference's real rule — any sky-flagged room the portal flood
  reaches; and interior objects — gates, hanging signs, chains — take their
  room's baked light, anchored at their box centre instead of an artist
  pivot that often sits under the floor.
- Hovering with a tooltip up takes its full fix: a tooltip content change
  used to run the whole-UI layout solve twice, and it runs once now, on top
  of the morning's fix that made an unchanged tooltip cost nothing at all.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-29 19:54:41 +07:00

41 lines
2.1 KiB
WebGPU Shading Language

// The WMO **skybox** (`wmo_sky.rs`) — the authored sky a building swaps in for the Light.dbc
// gradient dome while the camera stands in one of its `0x40000` groups. Stratholme's burning city is
// the one place 1.12 content reaches this: `StratholmeSkybox.m2`, a static emissive cube whose three
// texture pairs are the painted red sky.
//
// GAMMA LANE (decision 0161): the batches are authored material flags `0x05` = UNLIT (`0x01`) |
// TWO_SIDED (`0x04`), blend 0 (`benilla-extract m2batch`), so the texel's own gamma bytes, unlit and
// unmodulated, is what the *material* asks for.
//
// UNVERIFIED, and flagged as such: we draw it **unfogged** — and the M2 does not set the UNFOGGED bit
// (`0x02`), so by its own authoring this model IS fogged. The no-fog treatment was an analogy with the
// gradient dome, not a byte law: wow-re has `CMapObj+0x12c` (the MOSB pointer) carved with no renderer
// behind it, so nothing yet says which pass this draws in or under what state. An RE dispatch is open
// on exactly that. Do not harden this into a claim before it lands.
//
// SKY-PASS DEPTH (see `sky_order.rs`, "The depth law"): the box is drawn camera-anchored at model
// scale, so its geometry sits *inside* the world — the shell radius must not decide occlusion.
// Forcing the far depth makes it a true backdrop: it fills only the pixels no world geometry claimed.
#import bevy_pbr::{
pbr_fragment::pbr_input_from_standard_material,
forward_io::VertexOutput,
}
/// Reverse-Z "infinitely far" — the sky pass's forced depth (`sky_order.rs`).
const SKY_FAR_DEPTH: f32 = 0.0;
struct WmoSkyboxOutput {
@location(0) color: vec4<f32>,
@builtin(frag_depth) depth: f32,
}
@fragment
fn fragment(in: VertexOutput, @builtin(front_facing) is_front: bool) -> WmoSkyboxOutput {
let pbr_input = pbr_input_from_standard_material(in, is_front);
var out: WmoSkyboxOutput;
// Opaque backdrop: the texel's raw gamma bytes, alpha forced to 1 (the sky art carries none).
out.color = vec4<f32>(pbr_input.material.base_color.rgb, 1.0);
out.depth = SKY_FAR_DEPTH;
return out;
}