diff --git a/Editor/LightWindow.cpp b/Editor/LightWindow.cpp index 256efce8b..df413853f 100644 --- a/Editor/LightWindow.cpp +++ b/Editor/LightWindow.cpp @@ -9,7 +9,7 @@ void LightWindow::Create(EditorComponent* _editor) { editor = _editor; wi::gui::Window::Create(ICON_POINTLIGHT " Light", wi::gui::Window::WindowControls::COLLAPSE | wi::gui::Window::WindowControls::CLOSE); - SetSize(XMFLOAT2(650, 860)); + SetSize(XMFLOAT2(650, 900)); closeButton.SetTooltip("Delete LightComponent"); OnClose([=](wi::gui::EventArgs args) { diff --git a/WickedEngine/wiRenderPath3D.cpp b/WickedEngine/wiRenderPath3D.cpp index 6687c4aed..5e07650c0 100644 --- a/WickedEngine/wiRenderPath3D.cpp +++ b/WickedEngine/wiRenderPath3D.cpp @@ -1961,15 +1961,45 @@ namespace wi Rect scissor = GetScissorInternalResolution(); device->BindScissorRects(1, &scissor, cmd); + Viewport vp; + vp.width = (float)depthBuffer_Main.GetDesc().width; + vp.height = (float)depthBuffer_Main.GetDesc().height; + vp.min_depth = 0; + vp.max_depth = 1; + device->BindViewports(1, &vp, cmd); + + // Note: volumetrics and light shafts are blended before transparent scene, because they used depth of the opaques + + if (getVolumeLightsEnabled() && visibility_main.IsRequestedVolumetricLights()) + { + device->EventBegin("Contribute Volumetric Lights", cmd); + wi::renderer::Postprocess_Upsample_Bilateral( + rtVolumetricLights, + rtLinearDepth, + rtMain, + cmd, + true, + 1.5f + ); + device->EventEnd(cmd); + } + + XMVECTOR sunDirection = XMLoadFloat3(&scene->weather.sunDirection); + if (getLightShaftsEnabled() && XMVectorGetX(XMVector3Dot(sunDirection, camera->GetAt())) > 0) + { + device->EventBegin("Contribute LightShafts", cmd); + wi::image::Params fx; + fx.enableFullScreen(); + fx.blendFlag = BLENDMODE_ADDITIVE; + wi::image::Draw(&rtSun[1], fx, cmd); + device->EventEnd(cmd); + } + // Transparent scene { auto range = wi::profiler::BeginRangeGPU("Transparent Scene", cmd); device->EventBegin("Transparent Scene", cmd); - Viewport vp; - vp.width = (float)depthBuffer_Main.GetDesc().width; - vp.height = (float)depthBuffer_Main.GetDesc().height; - // Foreground: vp.min_depth = 1 - foreground_depth_range; vp.max_depth = 1; @@ -2009,31 +2039,6 @@ namespace wi wi::renderer::DrawSoftParticles(visibility_main, false, cmd); wi::renderer::DrawSpritesAndFonts(*scene, *camera, false, cmd); - if (getVolumeLightsEnabled() && visibility_main.IsRequestedVolumetricLights()) - { - device->EventBegin("Contribute Volumetric Lights", cmd); - wi::renderer::Postprocess_Upsample_Bilateral( - rtVolumetricLights, - rtLinearDepth, - rtMain, - cmd, - true, - 1.5f - ); - device->EventEnd(cmd); - } - - XMVECTOR sunDirection = XMLoadFloat3(&scene->weather.sunDirection); - if (getLightShaftsEnabled() && XMVectorGetX(XMVector3Dot(sunDirection, camera->GetAt())) > 0) - { - device->EventBegin("Contribute LightShafts", cmd); - wi::image::Params fx; - fx.enableFullScreen(); - fx.blendFlag = BLENDMODE_ADDITIVE; - wi::image::Draw(&rtSun[1], fx, cmd); - device->EventEnd(cmd); - } - if (getLensFlareEnabled()) { wi::renderer::DrawLensFlares( diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 0fcf143a3..f6878bf1c 100644 --- a/WickedEngine/wiVersion.cpp +++ b/WickedEngine/wiVersion.cpp @@ -9,7 +9,7 @@ namespace wi::version // minor features, major updates, breaking compatibility changes const int minor = 71; // minor bug fixes, alterations, refactors, updates - const int revision = 504; + const int revision = 505; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);