Integrate BLAS/TLAS acceleration structures and RT shadow compute pass
into the deferred rendering demo. Adds GpuContext::new_with_features()
for requesting EXPERIMENTAL_RAY_QUERY, Mesh::new_with_usage() for
BLAS_INPUT buffer flags, and extends the lighting shadow bind group
to 9 entries (shadow map + IBL + SSGI + RT shadow).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Adds t_ssgi/s_ssgi bindings (group 2, bindings 5-6) to
lighting_shadow_bind_group_layout and deferred_lighting.wgsl. Replaces the
simple ambient term with SSGI-modulated ambient: ao*ssgi_ao applied to IBL
diffuse+specular, plus ssgi_indirect for indirect color bleeding.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Adds ssgi_shader.wgsl (fullscreen pass: view-space TBN from noise, 64-sample
hemisphere loop with occlusion + color bleeding, outputs vec4(ao, indirect_rgb)).
Adds ssgi_gbuffer_bind_group_layout, ssgi_data_bind_group_layout, and
create_ssgi_pipeline to deferred_pipeline.rs. Exports all three from lib.rs.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Demonstrates two-pass deferred rendering: G-Buffer pass writes position,
normal, albedo, and material to 4 render targets; lighting pass composites
with 8 animated orbiting point lights plus a directional light using a
fullscreen triangle.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Implements deferred_lighting.wgsl for the fullscreen lighting pass:
reads G-Buffer textures, runs the identical Cook-Torrance BRDF functions
(distribution_ggx, geometry_smith, fresnel_schlick, attenuation, etc.)
from pbr_shader.wgsl, computes multi-light contribution with PCF shadow
and IBL, then applies Reinhard tonemapping and gamma correction.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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>