Commit graph

63 commits

Author SHA1 Message Date
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
4f40a0287c Skip additive FX batches on attached weapon models
- filter blendMode >= 3 batches when rendering weapon attachments
- avoids detached flat card artifacts on certain swords while keeping core weapon geometry
2026-02-21 02:52:31 -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
1003b25ff4 Improve runtime stutter handling and ground clutter performance
- reduce per-tile ground clutter generation pressure and enforce tighter caps to avoid spikes

- remove expensive detail dedupe scans from the hot render path

- add progressive/lazy clutter updates around player movement to smooth frame pacing

- lower noisy runtime INFO logging to DEBUG/throttled paths

- keep terrain/game screen updates responsive while preserving existing behavior
2026-02-21 01:26:16 -08:00
Kelsi
40ce3ec97d Fix NPC clothing geoset selection and cape visibility rules
- normalize humanoid NPC clothing geosets at spawn time to avoid conflicting overlays\n- force pants-first selection for group 13 to prevent robe/kilt meshes on trouser NPCs\n- hide cloak groups for NPCs unless a renderable cape texture can actually be resolved\n- avoid falling back to missing equipment texture paths during region compositing\n- stop model-scope type-2 cape texture writes that could leak cape/white textures across shared model IDs\n- add group texture override usage in character renderer draw path\n- update character preview equipment application to reuse preview applyEquipment path\n- keep hand-only keybone fallback for attachments to prevent helmet/anchor misbinds
2026-02-20 21:50:32 -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
48d9de810d Reduce runtime streaming stutter by throttling heavy spawn workloads
- Add per-frame cap for first-time creature model loads to spread expensive model/texture decode work across frames instead of burst loading.

- Keep cached creature spawns flowing while deferring uncached display IDs, preserving world population updates with smoother frame pacing.

- Defer transport WMO doodad instancing into a queued batch processor with a strict per-frame budget to avoid multi-hundred-ms spikes when ships/elevators register.

- Process deferred transport doodad batches in both normal gameplay update and loading-screen warmup loop so heavy transport setup can be amortized before and after world entry.

- Cleanup pending transport doodad batches on gameobject despawn to prevent stale work and avoid attaching children to removed parents.

- Lower character texture cache miss logging from INFO to DEBUG to reduce log I/O contention during movement-heavy asset streaming.
2026-02-20 20:00:44 -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
871da33942 Clean README mentions and finalize current gameplay/UI fixes 2026-02-19 03:31:49 -08:00
Kelsi
dddd2a71ca Fix creature flame alpha-key rendering and emissive flicker 2026-02-19 02:39:33 -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
267825bbcb Use speed-based walk/run selection for NPC movement
- choose run only when movement speed is above threshold
- prefer walk for duration-less synthesized movement deltas
- keep animation fallback behavior when specific sequence is unavailable
2026-02-18 03:56:12 -08:00
Kelsi
08c956a6e5 Fix creature chase animation and target-circle tracking
- use movement animation (prefer run, fallback walk) for server-driven creature moves
- synthesize short movement duration for duration-less movement deltas to avoid glide/attack-pose sliding
- return to idle after both walk/run movement states
- drive target circle from entity latest position and always interpolate selected/engaged targets
2026-02-18 03:53:53 -08:00
Kelsi
b8f1f15eb4 Fix CharSections.dbc field layout for classic/tbc/turtle expansions
The binary DBC files for all expansions use the same field ordering
(VariationIndex=4, ColorIndex=5, Texture1=6), but classic/tbc/turtle
dbc_layouts.json had swapped texture and variation/color fields, causing
all skin/face/hair/underwear lookups to fail. Also adds generalized
NxN texture scaling and a second video to README.
2026-02-17 03:18:01 -08:00
Kelsi
d87a86e35c Remove debug logging and add negative texture cache to fix lag spikes
Remove PPM composite dumps, MODEL1_BOUNDS vertex analysis, TEX_REGION
logging, FOUNTAIN_PARTICLES debug output, and verbose chat/warden gate
logging. Add negative cache for failed texture loads to prevent repeated
file I/O for missing textures like deathknighteyeglow.blp.
2026-02-16 00:45:47 -08:00
Kelsi
4190cb796f Fix composite cache clearing to not delete NPC textures
clearCompositeCache() now only clears the lookup map without deleting
GPU textures, preventing NPC and other instance textures from being
accidentally destroyed during player equipment changes.
2026-02-16 00:19:07 -08:00
Kelsi
ed6b305158 Fix character geoset mapping and texture corruption on equipment change
Corrected CharGeosets group assignments verified via vertex bounding boxes:
- Group 4 (401+) = gloves/forearms, Group 5 (501+) = boots/shins,
  Group 8 (801+) = sleeves (chest-controlled), Group 9 = kneepads,
  Group 13 (1301+) = pants/trousers, Group 20 (2002) = bare feet
- Changed bare shin default from 501 to 502 for better width match
  with thigh mesh (0.39 vs 0.32, thighs are 0.42)
- Added clearCompositeCache() to prevent stale composite textures
  from being reused across equipment changes
- Fixed character preview geoset defaults to match corrected mapping
2026-02-15 20:53:01 -08:00
Kelsi
8a468e9533 Add mailbox system and fix logging performance stutter
Implement full mail send/receive: SMSG_SHOW_MAILBOX, CMSG_GET_MAIL_LIST,
SMSG_MAIL_LIST_RESULT, CMSG_SEND_MAIL, SMSG_SEND_MAIL_RESULT, mail take
money/item/delete/mark-as-read, and inbox/compose UI windows.

Fix periodic stuttering in Stormwind caused by synchronous per-line disk
flushes in the logger — remove fileStream.flush() and std::endl, downgrade
high-volume per-packet/per-model/per-texture LOG_INFO to LOG_DEBUG.
2026-02-15 14:00:41 -08:00
Kelsi
9bc8c5c85a Fix character texture compositing and add YouTube video to README
Use authoritative WoW Model Viewer atlas coordinates (256x256 reference)
for face, underwear, and body region placement. Previously all coordinates
were hardcoded at 512x512 scale causing overlays to be clipped on the
256x256 base skin. Also include face upper+lower textures from
CharSections.dbc in compositing for both player and other-player characters.
2026-02-15 12:53:15 -08:00
Kelsi
3675721016 Improve equipment texture performance and accuracy
Cache composite textures by input key so identical NPC equipment
combos share one GPU texture. Use DBC layout system for
ItemDisplayInfo texture component fields instead of hardcoded
indices (cross-expansion support). Selective player equipment
re-emission on item query response instead of broadcasting to
all players.
2026-02-14 15:48:58 -08:00
Kelsi
60c93fa1e3 Fix weapon attachments and inspect fallback 2026-02-13 20:26:55 -08:00
Kelsi
5afd1b65a8 Fix Turtle/Classic parsing and online player textures 2026-02-13 19:40:54 -08:00
Kelsi
5fda1a3157 Bound MPQ archive lookup cache; remove always-on composite dumps; track texture cache entries 2026-02-12 16:29:36 -08:00
Kelsi
46c672d1c2 Normalize texture cache keys to prevent duplicate GPU textures 2026-02-12 16:15:25 -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
f752a4f517 Fix NPC visibility and stabilize world transport/taxi updates 2026-02-11 18:25:04 -08:00
Kelsi
c623fcef51 Add property-based mount animation discovery and procedural lean
Mount Animation System:
- Property-based jump animation discovery using sequence metadata
- Chain linkage scoring (nextAnimation/aliasNext) for accurate detection
- Correct loop detection: flags & 0x01 == 0 means looping
- Avoids brake/stop animations via blendTime penalties
- Works on any mount model without hardcoded animation IDs

Mount Physics:
- Physics-based jump height: vz = sqrt(2 * g * h)
- Configurable MOUNT_JUMP_HEIGHT constant (1.0m default)
- Procedural lean into turns for ground mounts
- Smooth roll based on turn rate (±14° max, 6x/sec blend)

Audio Improvements:
- State-machine driven mount sounds (jump, land, rear-up)
- Semantic sound methods (no animation ID dependencies)
- Debug logging for missing sound files

Bug Fixes:
- Fixed mount animation sequencing (JumpStart → JumpLoop → JumpEnd)
- Fixed animation loop flag interpretation (0x20 vs 0x21)
- Rider bone attachment working correctly during all mount actions
2026-02-10 19:30:45 -08:00
Kelsi
8e60d0e781 Implement WoW-accurate DBC-driven sky system with lore-faithful celestial bodies
Add SkySystem coordinator that follows WoW's actual architecture where skyboxes
are authoritative and procedural elements serve as fallbacks. Integrate lighting
system across all renderers (terrain, WMO, M2, character) with unified parameters.

Sky System:
- SkySystem coordinator manages skybox, celestial bodies, stars, clouds, lens flare
- Skybox is authoritative (baked stars from M2 models, procedural fallback only)
- skyboxHasStars flag gates procedural star rendering (prevents double-star bug)

Celestial Bodies (Lore-Accurate):
- Two moons: White Lady (30-day cycle, pale white) + Blue Child (27-day cycle, pale blue)
- Deterministic moon phases from server gameTime (not deltaTime toys)
- Sun positioning driven by LightingManager directionalDir (DBC-sourced)
- Camera-locked sky dome (translation ignored, rotation applied)

Lighting Integration:
- Apply LightingManager params to WMO, M2, character renderers
- Unified lighting: directional light, diffuse color, ambient color, fog
- Star occlusion by cloud density (70% weight) and fog density (30% weight)

Documentation:
- Add comprehensive SKY_SYSTEM.md technical guide
- Update MEMORY.md with sky system architecture and anti-patterns
- Update README.md with WoW-accurate descriptions

Critical design decisions:
- NO latitude-based star rotation (Azeroth not modeled as spherical planet)
- NO always-on procedural stars (skybox authority prevents zone identity loss)
- NO universal dual-moon setup (map-specific celestial configurations)
2026-02-10 14:36:17 -08:00
Kelsi
dab23f1895 Add ambient sound system and eliminate log spam
- Implement AmbientSoundManager with tavern/outdoor ambience
- Fix audio buffer limit (5s → 60s) for long ambient loops
- Set log level to INFO to eliminate DEBUG spam (130MB → 3.2MB logs)
- Remove excessive terrain/model/network logging
- Fix ambient sound timer sharing and pitch parameter bugs
2026-02-09 14:50:14 -08:00
Kelsi
fdc614902b Fix online interactions, UI, and inventory sync 2026-02-06 18:34:45 -08:00
Kelsi
81166346ef Fix respawned corpse movement, faction hostility, and add WoW-canonical mob level colors
Reset NPC animation to idle when health goes from 0 to >0 (respawn), prevent
dead NPCs from being moved by server movement packets. Fix faction hostility
to check factionGroup Monster bit and individual enemy arrays, not just
enemyGroup. Add level-based mob coloring: grey (no XP), green (easy), yellow
(even), orange (hard), red (very hard) for target frame and selection circle.
2026-02-06 16:47:07 -08:00
Kelsi
f0aad5e97f Fix spline parsing, hair texture, and popup window positioning
Restore unconditional verticalAccel/effectStartTime reads in spline parser
with pointCount safety cap at 256. Load player hair texture from
CharSections.dbc instead of hardcoded path, and restrict render fallback
to not apply skin composite to hair batches. Change loot/gossip/vendor
windows to re-center on each open via ImGuiCond_Appearing.
2026-02-06 15:18:50 -08:00
Kelsi
7128ea1417 Restructure inventory UI, add vendor selling, camera intro on all spawns, and quest log
Split inventory into bags-only (B key) and character screen (C key). Vendor window
auto-opens bags with sell prices on hover and right-click to sell. Add camera intro
pan on all login/spawn/teleport/hearthstone events and idle orbit after 2 minutes.
Add quest log UI, SMSG_MONSTER_MOVE handling, deferred creature spawn queue, and
creature fade-in/movement interpolation for online mode.
2026-02-06 13:47:03 -08:00
Kelsi
e8fecfb3be Fix NPC hair/geoset rendering using DBC lookups
Use CharHairGeosets.dbc to map (race, sex, hairStyleId) to the correct
group 0 scalp mesh instead of the broken 101+hairStyleId formula. Filter
group 0 submeshes so only the body base and correct hair mesh render
(prevents overlapping scalp variants). Fix ItemDisplayInfo.dbc column
indices (5→7) and geoset formulas for equipment. Add CharSections.dbc
hair texture lookup and CharacterFacialHairStyles.dbc support.
2026-02-06 01:02:35 -08:00
Kelsi
4c77f7ee7b Add texture fallback for body parts with white texture
For body part batches (group 0) that resolve to white/fallback texture,
fall back to the first valid texture in the model. This handles humanoid
NPCs where body parts use different texture slots that may not be set.
2026-02-05 23:51:50 -08:00
Kelsi
9de3f2d327 Fix NPC body parts by applying baked texture to all skin slots
Baked NPC textures must be applied to all skin-related texture slots
(type 1 char skin, type 2 object skin, type 6 hair) since body parts
use different texture slots. Removed separate hair texture lookup as
baked textures already include the complete NPC appearance.
2026-02-05 23:48:06 -08:00
Kelsi
ec937bc6d3 Fix NPC body parts by skipping batches with fallback texture
M2 humanoid models have duplicate body meshes - one set for baked textures
and another for skin compositing. Skip body part batches (group 0) that
resolve to white/fallback texture to avoid rendering the wrong set.
2026-02-05 23:44:45 -08:00
Kelsi
c053631c7a Fix geoset filtering for M2 models
Group 0 (body parts 0-18) always renders all submeshes since they represent
different body parts. Other groups filter by exact submeshId match to show
only one variation per group.
2026-02-05 23:42:05 -08:00
Kelsi
b4ae2c7b67 Disable geoset filtering until submesh ID format is determined
Geoset filtering was causing body parts to disappear. Disabled until we
can properly map submesh IDs to geoset groups.
2026-02-05 23:37:26 -08:00
Kelsi
99fd4ca537 Fix geoset filtering to always show body parts (group 0)
Body parts (submeshId 0-99) now always render regardless of activeGeosets.
Other geoset groups (hair, chest, etc.) still require explicit enabling.
This fixes missing body parts while maintaining equipment filtering.
2026-02-05 23:35:28 -08:00
Kelsi
9c5e2fb93d Fix geoset filtering with expanded body range and debug logging
Expanded body part geoset range from 0-18 to 0-99 to cover all humanoid
submesh IDs. Added per-model debug logging to track submesh IDs and
geoset filtering behavior.
2026-02-05 23:33:28 -08:00
Kelsi
ec6c575894 Revert "Fix geoset filtering using correct geosetId from M2 batch"
This reverts commit 45048757ef.
2026-02-05 23:27:59 -08:00
Kelsi
45048757ef Fix geoset filtering using correct geosetId from M2 batch
M2 batches have a geosetIndex field that determines the geoset group for
filtering (0-18=body, 1xx=hair, etc.). We were incorrectly using submeshId
from the submesh struct instead. Now properly stores and uses geosetId.
2026-02-05 23:26:30 -08:00
Kelsi
8cb38b91f9 Fix invisible NPC body parts caused by texture alpha
Character fragment shader was using texture alpha, which could be 0 in
baked NPC textures. Force alpha=1 for opaque character rendering.
2026-02-05 23:22:24 -08:00
Kelsi
9e3d12c0dc Fix NPC missing body parts by using baked textures as-is
Baked NPC textures already include complete appearance (skin, features,
armor). Equipment component textures are designed for player characters
with different UV layout and were causing body parts to disappear.
2026-02-05 23:15:57 -08:00
Kelsi
e6e3093467 Emulate server loot/xp and combat feedback in single-player 2026-02-05 14:01:26 -08:00