Commit Graph

227 Commits

Author SHA1 Message Date
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
9202bfadef feat: add IBL demo with normal mapping and procedural environment lighting
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>
2026-03-24 21:34:06 +09:00
5232552aa4 feat(renderer): add normal mapping and procedural IBL to PBR shader
- Add tangent input (location 3) and TBN computation in vertex shader
- Add normal map sampling (group 1, bindings 2-3) for tangent-space normal mapping
- Add BRDF LUT binding (group 4, bindings 0-1) for specular IBL
- Add procedural sky environment function for diffuse/specular IBL
- Replace flat ambient with split-sum IBL approximation
- Add pbr_texture_bind_group_layout (4 entries: albedo + normal)
- Add create_pbr_texture_bind_group helper and flat_normal_1x1 texture
- Update create_pbr_pipeline to accept ibl_layout parameter (group 4)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:28:32 +09:00
ea8af38263 feat(renderer): add BRDF LUT generator and IBL resources
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>
2026-03-24 21:19:09 +09:00
4d7ff5a122 feat(renderer): add tangent to MeshVertex with computation in OBJ parser and sphere generator
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 21:18:26 +09:00
88fabf2905 docs: add Phase 4c normal mapping + IBL implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:16:39 +09:00
5f962f376e feat: add shadow demo with directional light shadow mapping and 3x3 PCF
- 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>
2026-03-24 21:09:27 +09:00
8f962368e9 feat(renderer): integrate shadow map sampling with 3x3 PCF into PBR shader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 21:03:31 +09:00
b5a6159526 feat(renderer): add ShadowMap, shadow depth shader, and shadow pipeline
Implements ShadowMap (2048x2048 Depth32Float texture with comparison sampler),
shadow_shader.wgsl (depth-only vertex shader), shadow_pipeline (front-face
culling, depth bias constant=2/slope=2.0), and associated uniform types.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 21:01:51 +09:00
1ce6acf80c docs: add Phase 4b-2 shadow mapping implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 21:00:03 +09:00
62f505c838 fix(renderer): align LightsUniform to match WGSL vec3 padding (1056 bytes)
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>
2026-03-24 20:57:10 +09:00
fdfe4aaf5f feat: add multi-light demo with orbiting point lights and spot light
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>
2026-03-24 20:55:24 +09:00
b0934970b9 feat(renderer): add multi-light system with LightsUniform and updated PBR shader
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:50:13 +09:00
297b3c633f docs: add Phase 4b-1 multi-light implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:48:06 +09:00
07497c3d80 feat: add PBR demo with metallic/roughness sphere grid
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>
2026-03-24 20:44:29 +09:00
b09e1df878 feat(renderer): add PBR material, sphere generator, Cook-Torrance shader, and PBR pipeline
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:41:02 +09:00
cca50c8bc2 docs: add Phase 4a PBR rendering implementation plan
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:38:54 +09:00
b0c51aaa45 feat: add asset_demo with Handle-based mesh management
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 20:33:03 +09:00