Commit graph

922 commits

Author SHA1 Message Date
Kelsi
7ca9caa212 Fix Windows ARM64 build: disable x86 asm in StormLib's libtomcrypt
StormLib's bundled libtomcrypt uses x86 inline assembly (bswapl/movl)
gated by __MINGW32__, which is defined on CLANGARM64 too. Pass
-DLTC_NO_BSWAP to force portable C byte-swap fallback.
2026-02-25 03:06:06 -08:00
Kelsi
9b90ab0429 Revert terrain_manager to original finalizeTile to fix water rendering
The incremental advanceFinalization state machine broke water rendering
in ways that couldn't be resolved. Reverted to the original monolithic
finalizeTile approach. The other performance optimizations (bone SSBO
pre-allocation, WMO distance culling, M2 adaptive distance tiers)
are kept.
2026-02-25 02:50:36 -08:00
Kelsi
7dd78e2c0a Fix missing water by finalizing each tile completely per frame
Phase-splitting across frames caused water surfaces to not render
correctly. Changed processReadyTiles to run all phases for each tile
before moving to the next, with time budget checked between tiles.
2026-02-25 02:47:37 -08:00
Kelsi
0b6f5a9313 Add new preview video to README 2026-02-25 02:36:50 -08:00
Kelsi
d47ae2a110 Fix city stuttering with incremental tile finalization and GPU optimizations
Replace monolithic finalizeTile() with a phased state machine that spreads
GPU upload work across multiple frames (TERRAIN→M2→WMO→WATER→AMBIENT→DONE).
Each advanceFinalization() call does one bounded unit of work within the
per-frame time budget, eliminating 50-300ms frame hitches when entering cities.

Additional performance improvements:
- Pre-allocate bone SSBOs at M2 instance creation instead of lazily during
  first render frame, preventing hitches when many skinned characters appear
- Enable WMO distance culling (800 units) with active-group exemption so
  the player's current floor/neighbors are never culled
- Add 4-tier adaptive M2 render distance (250/400/600/1000 based on count)
- Remove dead PendingM2Upload queue code superseded by incremental system

Fix tile re-enqueueing bug: keep tiles in pendingTiles until committed to
loadedTiles (not when moved to finalizingTiles_) so streamTiles() doesn't
re-enqueue tiles mid-finalization. Also handle unloadTile() for tiles in
the finalizingTiles_ deque to prevent orphaned water/M2/WMO resources.
2026-02-25 02:36:23 -08:00
Kelsi
8fe53171eb Fix release packaging and macOS stack overflow crash
- Fix StormLib package name: libstormlib-dev → libstorm-dev (correct
  Ubuntu package name) across all CI workflows and extract_assets.sh
- Build StormLib from source on Windows CI (no MSYS2 package exists),
  ensuring asset_extract.exe is included in release archives
- Update extract_assets.sh/.ps1 to prefer pre-built asset_extract
  binary next to the script (release archives) before trying build dir
- Move ADTTerrain allocations from stack to heap in prepareTile() to
  fix stack overflow on macOS (worker threads default to 512 KB stack,
  two ADTTerrain structs ≈ 560 KB exceeded that)
2026-02-25 01:55:16 -08:00
Kelsi
624744da86 Fix Windows release packaging: replace rsync/7z with cp/zip
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
MSYS2 doesn't have rsync or 7z by default. Use cp -r for assets
and install zip package for archive creation.
2026-02-24 05:46:45 -08:00
Kelsi
e31c2ffda8 Add GitHub Release workflow with asset extraction tools
Tag-triggered (v*) workflow that builds all 5 platforms and creates
a GitHub Release with bundled binaries, Data/, and asset extraction
tools (asset_extract, extraction scripts, pipeline GUI).
2026-02-24 05:04:37 -08:00
Kelsi
d045c1215a Fix Warden module parsing and DBC loading for Classic expansion
Warden: copy/skip pair order was reversed — format is [copy][data][skip]
per MaNGOS/TrinityCore, not [skip][copy][data]. All copy sizes read as 0,
causing module load failure and server disconnect.

DBC: when binary DBCs aren't available (no MPQ extraction), fall back to
expansion CSV files even for visual DBCs (CreatureDisplayInfo, CharSections,
ItemDisplayInfo, etc.) instead of failing with "DBC not found".
2026-02-24 04:42:36 -08:00
Kelsi
60c26a17aa Fix audio playback not stopping when Stop button clicked
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Use spawn context for clean subprocess isolation and add kill() fallback
after terminate() to ensure the audio process is reliably stopped.
2026-02-23 22:26:17 -08:00
Kelsi
55faacef96 Add M2/WMO 3D viewer with textured rendering, animation, and audio playback
- New tools/m2_viewer.py: Pygame/OpenGL viewer for M2 models (textured
  rendering, skeletal animation, orbit camera) and WMO buildings
- M2 viewer: per-batch texture mapping, CPU vertex skinning, animation
  playback with play/pause/speed controls, wireframe overlay toggle
- WMO viewer: root+group file parsing (MOTX/MOMT/MOVT/MOVI/MONR/MOTV/MOBA),
  per-batch material rendering with BLP textures
- Asset browser: "Open 3D Viewer" buttons for M2 and WMO previews,
  audio Play/Stop buttons using pygame.mixer in subprocess
- Handles both WotLK (v264) and Vanilla (v256) M2 formats
2026-02-23 22:22:39 -08:00
Kelsi
edf0a40759 Fix asset browser BLP errors, M2 wireframes, and add anim filter
- BLP: blp_convert takes one arg, not two; was passing an output path
  that caused conversion failures
- M2: vertex header offsets were wrong (used 80/100 instead of 60/68),
  producing garbage vertex counts that failed the sanity check
- Add "Hide .anim/.skin" checkbox (on by default) to filter ~30k
  companion files from the directory tree
2026-02-23 20:51:33 -08:00
Kelsi
6e2d51b325 Fix asset browser hanging on launch with large manifests
Manifest keys use backslashes but tree splitting used forward slashes,
causing all 241k entries to land at root level. Combined with O(N)
any(startswith) checks per entry, this produced an O(N^2) hang. Re-key
manifest by the forward-slash 'p' field and build a directory index in
a single O(N) pass so tree operations are O(1) lookups.
2026-02-23 20:45:19 -08:00
Kelsi
2a1bd12f5b Fix game objects rendering with player textures
When M2Renderer's descriptor pool was exhausted, batch.materialSet
would be VK_NULL_HANDLE and the bind was skipped, but the draw call
still executed using the previously bound descriptor set from
CharacterRenderer — causing game objects to render with the player's
skin/armor textures. Skip the entire batch instead.
2026-02-23 20:41:06 -08:00
Kelsi
739ae5b569 Add Asset Browser tab to pipeline GUI with inline previews
New tab lets users explore extracted assets visually: BLP textures
rendered via blp_convert+Pillow, M2/WMO wireframes with mouse-drag
rotation and zoom, DBC/CSV tables with named columns from
dbc_layouts.json, ADT heightmap grids, text file viewer, audio
metadata, and hex dumps. Directory tree lazy-loads from manifest.json
with search and file-type filtering.
2026-02-23 20:35:32 -08:00
Kelsi
ef04dde2fe Update asset pipeline GUI documentation
Cover all new features: cancel extraction, background override rebuild,
zip-slip protection, extractor auto-detection order, readonly dropdowns,
and selection preservation. Reorganize into per-tab sections with tables.
2026-02-23 20:09:26 -08:00
Kelsi
f95770720f Fix security, bugs, and UX in asset pipeline GUI
- Fix zip slip vulnerability: validate extracted paths stay within target
- Fix redundant mkdir before rmtree in rebuild_override()
- Add build/asset_extract and Windows .ps1 fallback to extractor search
- Preserve pack list selection across refreshes
- Add Cancel Extraction button with process.terminate()
- Run override rebuild in background thread to avoid UI freeze
- Fix locale combobox state to readonly
- Add asset_pipeline/ to .gitignore
- Make script executable
2026-02-23 20:06:41 -08:00
Kelsi
20dd5ed63b Add cross-platform Python asset pipeline GUI 2026-02-23 20:03:07 -08:00
Kelsi
aaab2115d1 Fix all remaining build warnings and eliminate UB in binary parsers
Resolve 57 compiler warnings (unused params/vars, ignored return values,
enum mismatch) and replace undefined-behavior reinterpret_cast with
memcpy in DBC, BLP, and Warden module loaders for ARM64 portability.
2026-02-23 19:58:38 -08:00
Kelsi
22518f0936 Suppress third-party header warnings and Vulkan struct init noise
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
- Add -Wno-missing-field-initializers for GCC (Vulkan designated
  initializer patterns in valid C++20 trigger this)
- Mark extern/ and vk-bootstrap as SYSTEM includes to suppress
  warnings from vendored headers (VMA, stb, miniaudio, nlohmann)
2026-02-23 19:20:55 -08:00
Kelsi
997318ae06 Fix all build warnings
- vk_utils.hpp: mark unused 'msg' parameter with [[maybe_unused]]
- world_packets.cpp: write exactMatch field to auction list packet
  (was accepted as parameter but never serialized)
- game_screen.cpp: remove unused bagIcons array and unused info variable
- talent_screen.cpp: remove unused nextRank and pMin variables
2026-02-23 19:16:47 -08:00
Kelsi
a825450048 Enable MSYS2 update on windows-arm64 to fix stale PGP keyring
The CLANGARM64 runner's cached MSYS2 install has outdated PGP keys,
causing "signature is unknown trust" errors. Setting update: true
refreshes the keyring before installing packages.
2026-02-23 18:57:49 -08:00
Kelsi
de6983e385 Track VulkanMemoryAllocator header in extern/
vk_mem_alloc.h was in extern/ but gitignored, causing macOS CI to fail
with 'vk_mem_alloc.h' file not found. Whitelist it alongside the other
vendored headers.
2026-02-23 18:54:00 -08:00
Kelsi
0210c24186 Pin vk-bootstrap to v1.3.302 for Vulkan 1.3 header compatibility
Latest vk-bootstrap HEAD uses Vulkan 1.4 types
(VkPhysicalDeviceVertexAttributeDivisorFeatures) that don't exist in
the Vulkan 1.3.275 headers shipped by Ubuntu 24.04. Pin to v1.3.302,
the latest release compatible with Vulkan 1.3 headers.
2026-02-23 18:51:33 -08:00
Kelsi
42b8e3141a Add Vulkan and shaderc packages to security workflow
CodeQL and sanitizer jobs were missing libvulkan-dev, vulkan-tools,
and glslc — same fix as the build workflow.
2026-02-23 18:49:15 -08:00
Kelsi
b5f754a9cc Add pkg-config fallback for Vulkan discovery
Some distros and CMake versions fail to find Vulkan via FindVulkan.cmake
even when libvulkan-dev is installed. Fall back to pkg-config (vulkan.pc)
and create the Vulkan::Vulkan imported target manually if needed.
2026-02-23 18:47:42 -08:00
Kelsi
22fa771d00 Fix CI failures: add vk-bootstrap submodule and fix MSYS2 stormlib
- Add vk-bootstrap as a git submodule (was in extern/ but not tracked,
  causing "vk-bootstrap not found" on all CI jobs)
- Whitelist extern/vk-bootstrap in .gitignore
- Move stormlib to a separate optional install step on both Windows CI
  jobs (mingw-w64-x86_64-stormlib doesn't exist in MSYS2 repos)
2026-02-23 18:45:39 -08:00
Kelsi
ebab8f3ccc Add missing Vulkan and shaderc packages to Linux CI and docs
Linux CI was missing libvulkan-dev, vulkan-tools, and glslc, causing
find_package(Vulkan REQUIRED) to fail. Also update BUILD_INSTRUCTIONS
Ubuntu and Arch sections to include Vulkan/shaderc packages.
2026-02-23 18:42:00 -08:00
Kelsi
685736fa16 Fix macOS asset extraction auto-build and docs
- extract_assets.sh: detect Homebrew and pass CMAKE_PREFIX_PATH,
  OPENSSL_ROOT_DIR, and PKG_CONFIG_PATH when auto-building on macOS
  (bare cmake couldn't find Homebrew deps)
- README.md: fix macOS brew command that had comments after line
  continuations (breaks shell execution)
- BUILD_INSTRUCTIONS.md: expand macOS asset extraction section with
  auto-build note and expansion targets
2026-02-23 18:40:26 -08:00
Kelsi
f66b9eb154 Fix macOS build process and make shell scripts cross-platform
- Add vulkan-loader, vulkan-headers, shaderc to macOS CI brew install
- Add vulkan-loader and shaderc to macOS PKG_CONFIG_PATH
- Replace Linux-only `nproc` with portable fallback in build.sh,
  rebuild.sh, extract_assets.sh, and tools/backup_assets.sh
- Replace `ldconfig` StormLib check with portable detection
  (ldconfig, pkg-config, brew lib) in extract_assets.sh
- Update BUILD_INSTRUCTIONS.md macOS section with vulkan/shaderc
  packages and MoltenVK explanation
- Add macOS prerequisites to README.md
2026-02-23 18:35:53 -08:00
Kelsi
eb549a9b7a Fix Windows build process and add Windows asset extraction scripts
- Add missing MSYS2 packages to CI: vulkan-loader, vulkan-headers,
  shaderc, stormlib (both x86-64 and arm64), unicorn (arm64)
- Make vulkan-1.dll copy conditional via find_file (fixes MSYS2 builds)
- Use find_library for wininet/bz2 in asset_extract (graceful fallback)
- Add extract_assets.ps1 and extract_assets.bat for Windows users
- Expand BUILD_INSTRUCTIONS.md with MSYS2, vcpkg, and macOS sections
- Update README.md to reference Windows scripts and platforms
2026-02-23 18:32:47 -08:00
Kelsi
06979e5c5c Prevent player snapping to WMO roofs when jumping inside buildings
Some checks are pending
Build / Build (arm64) (push) Waiting to run
Build / Build (x86-64) (push) Waiting to run
Build / Build (macOS arm64) (push) Waiting to run
Build / Build (windows-arm64) (push) Waiting to run
Build / Build (windows-x86-64) (push) Waiting to run
Security / CodeQL (C/C++) (push) Waiting to run
Security / Semgrep (push) Waiting to run
Security / Sanitizer Build (ASan/UBSan) (push) Waiting to run
Anchor WMO floor probe to last ground Z when airborne so the detection
ceiling doesn't rise with the jump and catch roof/ceiling geometry.
2026-02-23 11:03:18 -08:00
Kelsi
bf997e1900 Distance-cull terrain derivative normal mapping
Fade bump strength from full at 50 units to zero at 125 units to
avoid noisy/harsh appearance on distant terrain.
2026-02-23 10:54:56 -08:00
Kelsi
9a1b78bffd Fix character preview facing and add 4x MSAA to preview render target
Character was facing stage-left (yaw 180) instead of toward camera;
corrected default yaw to 90. Added MSAA support to VkRenderTarget with
automatic resolve attachment, and enabled 4x MSAA for the character
preview off-screen pass.
2026-02-23 10:48:26 -08:00
Kelsi
d65b170774 Make shadows follow player movement continuously
Remove freeze-while-moving and idle smoothing logic from shadow
center computation. Texel snapping already prevents shimmer, so
the shadow projection can track the player directly each frame.
2026-02-23 08:47:38 -08:00
Kelsi
5072c536b5 Fix sun quad square artifact with hard radial discard cutoff
Add hard discard at radius 0.35 so no fragment beyond that point
reaches the additive blend stage. Tighten disc, glow, and edge
fade to fit within the cutoff boundary.
2026-02-23 08:43:50 -08:00
Kelsi
0a1e240831 Fix WMO shadow receiving and enable shadows by default
Remove isInterior restriction from WMO shadow sampling so city
buildings (flagged as interior groups) correctly receive shadows.
Apply shadow to interior-lit surfaces. Enable shadows by default
and persist the setting across sessions.
2026-02-23 08:40:23 -08:00
Kelsi Rae Davis
c3ed915649
Merge pull request #4 from Kittnz/vulkan_win
Make this compatible to build on MSVS 2022
2026-02-23 08:38:37 -08:00
Kelsi
52ef199af3 Reduce default max zoom out from 33 to 22 units 2026-02-23 08:11:49 -08:00
Kelsi
b70f08d14f Add proportional zoom and reduced default max zoom with extended toggle
Zoom speed now scales with distance for fine control near the character.
Default max zoom out reduced from 50 to 33 units. New "Extended Camera
Zoom" toggle in Gameplay settings restores the full 50-unit range.
2026-02-23 08:09:27 -08:00
Kelsi
5cfb0817ed Fix sun quad visibility, minimap opacity, audio scaling, and rename music toggle
- Tighten celestial glow falloff and edge fade to eliminate visible quad boundary
- Add opacity support to minimap display shader, synced with UI opacity setting
- Fix audio double/triple-scaling by removing redundant master volume multiplications
- Rename "Original Soundtrack" toggle to "Enable WoWee Music"
- Add About tab with developer info and GitHub link
2026-02-23 08:01:20 -08:00
Kelsi
a250c20d84 Fix audio volume double/triple-scaling and add About tab
Audio was being scaled by master volume multiple times: once via
ma_engine_set_volume, again per-sound in AudioEngine, and again
via pre-multiplication in the UI. Removed redundant master volume
multiplications so each channel volume is independent and master
applies once through the engine. Added About tab to settings with
developer info and GitHub link.
2026-02-23 07:51:10 -08:00
Kelsi
83d7f26f33 Fix visible square behind sun by switching celestial to additive blending
Alpha blending caused faint quad edges to be visible against the sky
gradient. Additive blending correctly adds glow light without the
outline artifact. Edge fade starts earlier and discard threshold raised.
2026-02-23 07:40:51 -08:00
Kelsi
59f487c941 Fix foot splash particles being cleared immediately when wading
Ripples were cleared every frame the player wasn't swimming, which
destroyed foot splash particles the same frame they were spawned.
Now particles expire naturally via their lifetime.
2026-02-23 07:37:01 -08:00
Kelsi
a7102ab742 Fix foliage DXT black fringe, insect depth occlusion, and ambient creature animation
- Replace dark edge RGB on alpha-tested foliage with mip-4 average color
  proportional to alpha (low alpha = low trust in original RGB)
- Raise foliage alpha cutoff to 0.4 and remove dither band for cleaner edges
- Disable depth test on insect particles so they don't vanish behind foliage
- Exempt dragonflies/butterflies/moths from foliage animation freeze
2026-02-23 07:34:29 -08:00
kittnz
9dd15ef922 Make this compatible to build with MSVS 2022 2026-02-23 16:30:49 +01:00
Kelsi
01c08b93b0 Exempt ambient creatures from foliage animation freeze
Fireflies, dragonflies, butterflies, and moths no longer get
disableAnimation/foliage classification so their bone animation
and particles run normally.
2026-02-23 07:21:45 -08:00
Kelsi
4db97e37b7 Add ambient insect particles near water vegetation, fix firefly particles, and improve water foam
- Spawn dark point-sprite insects buzzing around cattails/reeds/kelp/seaweed
- Fix firefly M2 particles: exempt from alpha dampening and forced gravity
- Make water shoreline/crest foam more irregular with UV warping and bluer tint
2026-02-23 07:18:44 -08:00
Kelsi
c35b40391f Add water footstep splashes and reduce lake wave amplitude
- Play WaterFootstep splash sounds when wading in shallow water
- Spawn foot splash particles at water surface on each water footstep
- Reduce inland water wave amplitude from 0.18 to 0.08 for calmer lakes
2026-02-23 06:58:46 -08:00
Kelsi
93f873b521 Allow texture load retries instead of permanently caching failures
Remove negative cache for transient load failures in M2, terrain, and
character renderers. Failed textures return white and will be retried
on next model/tile load when assets may have finished streaming.
2026-02-23 06:51:06 -08:00