mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Implement terrain shadow casting in shadow depth pass
Add initializeShadow() to TerrainRenderer that creates a depth-only shadow pipeline reusing the existing shadow.vert/frag shaders (same path as WMO/M2/character renderers). renderShadow() draws all terrain chunks with sphere culling against the shadow coverage radius. Wire both init and draw calls into Renderer so terrain now casts shadows alongside buildings and NPCs.
This commit is contained in:
parent
2afd455d52
commit
6a681bcf67
3 changed files with 234 additions and 6 deletions
|
|
@ -4998,6 +4998,11 @@ bool Renderer::initializeRenderers(pipeline::AssetManager* assetManager, const s
|
|||
terrainRenderer.reset();
|
||||
return false;
|
||||
}
|
||||
if (shadowRenderPass != VK_NULL_HANDLE) {
|
||||
terrainRenderer->initializeShadow(shadowRenderPass);
|
||||
}
|
||||
} else if (!terrainRenderer->hasShadowPipeline() && shadowRenderPass != VK_NULL_HANDLE) {
|
||||
terrainRenderer->initializeShadow(shadowRenderPass);
|
||||
}
|
||||
|
||||
// Create water renderer if not already created
|
||||
|
|
@ -5724,6 +5729,9 @@ void Renderer::renderShadowPass() {
|
|||
|
||||
// Phase 7/8: render shadow casters
|
||||
const float shadowCullRadius = shadowDistance_ * 1.35f;
|
||||
if (terrainRenderer) {
|
||||
terrainRenderer->renderShadow(currentCmd, lightSpaceMatrix, shadowCenter, shadowCullRadius);
|
||||
}
|
||||
if (wmoRenderer) {
|
||||
wmoRenderer->renderShadow(currentCmd, lightSpaceMatrix, shadowCenter, shadowCullRadius);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue