Commit Graph

45 Commits

Author SHA1 Message Date
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
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
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
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
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
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
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
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
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
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
9a411e72da feat(asset): add voltex_asset crate with Handle, AssetStorage, and Assets manager
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:29:55 +09:00
c24c60d080 feat(ecs): add scene serialization/deserialization (.vscn format)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:21:11 +09:00
135364ca6d feat(ecs): add WorldTransform propagation through parent-child hierarchy
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:20:46 +09:00
3e475c93dd feat(ecs): add Parent/Children hierarchy with add_child, remove_child, despawn_recursive
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:19:28 +09:00
59753b2264 feat(ecs): add World with type-erased storage, queries, and Transform component
Implements Task 3 (World: spawn/despawn, add/get/remove components, query/query2
with type-erased HashMap<TypeId, Box<dyn ComponentStorage>>) and Task 4 (Transform:
position/rotation/scale with matrix() building T*RotY*RotX*RotZ*S). 25 tests pass.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:07:17 +09:00
2d64d226a2 feat(ecs): add voltex_ecs crate with Entity, EntityAllocator, and SparseSet
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 20:05:15 +09:00
71f6081dc9 feat(renderer): add BMP texture loader and GPU texture upload
Implements parse_bmp (24/32-bit uncompressed BMP to RGBA), GpuTexture with
wgpu 28.0 write_texture API (TexelCopyTextureInfo/TexelCopyBufferLayout),
bind_group_layout, white_1x1 fallback, and 3 BMP parser unit tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:52:35 +09:00
04ca5df062 feat(renderer): add Blinn-Phong shader, light uniforms, mesh pipeline
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:50:51 +09:00
ffd6d3786b feat(renderer): add Camera and FpsController
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:49:23 +09:00
c7d089d970 feat(renderer): implement OBJ parser with triangle/quad support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:49:23 +09:00
78dcc30258 feat(renderer): add MeshVertex, Mesh, and depth buffer support
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:47:59 +09:00
82e3c19b53 feat(math): add Mat4 with transforms, look_at, perspective
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:46:28 +09:00
c644b784a6 feat(math): add Vec2 and Vec4 types
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 19:45:28 +09:00
81ba6f7e5d feat: implement Phase 1 foundation - triangle rendering
- voltex_math: Vec3 with arithmetic ops, dot, cross, length, normalize
- voltex_platform: VoltexWindow (winit wrapper), InputState (keyboard/mouse),
  GameTimer (fixed timestep + variable render loop)
- voltex_renderer: GpuContext (wgpu init), Vertex + buffer layout,
  WGSL shader, render pipeline
- triangle example: colored triangle with ESC to exit

All 13 tests passing. Window renders RGB triangle on dark background.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 19:34:39 +09:00
c5b71b32b7 feat: initialize cargo workspace with voltex_math, voltex_platform, voltex_renderer
Phase 1 Task 1 - workspace scaffolding with stub crates

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 17:47:02 +09:00