Commit Graph

127 Commits

Author SHA1 Message Date
7a5e06bd24 feat(script): add Lua engine API bindings (spawn, position, entity_count)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 18:30:26 +09:00
3d985ba803 feat(physics): add Coulomb friction to collision response
Add friction coefficient to RigidBody (default 0.5) and implement
tangential impulse clamping in resolve_collisions using Coulomb's law,
including resting-contact friction for sliding bodies.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 18:28:44 +09:00
c196648a2e feat(physics): add GJK/EPA narrow phase for convex shape collision
Implement GJK (Gilbert-Johnson-Keerthi) overlap detection and EPA
(Expanding Polytope Algorithm) penetration resolution for arbitrary
convex collider pairs. Used as the fallback narrow phase for any
combination involving Capsule, while Sphere/Box specialized routines
are preserved for performance.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:25:26 +09:00
534838b7b9 feat(physics): add Capsule collider variant
Add Capsule { radius, half_height } to the Collider enum, with AABB
computation and ray-vs-capsule intersection support. The capsule is
oriented along the Y axis (cylinder + two hemisphere caps).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:25:20 +09:00
1707728094 feat(ecs): add query3 and query4 for multi-component queries
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 18:19:50 +09:00
803df19305 feat(renderer): add PNG decoder with filter reconstruction
Parse PNG files (RGB and RGBA, 8-bit) with full filter reconstruction
(None, Sub, Up, Average, Paeth). Uses the self-contained deflate
decompressor for IDAT chunk decompression.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:18:12 +09:00
051eba85aa feat(renderer): add self-contained deflate decompressor
Implement RFC 1951 Deflate decompression with zlib wrapper handling.
Supports stored blocks, fixed Huffman codes, and dynamic Huffman codes
with LZ77 back-reference decoding.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 18:17:59 +09:00
e8a79e112c feat: complete Voltex Engine + Survivor game
11 crates, 13 examples (including survivor_game), 255 tests
Phase 1-8 fully implemented + playable survival game demo

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:49:24 +09:00
63d5ae2c25 feat(game): add HUD, audio SFX, and game over/restart
Add IMGUI HUD overlay showing HP, wave, score, and enemy count.
Display centered Game Over panel with final score and restart prompt.
Add procedural sine-wave audio clips for shooting (440Hz) and enemy
kills (220Hz) via voltex_audio. Player blinks white during invincibility.
Press R to restart after game over.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:46:41 +09:00
d17732fcd5 feat(game): add collision detection, damage, and scoring
Projectiles destroy enemies on contact (radius check 0.55). Enemies
damage the player on contact with 1s invincibility window. Score +100
per kill. Game over when HP reaches 0. update() now returns FrameEvents
so the caller can trigger audio/visual feedback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:46:34 +09:00
a7cd14f413 feat(game): add enemy spawning with wave system and chase AI
Red sphere enemies spawn at arena edges via a wave system that
escalates each round. Enemies use direct seek steering to chase
the player. Both shadow and color passes render enemies.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:41:34 +09:00
5496525a7f feat(game): add projectile shooting toward mouse aim
Left click fires small yellow sphere projectiles from the player toward
the mouse cursor position on the XZ plane. Includes fire cooldown (0.2s),
projectile lifetime (2.0s), and ray-plane intersection for mouse aiming.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:35:46 +09:00
2f60ace70a feat(game): add player movement with WASD and camera follow
Add blue sphere as the player with WASD movement on XZ plane,
clamped to arena bounds. Camera now tracks player position.
Pre-allocate dynamic UBO buffers for 100 entities to support
future enemies and projectiles.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:27:11 +09:00
83c97faed0 feat(game): add survivor_game with arena and quarter-view camera
Static arena with 20x20 floor and 4 box obstacles rendered using the
forward PBR pipeline with shadow mapping. Fixed quarter-view camera
at (0, 15, 10) looking at origin.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 17:00:55 +09:00
3897bb0510 fix(editor): improve button colors for visible hover/active feedback
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:51:12 +09:00
038398962e fix(editor): replace placeholder font with real 8x12 ASCII bitmap glyphs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:36:19 +09:00
586792b774 docs: add Phase 8-4 editor UI status, spec, and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:26:34 +09:00
2cfb721359 feat(editor): add editor_demo example with IMGUI widgets
Interactive demo showing panel, text, button, slider, and checkbox
widgets rendered via the new UiRenderer pipeline. Uses winit event
loop with mouse input forwarded to UiContext.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:23:31 +09:00
dbaff58a3f feat(editor): add UI renderer pipeline and shader
Add UiRenderer with wgpu render pipeline for 2D UI overlay rendering.
Includes WGSL shader with orthographic projection, alpha blending,
and R8Unorm font atlas sampling. Font pixel (0,0) set to white for
solid-color rect rendering via UV (0,0).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 15:21:18 +09:00
19db4dd390 feat(editor): add voltex_editor crate with IMGUI core (font, draw_list, widgets)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 15:10:53 +09:00
87b9b7c1bd docs: add Phase 8-3 Lua scripting status, spec, and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:42:21 +09:00
6c3ef334fb feat(script): add voltex_script crate with Lua 5.4 FFI and safe wrapper
Compiles Lua 5.4 from source via cc crate (excluding lua.c/luac.c).
Provides ffi bindings, LuaState safe wrapper, and default engine bindings.
All 9 tests pass (exec, globals, register_fn, voltex_print).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:40:53 +09:00
cde271139f docs: add Phase 8-2 networking status, spec, plan, and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:31:14 +09:00
566990b7af feat(net): add UDP server/client with connection management
Adds NetSocket (non-blocking UdpSocket wrapper with local_addr), NetServer
(connection tracking via HashMap, poll/broadcast/send_to_client), and NetClient
(connect/poll/send/disconnect lifecycle). Includes an integration test on
127.0.0.1:0 that validates ClientConnected, Connected, and UserData receipt
end-to-end with 50ms sleeps to ensure UDP packet delivery.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:29:41 +09:00
4519c5c4a6 feat(net): add voltex_net crate with packet serialization
Introduces the voltex_net crate (no external dependencies) with a binary
Packet protocol over UDP. Supports 6 variants (Connect, Accept, Disconnect,
Ping, Pong, UserData) with a 4-byte header (type_id u8, payload_len u16 LE,
reserved u8) and per-variant payload encoding. Includes 7 unit tests covering
all roundtrips and invalid-type error handling.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:29:27 +09:00
e28690b24a docs: add Phase 8-1 AI system status, spec, plan, and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:20:50 +09:00
acaad86aee feat(ai): add steering behaviors (seek, flee, arrive, wander, follow_path)
Implements SteeringAgent and five steering behaviors. truncate() clamps
force magnitude. follow_path() advances waypoints within waypoint_radius
and uses arrive() for the final waypoint. 6 passing tests covering all
behaviors including deceleration and path advancement.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:18:50 +09:00
5d0fc9d8d1 feat(ai): add A* pathfinding on NavMesh triangle graph
Implements find_path() using A* over triangle adjacency with XZ heuristic.
Path starts at the given start point, passes through intermediate triangle
centers, and ends at the goal point. Returns None when points are outside
the mesh or no connection exists. 5 passing tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:18:45 +09:00
49957435d7 feat(ai): add voltex_ai crate with NavMesh (manual triangle mesh)
Introduces the voltex_ai crate with NavMesh, NavTriangle structs and
XZ-plane barycentric point-in-triangle helper. Includes find_triangle,
triangle_center, and edge_midpoint utilities with 4 passing tests.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 14:18:40 +09:00
cddf9540dd fix(renderer): fix RT shadow shader syntax, experimental features, and R32Float sampler compatibility
- Add 'enable wgpu_ray_query' to RT shadow shader
- Fix RayDesc struct constructor syntax and rayQueryGetCommittedIntersection API
- Enable ExperimentalFeatures in GpuContext for RT
- Change RT shadow texture binding to non-filterable (R32Float)
- Use textureLoad instead of textureSample for RT shadow in lighting pass

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 14:06:20 +09:00
b8334ea361 docs: add Phase 7-4 post processing status, spec, plan, and deferred items
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:55:09 +09:00
6c9fc0cbf1 feat(renderer): add HDR + Bloom + ACES tonemap to deferred_demo
Lighting pass now renders to Rgba16Float HDR target. A 5-level bloom
mip chain (downsample with bright-extract threshold, then additive
upsample) feeds into an ACES tonemap pass that composites the final
LDR output to the swapchain surface. All resources resize correctly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 13:53:36 +09:00
4debec43e7 feat(renderer): add bloom/tonemap pipelines and convert lighting to HDR output
- deferred_pipeline.rs: add bloom_bind_group_layout, create_bloom_downsample_pipeline (NO blend),
  create_bloom_upsample_pipeline (additive One+One blend), tonemap_bind_group_layout, create_tonemap_pipeline
- deferred_lighting.wgsl: remove Reinhard tonemap + gamma correction; output raw HDR linear colour
- lib.rs: export new pipeline functions

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-25 13:49:32 +09:00
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