Commit graph

121 commits

Author SHA1 Message Date
Kelsi
03a62526e1 Add player water ripples and separate 1x water pass for MSAA compatibility
Player interaction ripples: vertex shader adds radial damped-sine displacement
centered on player position, fragment shader adds matching normal perturbation
for specular highlights. Player XY packed into shadowParams.zw, ripple strength
into fogParams.w. Separate 1x render pass for water when MSAA is active to
avoid MSAA-induced darkening — water renders after main pass resolves, using
the resolved swapchain image and depth resolve target. Water 1x framebuffers
rebuilt on swapchain recreate (window resize).
2026-02-22 22:34:48 -08:00
Kelsi
67e63653a4 Stabilize Vulkan shadow pipeline diagnostics and compatibility path
- Fix shadow depth image layout transitions by tracking per-frame old/new layouts.
- Update receiver shadow projection to Vulkan clip-depth convention.
- Test inverted shadow compare op path (GREATER_OR_EQUAL).
- Switch shadow compare samplers to NEAREST filtering for broader Vulkan compatibility.
- Expand shadow caster coverage by disabling caster cull filtering in WMO/M2/Character shadow pipelines.
- Keep light-space matrix path on stable character-centered framing.
2026-02-22 10:25:33 -08:00
Kelsi
2c5e0dd313 Fix Vulkan shadow light direction and restore ground-clutter cutout visibility 2026-02-22 09:47:39 -08:00
Kelsi
bd0305f6dd Stabilize Vulkan rendering state for minimap, foliage, and water 2026-02-22 09:34:27 -08:00
Kelsi
8efc1548dc Fix minimap arrow orientation and ground-detail foliage transparency 2026-02-22 08:44:16 -08:00
Kelsi
ae88b226b5 Stabilize streaming memory and parser handling; revert socket recv optimizations 2026-02-22 07:26:54 -08:00
Kelsi
7dd1dada5f Work on character rendering and frustrum culling etc 2026-02-22 05:58:45 -08:00
Kelsi
e8e859384e Fix minimap MSAA pipeline, defer swapchain recreation, fix player character spawn order
- Add .setMultisample() to minimap display pipeline and recreatePipelines() for MSAA changes
- Defer all swapchain recreation in window.cpp to beginFrame() via markSwapchainDirty()
  to prevent mid-frame render pass destruction crashes on resolution/fullscreen change
- Move spawnPlayerCharacter() call to after loadTestTerrain() where character renderer exists
2026-02-22 03:49:44 -08:00
Kelsi
ebd0084c22 Fix MSAA crash by deferring change to between frames, fix M2 GO orientation
MSAA change was called mid-frame from settings UI, destroying the render pass
and framebuffers while the command buffer was still recording. Now deferred
via pendingMsaaSamples_ flag, applied in beginFrame() before any GPU state.

Also add +180° to M2 game object orientation to fix facing direction.
2026-02-22 03:37:47 -08:00
Kelsi
b1a9d231c7 Fix MSAA 8x crash: clearValueCount must match attachment count
Render pass begin used 2 clear values but MSAA render pass has 3
attachments (MSAA color, depth, resolve). Vulkan requires clear
value count >= attachment count, causing a driver crash at 8x.

Also fix renderYawM2 reference removed in previous commit.
2026-02-22 03:11:21 -08:00
Kelsi
fa1867cf2f Fix MSAA 8x crash and eliminate redundant GPU stalls
- Add error handling: revert to 1x if recreateSwapchain fails
- Clamp requested MSAA to device maximum before applying
- Retry MSAA color image allocation without TRANSIENT on failure
- Remove redundant vkDeviceWaitIdle from WMO/M2/Character recreatePipelines
  (caller already waits once, was causing ~13 stalls instead of 1)
2026-02-22 03:05:55 -08:00
Kelsi
e12141a673 Add configurable MSAA anti-aliasing, update auth screen and terrain shader
- MSAA: conditional 2-att (off) vs 3-att (on) render pass with auto-resolve
- MSAA: multisampled color+depth images, query max supported sample count
- MSAA: .setMultisample() on all 25+ main-pass pipelines across 17 renderers
- MSAA: recreatePipelines() on every sub-renderer for runtime MSAA changes
- MSAA: Renderer::setMsaaSamples() orchestrates swapchain+pipeline+ImGui rebuild
- MSAA: Anti-Aliasing combo (Off/2x/4x/8x) in Video settings, persisted
- Update auth screen assets and terrain fragment shader
2026-02-22 02:59:24 -08:00
Kelsi
69cf39ba02 Activate WMO/char/M2 render loop, purge dead GL block, add underwater overlay
- renderWorld() now calls wmoRenderer, characterRenderer, m2Renderer (+smoke,
  particles) in the correct opaque→transparent order; water moved after all
  opaques; per-subsystem timing active in live path
- Deleted the 310-line #if 0 GL stub block and removed #include <GL/glew.h>
  (last GL reference in renderer.cpp)
- Full-screen overlay pipeline (postprocess.vert + overlay.frag, alpha blend,
  no depth test/write) for underwater tint; lazily initialized, renders a blue
  tint when camera is meaningfully below the water surface; canal vs open-water
  tint colours preserved from original design
- overlay.frag.glsl / overlay.frag.spv added
2026-02-21 22:04:17 -08:00
Kelsi
dea52744a4 Character renderer is fully Vulkan. 2026-02-21 22:04:17 -08:00
Kelsi
83b576e8d9 Vulcan Nightmare
Experimentally bringing up vulcan support
2026-02-21 22:04:17 -08:00
Kelsi
8156942b66 Align sun placement and shadow direction to active lighting
- drive shadow light direction from live LightingManager directionalDir
- normalize shadow light to downward-facing convention with grazing-angle guard
- make celestial/sky sun placement robust to directionalDir convention mismatches
- keep visible sun above horizon while preserving shadow alignment
2026-02-21 03:21:08 -08:00
Kelsi
0c8798d6b5 Improve player and foliage shadow quality and stability
- ensure player transform sync is not gated by third-person so player shadow stays consistent

- hold shadow projection center during movement and snap once on stop to remove delayed catch-up

- smooth foliage caster transitions using blended phase-shifted UV samples

- tune foliage motion frequencies/amplitudes for less popping

- increase shadow map resolution to 2048 and retune terrain PCF texel scale

- increase global shadow strength from 0.62 to 0.68 for stronger, clearer shadows
2026-02-21 02:28:47 -08:00
Kelsi
7717ab8d6b Stabilize foliage shadows and smooth motion transitions
- keep shadow projection center fixed while moving to remove per-frame projection churn flicker

- replace delayed post-move catch-up with immediate stop transition and idle smoothing

- rework foliage shadow caster motion to use blended phase-shifted UV samples for continuous position transitions

- reduce high-frequency foliage threshold popping by removing threshold warping path

- sharpen terrain receive filtering with tuned 5-tap PCF weights/offset for more detailed shadows

- raise shadow map resolution to 1536 and keep light-space texel snapping for stable sampling

- set shadows enabled by default and lower global shadow strength from 0.65 to 0.62

- keep foliage animation speed consistent between moving and idle at 80%
2026-02-21 02:23:08 -08:00
Kelsi
3368dbb9ec Fix NPC apparel fallback and reduce world-entry stutter
Hide NPC cloak/object-skin mesh when no cape texture resolves by using a transparent texture fallback, preventing skin-texture bleed on cloaks. Tighten NPC equipment region compositing by slot and add safe humanoid geoset selection to avoid robe-over-pants conflicts and odd pants texturing.

Reduce login/runtime hitching by deferring non-critical world-system initialization across frames, lowering per-frame transport doodad spawn budget, and demoting high-volume transport/MO_TRANSPORT diagnostics to debug. Gate M2 glow diagnostics behind WOWEE_M2_GLOW_DIAG and make zone music prewarm opt-in via WOWEE_PREWARM_ZONE_MUSIC.
2026-02-20 20:31:04 -08:00
Kelsi
1ce406c9e1 Fix selection circle occlusion in WMO interiors
Keep the targeting ring anchored near target feet by filtering floor probes to a local Z window, preventing unrelated upper/lower WMO surfaces from hijacking ring height.

Also keeps the ring render pass after WMO geometry and before character/M2 passes so it remains visible through terrain/WMO while still rendering behind units.
2026-02-20 17:52:45 -08:00
Kelsi
017bdf9033 Adjust selection ring layering: visible through terrain, behind M2s
- Render selection circle before character/WMO/M2 passes\n- Disable depth test during selection pass so terrain does not occlude it\n- Keep model passes after selection so monsters/M2s render over the ring
2026-02-20 16:07:54 -08:00
Kelsi
f7372a282d Improve selected-NPC ring visuals, anchoring, and occlusion behavior
Selection ring rendering has been upgraded to better match WoW-like target feedback and remain readable across complex geometry.

Visual updates:
- Reworked ring mesh/shader from a simple two-band strip to a unit-disc + radial fragment shaping.
- Implemented a thinner outer ring profile.
- Added an inward color/alpha gradient that fades from the ring toward the center.

Placement/anchoring updates:
- Added CharacterRenderer::getInstanceFootZ() to query model foot plane from instance bounds.
- Added Application::getRenderFootZForGuid() to resolve per-GUID foot height via live instance mapping.
- Updated GameScreen target selection placement to anchor the effect at target foot Z.

Ground/surface stability:
- In renderSelectionCircle(), added floor clamping against terrain, WMO, and M2 floor probes at target XY.
- Raised final placement offset to reduce residual clipping on uneven surfaces.

Depth/visibility behavior:
- Added polygon offset during ring draw to reduce z-fighting.
- Disabled depth testing for the selection effect draw pass (with state restore) so the ring remains visible through terrain/WMO occluders, per requested behavior.

State safety:
- Restored modified GL state after selection pass (depth test / polygon offset / depth mask / cull).

Build validation:
- Verified with cmake build target "wowee" after each stage; final build succeeds.
2026-02-20 16:02:34 -08:00
Kelsi
eaba378b5b Fix classic combat desync and separate attack intent from confirmed combat
Combat state/UI:

- Split attack intent from server-confirmed auto attack in GameHandler.

- Add explicit combat state helpers (intent, confirmed, combat-with-target).

- Update player/target frame and renderer in-combat indicators to use confirmed combat.

- Add intent-only visual state in UI to avoid false combat feedback.

Animation correctness:

- Correct combat-ready animation IDs to canonical ready stances (22/23/24/25).

- Remove hit/wound-like stance behavior caused by incorrect ready IDs.

Classic/TBC/Turtle melee reliability:

- Tighten melee sync while attack intent is active: faster swing resend, tighter facing threshold, and faster facing cadence for classic-like expansions.

- Send immediate movement heartbeat after facing corrections and during stationary melee sync windows.

- Handle melee error opcodes explicitly (NOTINRANGE/BADFACING/NOTSTANDING/CANT_ATTACK) and immediately resync facing/swing where appropriate.

- On ATTACKSTOP with persistent intent, immediately reassert ATTACKSWING.

- Increase movement heartbeat cadence during active classic-like melee intent.

Server compatibility/anti-cheat stability:

- Restrict legacy force-movement/speed/teleport ACK behavior for classic-like flows to avoid unsolicited order acknowledgements.

- Preserve local movement state updates while preventing bad-order ACK noise.
2026-02-20 03:38:12 -08:00
Kelsi
328ec9ea78 Fix combat vocalizations with correct MPQ paths, add combat idle stance
Use actual WoW 3.3.5a PlayerExertions and Vox sound paths from MPQ
manifests for attack grunts, wounds, and death sounds. Handle Blizzard
naming quirks (HumanFeamle typo, OrcMale no Final suffix, Scourge→Undead).
Add COMBAT_IDLE animation state with ready weapon stance between swings.
Restore deleted MPQ sound manifest docs.
2026-02-19 21:50:32 -08:00
Kelsi
e163813dee Add Warrior Charge ability with ribbon trail visual effect
Implements charge rush-to-target for spell IDs 100/6178/11578 with
smoothstep lerp movement, vertical red-orange ribbon trail, dust puffs,
client-side range validation, and sound fallback chain.
2026-02-19 21:13:13 -08:00
Kelsi
da49593268 Add 3D level-up effect using LevelUp.m2 spell model
Replace 2D screen-space ding rings with real WoW LevelUp.m2 particle/geometry
effect. Fix FBlock particle color parsing (C3Vector floats, not CImVector bytes)
which was producing blue/red instead of golden yellow. Spell effect models bypass
particle dampeners, glow sprite conversion, Mod→Additive blend override, and all
collision (floor/wall/camera) to prevent camera zoom-in. Other players' level-ups
trigger the 3D effect at their position with group chat notification. F7 hotkey
for testing.
2026-02-19 20:36:25 -08:00
Kelsi
2bbd0fdc5f Fix movement desync: strafe animation and missing SET_FACING
Two bugs caused the client to look like a bot to server GMs:

1. Strafe animation played during forward+strafe (W+A) instead of the
   walk/run animation. Added pureStrafe guard so strafe animations only
   play when exclusively strafing (no forward key or auto-run active).

2. CMSG_MOVE_SET_FACING was never sent on mouse-look turns. The server
   predicts movement from the last known facing; without SET_FACING the
   heartbeat position appeared to teleport each time the player changed
   direction. Now sent at up to 10 Hz whenever facing changes >3°,
   skipped while keyboard-turning (handled server-side by TURN flags).
2026-02-19 16:40:17 -08:00
Kelsi
340a08f947 Fix WMO texture loading by always wiring asset manager 2026-02-18 23:08:43 -08:00
Kelsi
514b914068 Add shadow frustum culling to terrain and M2 depth passes
Both passes were rendering the entire loaded scene (17×17 tile radius)
into a shadow map that only covers 360×360 world units — submitting
10-50× more geometry than the shadow frustum can actually use.

- TerrainRenderer::renderShadow: skip chunks whose bounding sphere
  doesn't overlap the shadow frustum AABB in XY. Reduces terrain draw
  calls from O(all loaded chunks) to O(chunks within ~180 units).
- M2Renderer::renderShadow: skip instances whose world AABB doesn't
  overlap the shadow frustum in XY. Reduces M2 draw calls similarly.
- Both functions now take shadowCenter + halfExtent parameters.
2026-02-18 21:15:24 -08:00
Kelsi
c4d0a21713 Improve shadow performance: halve resolution, 9x fewer PCF taps, throttle depth pass
- SHADOW_MAP_SIZE 2048→1024: 4x fewer pixels rasterized in depth pass
- Replace 9-tap manual PCF loop with single hardware PCF tap in all 4 receiver
  shaders (terrain.frag, wmo_renderer, m2_renderer, character_renderer).
  GL_LINEAR + GL_COMPARE_REF_TO_TEXTURE already gives 2×2 bilinear PCF per
  tap for free, so quality is maintained while doing 9x fewer texture fetches.
- Throttle shadow depth pass to every 2 frames; OpenGL depth texture persists
  between frames so receivers always have a valid shadow map. 1-frame lag at
  60 fps is invisible.
2026-02-18 21:09:00 -08:00
Kelsi
c998c945bf Implement MPQ-path sound loading in AudioEngine
Add AssetManager hookup to AudioEngine so the path-based playSound2D/3D
overloads can load files on demand rather than requiring preloading.

- Add setAssetManager() to AudioEngine (called during world load alongside
  other audio manager initializations)
- playSound2D(mpqPath) now calls assetManager->readFile() then delegates
  to the vector<uint8_t> overload (removes the "not yet implemented" warning)
- playSound3D(mpqPath, position) same — delegates to the fully spatialized
  vector overload (was previously silently falling back to 2D)
2026-02-17 18:52:19 -08:00
Kelsi
369ad26476 Implement SMSG_WEATHER and wire real game state (map ID, weather, underwater) to lighting system 2026-02-17 17:59:41 -08:00
Kelsi
36fc1df706 Fix Turtle WoW compatibility: NPC spawning, quests, spells, realm display, and music
- Add TurtlePacketParsers with dedicated movement block parser (Classic format + transport timestamp)
- Fix quest giver status: read uint32 and translate vanilla enum values for Classic/Turtle
- Fix quest accept packet: remove trailing uint32 that vanilla servers reject
- Fix quest details parser: auto-detect vanilla vs WotLK format (informUnit field)
- Fix spellbook and action bar icons: fallback to WotLK DBC field indices when expansion layout fails
- Fix spell cast failure messages: translate vanilla SpellCastResult codes (+1 offset)
- Fix realm list: correct type values (6=RP, 8=RP-PvP) and population thresholds
- Fix music: disable looping for zone music, auto-advance to next random track when finished
- Add music anti-repeat: avoid playing the same track back-to-back
- Make TBC update block parsing resilient (keep parsed blocks on failure instead of aborting)
- Add right-click attack on hostile mobs
- Add name query diagnostic logging
2026-02-17 05:27:03 -08:00
Kelsi
85714fd7f6 Fix taxi flight: camera panning, world reload, gryphon display, and animations
- Clear introActive/idleOrbit in externalFollow block so mouse panning works during taxi
- Skip full world reload on same-map teleports (taxi landing) by tracking loadedMapId
- Collect all model IDs for a path when resolving gryphon display ID (fixes displayId=0)
- Remove incorrect MountDisplayId fields from Vanilla/Turtle TaxiNodes DBC layouts
- Add Vanilla fly animation IDs (234/229/233) to taxi mount animation candidates
2026-02-17 02:23:41 -08:00
Kelsi
eace8753c6 Fix taxi griffin animation and improve mount texture loading
Use FlyForward/FlyIdle animations (IDs 158/159) for taxi mounts instead
of ground movement animations (Stand/Run). Add detailed mount texture
debug logging and improve fallback texture resolution for gryphon/wyvern
models with multiple skin slots.
2026-02-17 01:16:23 -08:00
Kelsi
d2b46d410a Add original music to login rotation and zone playlists
11 original tracks in assets/Original Music/ now play on the login
screen and in thematically matched zones across Eastern Kingdoms and
Kalimdor. Added crossfadeToFile to MusicManager for local file
playback during zone transitions. New zones: Tirisfal, Undercity,
Barrens, STV, Duskwood, Burning Steppes, Searing Gorge, Ironforge,
Loch Modan, Orgrimmar, Durotar, Mulgore, Thunder Bluff, Darkshore,
Teldrassil, Darnassus.
2026-02-15 05:53:27 -08:00
Kelsi
d27387d744 Fix mount sounds, grey WMO meshes, taxi landing, tree animations, and classic dismount
- Per-family mount sounds (kodo, tallstrider, mechanostrider, etc.) detected from M2 model path
- Skip WMO groups with SHOW_SKYBOX flag or all-untextured batches (grey mesh in Orgrimmar)
- Freeze physics during taxi landing until terrain loads to prevent falling through void
- Disable bone animations on tropical vegetation (palm, bamboo, banana, etc.) to fix wiggling
- Snap player to final taxi waypoint on flight completion
- Extract mount aura spell ID from classic UNIT_FIELD_AURAS for CMSG_CANCEL_AURA dismount
- Increase /unstuck forward nudge to 5 units
2026-02-14 21:04:20 -08:00
Kelsi
3acb42b363 Resolve emote text from DBC for other players' text emotes
Load third-person emote text templates (othersTarget/othersNoTarget)
from EmotesText.dbc fields 3 and 7 alongside existing sender text.
Build reverse lookup map from dbcId to EmoteInfo for incoming
SMSG_TEXT_EMOTE resolution. Other players now show proper emote
descriptions like "Player dances with Target" instead of generic
"Player performs an emote" text.
2026-02-14 15:11:43 -08:00
Kelsi
9bcead6a0f Add chat tabs, networked text emotes, channel system, and chat bubbles
Chat tabs filter messages into General/Combat/Whispers/Trade tabs. Text
emotes now send CMSG_TEXT_EMOTE to server and display incoming emotes
from other players. Channel system auto-joins General/Trade on login with
/join, /leave, and /1-/9 shortcuts. Chat bubbles render as ImGui overlays
above entities for SAY/YELL messages with fade-out animation.
2026-02-14 14:30:09 -08:00
Kelsi
7092844b5e Add multi-expansion support with data-driven protocol layer
Replace hardcoded WotLK protocol constants with a data-driven architecture
supporting Classic 1.12.1, TBC 2.4.3, and WotLK 3.3.5a. Each expansion
has JSON profiles for opcodes, update fields, and DBC layouts, plus C++
polymorphic packet parsers for binary format differences (movement flags,
speed fields, transport data, spline format, char enum layout).

Key components:
- ExpansionRegistry: scans Data/expansions/*/expansion.json at startup
- OpcodeTable: logical enum <-> wire values loaded from JSON
- UpdateFieldTable: field indices loaded from JSON per expansion
- DBCLayout: schema-driven DBC field lookups replacing magic numbers
- PacketParsers: WotLK/TBC/Classic parsers with correct flag positions
- Multi-manifest AssetManager: layered manifests with priority ordering
- HDPackManager: overlay texture packs with expansion compatibility
- Auth screen expansion picker replacing hardcoded version dropdown
2026-02-12 22:56:36 -08:00
Kelsi
275914b4db Fix character appearance, previews, mount seat, and online unequip 2026-02-12 14:55:27 -08:00
Kelsi
5171f9cad4 Fix taxi state sync and transport authority; reduce runtime log overhead; restore first-person self-hide 2026-02-11 22:27:02 -08:00
Kelsi
40b50454ce Stabilize taxi/state sync and creature spawn handling 2026-02-11 21:14:35 -08:00
Kelsi
38cef8d9c6 Fix taxi startup/attachment and reduce taxi streaming hitches 2026-02-11 19:28:15 -08:00
Kelsi
f752a4f517 Fix NPC visibility and stabilize world transport/taxi updates 2026-02-11 18:25:04 -08:00
Kelsi
c91e0bb916 Immediately cancel mount fidgets when movement starts
Fidget animations were continuing to play for a frame when movement started.
Now forces immediate switch to run animation.

Changes:
- Check for movement + active fidget at start of animation logic
- Force play run animation immediately to stop fidget
- Only check fidget completion when not moving (optimization)
- Removed duplicate mountActiveFidget_ = 0 in movement branch

Fidgets now stop instantly when player starts moving on mount.
2026-02-10 20:46:46 -08:00
Kelsi
7e85e0b2ef Reduce idle sound frequency and restore fidget discovery
Idle sounds were too frequent and strict criteria blocked all fidgets.

Changes:
- Idle sounds now 45-90 seconds apart (was 20-40)
- Fidget criteria back to OR (frequency OR replay) instead of AND
- Keeps all ID exclusions: 2-3, 5-9, 11-21 to prevent battle animations
- Should now discover proper fidgets while filtering problematic ones
2026-02-10 20:36:12 -08:00
Kelsi
fe3c6a6a79 Disable pained sounds and tighten fidget criteria
Removed jump/land sounds (attack/wound sounds had pained growls).
Made fidget discovery much stricter to exclude jerky battle animations.

Changes:
- Disabled playJumpSound for ground mounts (attack sounds too aggressive)
- Disabled playLandSound for ground mounts (wound sounds have growls)
- Fidget criteria now requires BOTH frequency AND replay (not OR)
- Excluded IDs 11-15 (attacks) in addition to 16-21 (combat)
- Only animations with proper idle metadata will be selected
2026-02-10 20:32:43 -08:00
Kelsi
a88c5f9bb8 Add comprehensive fidget animation logging for debugging
Added debug logging to show ALL non-looping, short, stationary animations
regardless of metadata, so we can identify hoof stamps and head tosses.

Shows:
- All potential fidgets (no metadata filter)
- Animation ID, duration, frequency, replay timers, flags, next animation
- Helps identify which IDs are the shuffles/stamps/tosses on Palomino
2026-02-10 20:28:56 -08:00
Kelsi
2e2ca24f8d Exclude death and wound animations from fidget discovery
Horse was playing death animation on idle. Added explicit filtering
to exclude death (5-6), wounds (7-9), combat (16-21), and specials (2-3).

Changes:
- Check animation ID ranges before adding to fidget list
- Prevents death/wound animations from being selected as idle fidgets
- Keeps metadata-based discovery but adds safety exclusions
2026-02-10 20:28:13 -08:00