diff --git a/WickedEngine/wiRenderPath3D_PathTracing.cpp b/WickedEngine/wiRenderPath3D_PathTracing.cpp index 27769cf0c..1b397fccf 100644 --- a/WickedEngine/wiRenderPath3D_PathTracing.cpp +++ b/WickedEngine/wiRenderPath3D_PathTracing.cpp @@ -141,6 +141,7 @@ namespace wi wi::renderer::CreateBloomResources(bloomResources, internalResolution); setLightShaftsEnabled(getLightShaftsEnabled()); + setVolumeLightsEnabled(getVolumeLightsEnabled()); resetProgress(); @@ -399,7 +400,12 @@ namespace wi wi::profiler::EndRange(range); // Traced Scene } - }); + if (getVolumeLightsEnabled() && visibility_main.IsRequestedVolumetricLights()) + { + wi::renderer::DrawShadowmaps(visibility_main, cmd); + } + + }); if (scene->terrains.GetCount() > 0) { @@ -469,6 +475,8 @@ namespace wi ); } + RenderVolumetrics(cmd); + RenderLightShafts(cmd); // Composite other effects on top: @@ -522,6 +530,20 @@ namespace wi wi::renderer::DrawLightVisualizers(visibility_main, 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) { @@ -580,7 +602,8 @@ namespace wi getEyeAdaptionEnabled() ? &luminanceResources.luminance : nullptr, getBloomEnabled() ? &bloomResources.texture_bloom : nullptr, colorspace, - getTonemap() + getTonemap(), + &distortion_overlay ); lastPostprocessRT = &rtPostprocess; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 1895056c3..ae2ecfa88 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 = 546; + const int revision = 547; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);