Commit Graph

94 Commits

Author SHA1 Message Date
6d30151be1 feat(renderer): add bloom and tonemap shaders
- bloom_shader.wgsl: fullscreen vertex + fs_downsample (5-tap box + bright extract) + fs_upsample (9-tap tent)
- tonemap_shader.wgsl: fullscreen vertex + fs_main (HDR+bloom combine, exposure, ACES, gamma 1/2.2)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:48:20 +09:00
6c938999e4 feat(renderer): add HDR target, Bloom resources, and ACES tonemap
- Add hdr.rs with HdrTarget (Rgba16Float render target) and HDR_FORMAT constant
- Add bloom.rs with BloomResources (5-level mip chain), BloomUniform, and mip_sizes()
- Add tonemap.rs with TonemapUniform and CPU-side aces_tonemap() for testing
- Export all new types from lib.rs
- 33 tests passing (26 existing + 3 bloom + 4 tonemap)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:47:19 +09:00
ba610f48dc docs: add Phase 7-1 through 7-3 specs and plans
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:25:11 +09:00
643a329338 docs: add Phase 7-3 RT shadows status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:25:00 +09:00
a5c0179793 feat(renderer): add hardware RT shadows to deferred_demo
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>
2026-03-25 13:23:34 +09:00
b556cdd768 feat(renderer): add RT shadow compute pipeline and integrate into lighting pass
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:14:28 +09:00
3a311e14af feat(renderer): add RT shadow resources and compute shader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:14:22 +09:00
e2424bf8c9 feat(renderer): add BLAS/TLAS acceleration structure management for RT
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:14:06 +09:00
71045d8603 docs: add Phase 7-2 SSGI status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:10:21 +09:00
5198e8606f feat(renderer): add SSGI pass to deferred_demo (AO + color bleeding)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 12:08:50 +09:00
3248cd3529 feat(renderer): integrate SSGI output into deferred lighting pass
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>
2026-03-25 12:05:08 +09:00
eea6194d86 feat(renderer): add SSGI shader and pipeline for screen-space GI
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>
2026-03-25 12:05:02 +09:00
3d0657885b feat(renderer): add SSGI resources with hemisphere kernel and noise texture
Adds ssgi.rs with SsgiUniform (repr C, Pod), SsgiResources (output texture,
kernel buffer, 4x4 noise texture, uniform buffer), hemisphere kernel generator
(64 samples, z>=0, center-biased), deterministic noise data (16 rotation
vectors), and 3 unit tests. Exports SsgiResources, SsgiUniform,
SSGI_OUTPUT_FORMAT from lib.rs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 12:04:56 +09:00
3839aade62 docs: add Phase 7-1 deferred rendering status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:55:37 +09:00
49bfa31639 feat(renderer): add deferred_demo example with multi-light deferred rendering
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>
2026-03-25 11:54:01 +09:00
a9b263bf57 feat(renderer): add deferred rendering pipeline (G-Buffer + Lighting pass)
Implements deferred_pipeline.rs with pipeline creation functions:
gbuffer_camera_bind_group_layout (dynamic offset), create_gbuffer_pipeline
(MeshVertex input, 4 color targets), lighting_gbuffer_bind_group_layout
(non-filterable position + filterable rest + NonFiltering sampler),
lighting_lights_bind_group_layout, lighting_shadow_bind_group_layout, and
create_lighting_pipeline (FullscreenVertex, no depth stencil).
All wgpu 28.0 fields (immediate_size, multiview_mask, cache) included.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:49:45 +09:00
f6912be248 feat(renderer): add deferred lighting pass shader with Cook-Torrance BRDF
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>
2026-03-25 11:49:38 +09:00
72fa401420 feat(renderer): add G-Buffer pass shader for deferred rendering
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>
2026-03-25 11:49:32 +09:00
03b1419b17 feat(renderer): add GBuffer and fullscreen triangle for deferred rendering
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>
2026-03-25 11:49:27 +09:00
2b3e3a6a5e docs: add Phase 5-1 through 6-3 specs, plans, and Cargo.lock
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:37:16 +09:00
0991f74275 docs: add Phase 6-3 mixer status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:36:24 +09:00
26e4d7fa4f feat(audio): integrate mixer groups into mixing pipeline and AudioSystem
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>
2026-03-25 11:35:05 +09:00
261e52a752 feat(audio): add MixGroup, GroupState, and MixerState with fade support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:32:33 +09:00
56c5aff483 docs: add Phase 6-2 3D audio status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:28:40 +09:00
7150924d5d feat(audio): add play_3d and set_listener to AudioSystem
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>
2026-03-25 11:27:34 +09:00
bd044c6653 feat(audio): integrate spatial 3D audio into mixing pipeline
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>
2026-03-25 11:27:29 +09:00
4436382baf feat(audio): add 3D audio spatial functions (distance attenuation, stereo panning)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:24:55 +09:00
7ba3d5758b docs: add Phase 6-1 audio system status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:13:18 +09:00
a1a90ae4f8 feat(audio): add audio_demo example with sine wave playback
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 11:11:55 +09:00
6de5681707 feat(audio): add AudioSystem with WASAPI audio thread
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>
2026-03-25 11:10:28 +09:00
4cda9d54f3 feat(audio): add WASAPI FFI bindings for Windows audio output
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>
2026-03-25 11:10:19 +09:00
f52186f732 feat(audio): add mixing functions with volume, looping, and channel conversion
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:59:17 +09:00
f0646c34eb feat(audio): add WAV parser with PCM 16-bit support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:59:13 +09:00
dc12715279 feat(audio): add voltex_audio crate with AudioClip type
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:59:10 +09:00
75ec3b308f docs: add Phase 5-3 raycasting status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 10:49:19 +09:00
67273834d6 feat(physics): add BVH-accelerated raycast with ECS integration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:47:52 +09:00
3f12c4661c feat(physics): add ray intersection tests (AABB, sphere, box)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:46:29 +09:00
d3eead53cf feat(math): add Ray type with direction normalization 2026-03-25 10:45:06 +09:00
102304760e docs: add Phase 5-2 rigid body simulation status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 10:40:13 +09:00
b516984015 feat(physics): add impulse collision response and physics_step
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>
2026-03-25 10:38:42 +09:00
b8c3b6422c feat(physics): add Semi-implicit Euler integration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:36:17 +09:00
9bdb502f8f feat(physics): add RigidBody component and PhysicsConfig 2026-03-25 10:35:16 +09:00
7d91e204cc docs: add Phase 5-1 collision detection status and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 10:27:13 +09:00
c1c84cdbff feat(physics): add detect_collisions ECS integration
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:17:26 +09:00
0570d3c4ba feat(physics): add BVH tree for broad phase collision detection
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:15:24 +09:00
74694315a6 feat(physics): add narrow phase collision detection (sphere-sphere, sphere-box, box-box)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:14:05 +09:00
cc24b19f93 feat(physics): add voltex_physics crate with Collider and ContactPoint
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:12:22 +09:00
8d3855c1a7 feat(math): add AABB type with intersection, merge, and containment
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 10:10:27 +09:00
7d59b1eed5 docs: add project status, deferred items, and CLAUDE.md
- STATUS.md: completed phases, crate structure, test counts, next steps
- DEFERRED.md: simplified/postponed items per phase
- CLAUDE.md: build rules, wgpu quirks, project conventions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:42:49 +09:00
080ac92fbb fix(renderer): merge IBL into group(3) to stay within max_bind_groups limit of 4
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>
2026-03-24 21:38:45 +09:00