Kelsidavis-WoWee/include/rendering
Pavel Okhlopkov 4b9b3026f4 feat(rendering): add HiZ occlusion culling & fix WMO interior shadows
Implement GPU-driven Hierarchical-Z occlusion culling for M2 doodads
using a depth pyramid built from the previous frame's depth buffer.
The cull shader projects bounding spheres via prevViewProj (temporal
reprojection) and samples the HiZ pyramid to reject hidden objects
before the main render pass.

Key implementation details:
- Separate early compute submission (beginSingleTimeCommands + fence
  wait) eliminates 2-frame visibility staleness
- Conservative safeguards prevent false culls: screen-edge guard,
  full VP row-vector AABB projection (Cauchy-Schwarz), 50% sphere
  inflation, depth bias, mip+1, min screen size threshold, camera
  motion dampening (auto-disable on fast rotations), and per-instance
  previouslyVisible flag tracking
- Graceful fallback to frustum-only culling if HiZ init fails

Fix dark WMO interiors by gating shadow map sampling on isInterior==0
in the WMO fragment shader. Interior groups (flag 0x2000) now rely
solely on pre-baked MOCV vertex-color lighting + MOHD ambient color.
Disable interiorDarken globally (was incorrectly darkening outdoor M2s
when camera was inside a WMO). Use isInsideInteriorWMO() instead of
isInsideWMO() for correct indoor detection.

New files:
- hiz_system.hpp/cpp: pyramid image management, compute pipeline,
  descriptors, mip-chain build dispatch, resize handling
- hiz_build.comp.glsl: MAX-depth 2x2 reduction compute shader
- m2_cull_hiz.comp.glsl: frustum + HiZ occlusion cull compute shader
- test_indoor_shadows.cpp: 14 unit tests for shadow/interior contracts

Modified:
- CullUniformsGPU expanded 128->272 bytes (HiZ params, viewProj,
  prevViewProj)
- Depth buffer images gain VK_IMAGE_USAGE_SAMPLED_BIT for HiZ reads
- wmo.frag.glsl: interior branch before unlit, shadow skip for 0x2000
- Render graph: hiz_build + compute_cull disabled (run in early compute)
- .gitignore: ignore compiled .spv binaries
- MEGA_BONE_MAX_INSTANCES: 2048 -> 4096

Signed-off-by: Pavel Okhlopkov <pavel.okhlopkov@flant.com>
2026-04-06 16:40:59 +03:00
..
animation feat(animation): decompose AnimationController into FSM-based architecture 2026-04-05 12:27:35 +03:00
amd_fsr3_runtime.hpp Add FSR3 Generic API path and harden runtime diagnostics 2026-03-09 12:51:59 -07:00
animation_controller.hpp feat(animation): decompose AnimationController into FSM-based architecture 2026-04-05 12:27:35 +03:00
camera.hpp feat(rendering): GPU architecture + visual quality fixes 2026-04-04 13:43:16 +03:00
camera_controller.hpp feat(rendering): add HiZ occlusion culling & fix WMO interior shadows 2026-04-06 16:40:59 +03:00
celestial.hpp Add configurable MSAA anti-aliasing, update auth screen and terrain shader 2026-02-22 02:59:24 -08:00
character_preview.hpp fix(rendering): per-image semaphores and depth-format shadow placeholder 2026-04-03 17:52:48 -07:00
character_renderer.hpp fix(rendering): use separate timer for global sequence bones 2026-04-04 00:03:19 -07:00
charge_effect.hpp Add configurable MSAA anti-aliasing, update auth screen and terrain shader 2026-02-22 02:59:24 -08:00
clouds.hpp Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather 2026-02-22 23:20:13 -08:00
frustum.hpp Fix Windows frustum enum macro collision 2026-03-09 04:41:04 -07:00
hiz_system.hpp feat(rendering): add HiZ occlusion culling & fix WMO interior shadows 2026-04-06 16:40:59 +03:00
lens_flare.hpp Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather 2026-02-22 23:20:13 -08:00
levelup_effect.hpp Add 3D level-up effect using LevelUp.m2 spell model 2026-02-19 20:36:25 -08:00
lighting_manager.hpp Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather 2026-02-22 23:20:13 -08:00
lightning.hpp Add configurable MSAA anti-aliasing, update auth screen and terrain shader 2026-02-22 02:59:24 -08:00
loading_screen.hpp feat: show zone name on loading screen during world transitions 2026-03-20 18:12:23 -07:00
m2_model_classifier.hpp refactor(rendering): extract M2 classification into pure functions 2026-03-24 19:55:24 +03:00
m2_renderer.hpp feat(rendering): add HiZ occlusion culling & fix WMO interior shadows 2026-04-06 16:40:59 +03:00
material.hpp Initial commit: wowee native WoW 3.3.5a client 2026-02-02 13:03:22 -08:00
minimap.hpp fix: evict oldest minimap tile textures when cache exceeds 128 entries 2026-03-17 13:38:18 -07:00
mount_dust.hpp Add configurable MSAA anti-aliasing, update auth screen and terrain shader 2026-02-22 02:59:24 -08:00
overlay_system.hpp chore(refactor): god-object decomposition and mega-file splits 2026-04-05 19:30:44 +03:00
performance_hud.hpp Add gameplay systems: combat, spells, groups, loot, vendors, and UI 2026-02-04 10:31:03 -08:00
post_process_pipeline.hpp fix(rendering): defer model buffer destruction and per-frame FXAA descriptors 2026-04-03 19:17:55 -07:00
quest_marker_renderer.hpp feat: desaturate quest markers for trivial (gray) quests 2026-03-10 22:26:56 -07:00
render_graph.hpp feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
renderer.hpp feat(rendering): add HiZ occlusion culling & fix WMO interior shadows 2026-04-06 16:40:59 +03:00
sky_system.hpp Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather 2026-02-22 23:20:13 -08:00
skybox.hpp Enhanced sky atmosphere with DBC-driven colors, sun lighting, and zone weather 2026-02-22 23:20:13 -08:00
spell_visual_system.hpp chore(renderer): refactor renderer and add post-process + spell visuals systems 2026-04-02 00:21:21 +03:00
starfield.hpp Add configurable MSAA anti-aliasing, update auth screen and terrain shader 2026-02-22 02:59:24 -08:00
swim_effects.hpp Add ambient insect particles near water vegetation, fix firefly particles, and improve water foam 2026-02-23 07:18:44 -08:00
terrain_manager.hpp feat(rendering): GPU architecture + visual quality fixes 2026-04-04 13:43:16 +03:00
terrain_renderer.hpp feat(animation): 452 named constants, 30-phase character animation state machine 2026-04-04 23:02:53 +03:00
vk_buffer.hpp fix: return UINT32_MAX from findMemType on failure, add [[nodiscard]] 2026-03-27 14:53:29 -07:00
vk_context.hpp fix(vulkan): MSAA crash on AMD RADV due to vkCreateRenderPass2 null dispatch 2026-04-03 20:58:32 -07:00
vk_frame_data.hpp fix: data race on collision query profiling counters 2026-03-29 21:26:11 -07:00
vk_pipeline.hpp feat(rendering): GPU architecture + visual quality fixes 2026-04-04 13:43:16 +03:00
vk_render_target.hpp fix: add VkSampler cache to prevent sampler exhaustion crash 2026-03-24 11:44:54 -07:00
vk_shader.hpp refactor: add [[nodiscard]] to shader/asset load functions, suppress warnings 2026-03-27 15:17:19 -07:00
vk_texture.hpp fix(rendering): check sampler validity in VkTexture::isValid(), fix Windows build 2026-04-05 01:34:49 -07:00
vk_utils.hpp refactor: consolidate duplicate environment variable utility functions 2026-03-11 11:36:06 -07:00
water_renderer.hpp Add water refraction toggle with per-frame scene history 2026-03-06 19:15:34 -08:00
weather.hpp feat: add distinct STORM weather type with wind-driven particles 2026-03-20 15:56:58 -07:00
wmo_renderer.hpp fix(rendering): defer descriptor set destruction during streaming unload 2026-04-03 18:30:52 -07:00
world_map.hpp feat: show quest POI markers on the world map overlay 2026-03-20 15:00:29 -07:00