diff --git a/WickedEngine/shaders/ddgi_raytraceCS.hlsl b/WickedEngine/shaders/ddgi_raytraceCS.hlsl index 551b42521..bfe56c6aa 100644 --- a/WickedEngine/shaders/ddgi_raytraceCS.hlsl +++ b/WickedEngine/shaders/ddgi_raytraceCS.hlsl @@ -167,7 +167,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn newRay.Origin = surface.P; newRay.TMin = 0; newRay.TMax = dist; - newRay.Direction = L; + newRay.Direction = normalize(L); #ifdef RTAPI wiRayQuery q; @@ -198,7 +198,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn ray.Origin = probePos; ray.TMin = 0; // don't need TMin because we are not tracing from a surface ray.TMax = FLT_MAX; - ray.Direction = raydir; + ray.Direction = normalize(raydir); #ifdef RTAPI wiRayQuery q; @@ -394,7 +394,7 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn newRay.Origin = surface.P; newRay.TMin = 0.001; newRay.TMax = dist; - newRay.Direction = L + max3(surface.sss); + newRay.Direction = normalize(L + max3(surface.sss)); #ifdef RTAPI q.TraceRayInline( @@ -421,9 +421,9 @@ void main(uint3 DTid : SV_DispatchThreadID, uint3 Gid : SV_GroupID, uint groupIn // Infinite bounces based on previous frame probe sampling: if (push.frameIndex > 0) { - half energy_conservation = 0.95; + float energy_conservation = 0.95; energy_conservation /= PI; // one more divide by PI is inside the ddgi_sample_irradiance, with that we will have 2 PI divides, which is needed for hemishpere sampling - half3 ddgi = ddgi_sample_irradiance(surface.P, surface.facenormal, surface.dominant_lightdir, surface.dominant_lightcolor); + float3 ddgi = ddgi_sample_irradiance(surface.P, surface.facenormal, surface.dominant_lightdir, surface.dominant_lightcolor); ddgi *= energy_conservation; hit_result += ddgi; } diff --git a/WickedEngine/shaders/renderlightmapPS.hlsl b/WickedEngine/shaders/renderlightmapPS.hlsl index 8dff930e8..9982d884a 100644 --- a/WickedEngine/shaders/renderlightmapPS.hlsl +++ b/WickedEngine/shaders/renderlightmapPS.hlsl @@ -132,7 +132,7 @@ float4 main(Input input) : SV_TARGET RayDesc ray; ray.Origin = P; - ray.Direction = sample_hemisphere_cos(surface.N, rng); + ray.Direction = normalize(sample_hemisphere_cos(surface.N, rng)); ray.TMin = 0.0001; ray.TMax = FLT_MAX; float3 result = 0; diff --git a/WickedEngine/shaders/surfel_raytraceCS.hlsl b/WickedEngine/shaders/surfel_raytraceCS.hlsl index 6e89f977b..5ab8e7a2d 100644 --- a/WickedEngine/shaders/surfel_raytraceCS.hlsl +++ b/WickedEngine/shaders/surfel_raytraceCS.hlsl @@ -152,7 +152,7 @@ void main(uint3 DTid : SV_DispatchThreadID) newRay.Origin = surface.P; newRay.TMin = 0.001; newRay.TMax = dist; - newRay.Direction = L + max3(surface.sss); + newRay.Direction = normalize(L + max3(surface.sss)); #ifdef RTAPI wiRayQuery q; @@ -381,7 +381,7 @@ void main(uint3 DTid : SV_DispatchThreadID) newRay.Origin = surface.P; newRay.TMin = 0.001; newRay.TMax = dist; - newRay.Direction = L + max3(surface.sss); + newRay.Direction = normalize(L + max3(surface.sss)); #ifdef RTAPI q.TraceRayInline( @@ -444,7 +444,7 @@ void main(uint3 DTid : SV_DispatchThreadID) } if (surfel_gi.a > 0) { - half energy_conservation = 0.95; + float energy_conservation = 0.95; energy_conservation /= surfel_gi.a; energy_conservation /= PI; surfel_gi.rgb *= energy_conservation; diff --git a/WickedEngine/wiVersion.cpp b/WickedEngine/wiVersion.cpp index e62f253b0..89f8b7234 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 = 700; + const int revision = 701; const std::string version_string = std::to_string(major) + "." + std::to_string(minor) + "." + std::to_string(revision);