mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Fix water transparency on resize by rebuilding scene history resources
Water scene history textures and 1x pass resources were not recreated on window resize/fullscreen, causing stale undersized textures that produced directional transparency artifacts.
This commit is contained in:
parent
03a62526e1
commit
085fd09b9d
1 changed files with 7 additions and 7 deletions
|
|
@ -914,13 +914,13 @@ void Renderer::beginFrame() {
|
|||
// Handle swapchain recreation if needed
|
||||
if (vkCtx->isSwapchainDirty()) {
|
||||
vkCtx->recreateSwapchain(window->getWidth(), window->getHeight());
|
||||
// Rebuild water 1x framebuffers (they reference swapchain image views)
|
||||
if (waterRenderer && waterRenderer->hasWater1xPass()
|
||||
&& vkCtx->getMsaaSamples() != VK_SAMPLE_COUNT_1_BIT) {
|
||||
VkImageView depthView = vkCtx->getDepthResolveImageView();
|
||||
if (depthView) {
|
||||
waterRenderer->createWater1xFramebuffers(
|
||||
vkCtx->getSwapchainImageViews(), depthView, vkCtx->getSwapchainExtent());
|
||||
// Rebuild water resources that reference swapchain extent/views
|
||||
if (waterRenderer) {
|
||||
waterRenderer->recreatePipelines();
|
||||
if (waterRenderer->hasWater1xPass()
|
||||
&& vkCtx->getMsaaSamples() != VK_SAMPLE_COUNT_1_BIT) {
|
||||
waterRenderer->destroyWater1xResources();
|
||||
setupWater1xPass();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue