From 003584863003a963718926c4e93ffe97ac00a6ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tur=C3=A1nszki=20J=C3=A1nos?= Date: Thu, 31 Aug 2023 07:40:42 +0200 Subject: [PATCH] raytraced reflection fix: static sky can also be reflected --- WickedEngine/shaders/rtreflectionCS.hlsl | 11 ++++++++++- WickedEngine/wiVersion.cpp | 3 ++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/WickedEngine/shaders/rtreflectionCS.hlsl b/WickedEngine/shaders/rtreflectionCS.hlsl index fc2ba56a2..de5ecf249 100644 --- a/WickedEngine/shaders/rtreflectionCS.hlsl +++ b/WickedEngine/shaders/rtreflectionCS.hlsl @@ -113,7 +113,16 @@ void main(uint2 DTid : SV_DispatchThreadID) if (q.CommittedStatus() != COMMITTED_TRIANGLE_HIT) { // miss: - payload.data.xyz += GetDynamicSkyColor(q.WorldRayDirection()); + [branch] + if (IsStaticSky()) + { + // We have envmap information in a texture: + payload.data.xyz += GetStaticSkyColor(q.WorldRayDirection()); + } + else + { + payload.data.xyz += GetDynamicSkyColor(q.WorldRayDirection()); + } payload.data.w = FLT_MAX; } else diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index 557194845..1d5023428 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 = 282; + const int revision = 283; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision); @@ -139,6 +139,7 @@ Patreon supporters - Nicolas Embleton - Desuuc - radino1977 +- Anthony Curtis )"; return credits;