struct Camera { eye: vec4, target_: vec4, screen: vec4, } struct Stage { reveal: f32, } struct Uniforms_quad_stage { screen: vec2, rect: vec4, camera: Camera, look: Stage, } struct Vertex_io { @builtin(position) v0_: vec4, @location(0) v1_: vec2, @location(1) v2_: vec2, } struct VertexIndex { index: u32, } struct ClipPosition { position: vec4, } struct Vertex { position: ClipPosition, uv: vec2, pixel: vec2, } struct stage_out { @location(0) color0_: vec4, } @group(0) @binding(1) var room: texture_2d; @group(0) @binding(2) var linear: sampler; @group(0) @binding(0) var u: Uniforms_quad_stage; @vertex fn quad(@builtin(vertex_index) input0_: u32) -> Vertex_io { var corners: array, 6>; let v0_ = VertexIndex(input0_); let _e5 = vec2(1f, 0f); let _e6 = vec2(0f, 1f); corners = array, 6>(vec2(0f, 0f), _e5, _e6, _e6, _e5, vec2(1f, 1f)); let v21_ = corners[v0_.index]; let v22_ = u.rect; let v24_ = u.rect; let _e23 = (v22_.xy + (v24_.zw * v21_)); let v30_ = u.screen.x; let v37_ = u.screen.y; let _e43 = Vertex(ClipPosition(vec4((((_e23.x / v30_) * 2f) - 1f), (1f - ((_e23.y / v37_) * 2f)), 0f, 1f)), v21_, _e23); return Vertex_io(_e43.position.position, _e43.uv, _e43.pixel); } @fragment fn stage(varyings: Vertex_io) -> stage_out { let v0_1 = Vertex(ClipPosition(varyings.v0_), varyings.v1_, varyings.v2_); let v2_ = u.camera.screen; let v23_ = textureSampleLevel(room, linear, (v0_1.pixel / v2_.xy), 0f); let _e20 = (v23_.xyz * vec3(1.6f)); let v13_ = u.look.reveal; let _e45 = (saturate(((_e20 * ((_e20 * vec3(2.51f)) + vec3(0.03f))) / ((_e20 * ((_e20 * vec3(2.43f)) + vec3(0.59f))) + vec3(0.14f)))) * vec3(v13_)); return stage_out(vec4(_e45.x, _e45.y, _e45.z, 1f)); }