Implements deferred_gbuffer.wgsl for the geometry pass: samples albedo
and normal map textures, applies TBN normal mapping, and writes world
position, encoded normal, albedo, and material parameters (metallic/
roughness/ao) to 4 separate G-Buffer render targets.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces GBuffer struct with 4 render target TextureViews (position/
normal/albedo/material) plus depth, and a fullscreen oversized triangle
for screen-space passes. Exports format constants and create helpers.
Updates lib.rs with new module declarations and re-exports.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Wires MixerState into mix_sounds (group × master volume applied per sound)
and exposes SetGroupVolume/FadeGroup commands through AudioSystem.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add Play3d and SetListener variants to AudioCommand, expose play_3d
and set_listener methods on AudioSystem, initialize a Listener in
the Windows audio thread, and handle the new commands in the match.
Update mix_sounds call to pass the listener.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add SpatialParams field to PlayingSound, new_3d constructor, and
listener parameter to mix_sounds. Compute per-channel attenuation
and stereo panning when spatial params are present; 2D sounds are
unchanged. Add three new tests: spatial_2d_unchanged,
spatial_far_away_silent, and spatial_right_panning.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Introduces AudioCommand enum (Play, Stop, SetVolume, StopAll, Shutdown)
and AudioSystem that spawns a dedicated audio thread. On Windows the
thread drives WasapiDevice with a 5ms mix-and-write loop; on other
platforms it runs in silent null mode. lib.rs exports wasapi (windows)
and audio_system modules with AudioSystem re-exported at crate root.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements COM vtable structs for IMMDeviceEnumerator, IMMDevice,
IAudioClient, and IAudioRenderClient with correct IUnknown base layout.
WasapiDevice handles COM init, default endpoint activation, mix format
detection (float/i16), shared-mode Initialize (50ms buffer), and
write_samples with GetCurrentPadding/GetBuffer/ReleaseBuffer.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implements resolve_collisions() with impulse-based velocity correction and
Baumgarte-style position correction, plus physics_step() combining integrate,
detect_collisions, and resolve_collisions.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
wgpu's default max_bind_groups is 4 (groups 0-3), but the PBR shader was
using group(4) for BRDF LUT bindings. This merges IBL bindings into the
shadow bind group (group 3) at binding slots 3-4, removes the standalone
IBL bind group layout/creation, and updates all examples accordingly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix pbr_demo, multi_light_demo, and shadow_demo to use the new 7-param
create_pbr_pipeline with PBR texture bind group (4-entry: albedo+normal)
and IBL bind group. Create ibl_demo showcasing a 7x7 metallic/roughness
sphere grid with IBL-based ambient lighting via BRDF LUT integration.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements CPU-based BRDF LUT generation using the split-sum IBL
approximation (Hammersley sampling, GGX importance sampling, Smith
geometry with IBL k=a²/2). Wraps the 256×256 Rgba8Unorm LUT in
IblResources for GPU upload via wgpu 28.0 API.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add Mat4::orthographic() to voltex_math for light projection
- Fix pbr_demo and multi_light_demo to provide shadow bind group (group 3)
required by updated PBR pipeline (dummy shadow with size=0 disables it)
- Create shadow_demo with two-pass rendering: shadow depth pass using
orthographic light projection, then PBR color pass with shadow sampling
- Scene: ground plane, 3 spheres, 2 cubes with directional light
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
WGSL vec3<f32> requires 16-byte alignment, causing the shader to expect
1056 bytes while Rust struct was 1040. Added padding fields to match.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix pbr_demo to use LightsUniform/LightData instead of old LightUniform.
Create multi_light_demo with 5 PBR spheres (varying metallic), a ground
plane, 4 colored orbiting point lights, a directional fill light, and a
spot light from above.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
7x7 grid of spheres demonstrating PBR material variation:
metallic increases along X axis, roughness along Y axis.
Uses dynamic UBO pattern for both camera and material uniforms.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>