Skip to content

WIP: Implement viewing replays on the web#39

Open
dowoge wants to merge 18 commits intomainfrom
web-replay
Open

WIP: Implement viewing replays on the web#39
dowoge wants to merge 18 commits intomainfrom
web-replay

Conversation

@dowoge
Copy link
Member

@dowoge dowoge commented Mar 10, 2026

offstyle tech ™️ commit description coming soon

tommy and others added 17 commits March 10, 2026 00:40
- Add gl-matrix for WebGL matrix math
- Add vite-plugin-wasm for WASM module support
- Configure WASM Vite plugin
- Fix dev proxy cookie handling for auth sessions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pre-built WASM binary and JS bindings for the bhop-replay-viewer
Rust module. Provides BSP map parsing, MDL model loading, VTF texture
decoding, and replay file playback via WebAssembly.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Core rendering and playback engine for the in-browser BSP replay viewer:

- renderer.ts: WebGL renderer with lightmap atlas, texture atlas,
  skybox cubemap, sky depth occlusion, PVS culling, and static prop
  rendering with transparency support
- camera.ts: First-person and free-cam camera with mouse look,
  WASD movement, and smooth replay-following mode
- math.ts: Matrix/vector utilities and Source Engine coordinate helpers
- playback.ts: Replay tick interpolation with speed control, pause,
  scrubbing, and button state decoding
- fetchWithProgress.ts: Streaming download with progress callbacks

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Vue 3 components for the replay viewer interface:

- ReplayViewerOverlay.vue: Main orchestration component handling BSP
  download, WASM parsing, WebGL initialization, and 7-step loading
  progress with fullscreen canvas overlay
- ViewerControls.vue: Playback scrubber, speed selector, camera toggle,
  and keyboard shortcuts with 3-second auto-fade on inactivity
- ViewerHUD.vue: Key press display in ShavitTimer-inspired layout
  showing speed, movement keys (WASD), duck, and jump states
- LoadingModal.vue: Themed loading screen with dual progress bars
  for download and processing steps

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add "View Replay" button to IndividualRecordView when replay is
  available, launching the fullscreen BSP replay viewer overlay
- Update API base URL to use Vite proxy in dev mode for proper
  cookie forwarding and CORS handling
- Reformat API module for consistency

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ed WASM

- Fragment shader: procedural black/purple checkerboard for missing textures
  with proper surface-aligned UVs and lightmap support
- Water render pass: separate draw after opaque geometry with 60% alpha
  and depth writes disabled via uAlphaOverride uniform
- Updated WASM module with $color tinting, water detection, and fog color

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After GPU upload, fetches unresolved textures from the CS:S VPK asset
API, decodes them via WASM, and patches the texture atlas in-place
using texSubImage2D. Textures load in batches of 10 concurrently
with a progress indicator.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Pass force_opaque=true to decode_and_tile_vtf for non-translucent
materials to prevent semi-transparent rendering of wall/floor textures.
Uses VMT $translucent flag to determine when alpha should be preserved.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Updated WASM binary with 4096x4096 lightmap atlas and graceful
overflow handling for large maps.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use fetch_name (cubemap-stripped base name) for external texture URLs
- Add prop fetching step: scan missing props, fetch MDL+VVD+VTX from API
- Re-parse BSP with extras when external props are available
- Updated WASM with parse_bsp_with_extras, missing_props export, and
  pre-allocated atlas slots for unresolved prop textures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Don't force alpha=255 on $alphatest materials (tree leaves, fences)
  so the shader's alpha discard works correctly for cutout rendering
- Updated WASM with prop ambient lighting, bodypart model fix

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant