diff --git a/Content/Engine/SkyboxMaterial.flax b/Content/Engine/SkyboxMaterial.flax index 93520c5c7..de68ea44f 100644 --- a/Content/Engine/SkyboxMaterial.flax +++ b/Content/Engine/SkyboxMaterial.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:d675325fc074b852fff5dd94ff665f444b977aaca9969619b27fe295d6d48b96 -size 31631 +oid sha256:be4e4468ef698bcc5e3caa9f2ec28032f9a2fc1aa0a57d9239228f2eae2d7643 +size 31317 diff --git a/Content/Shaders/GlobalSignDistanceField.flax b/Content/Shaders/GlobalSignDistanceField.flax index 46971ccc6..7286b3cee 100644 --- a/Content/Shaders/GlobalSignDistanceField.flax +++ b/Content/Shaders/GlobalSignDistanceField.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7495a80f1e16092ebf0d0ec7564806860ed19ae9f58fee0b4eb84e8497bc14d7 -size 17303 +oid sha256:990533ae0d54ab3b627c6c0e41afb0517c500ade3e41369c44dd4e3319e5585d +size 17327 diff --git a/Content/Shaders/Lights.flax b/Content/Shaders/Lights.flax index d25010179..f14878cb2 100644 --- a/Content/Shaders/Lights.flax +++ b/Content/Shaders/Lights.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:74b42736cc3e3c5d81827e5b595eed0bc7f1356753fd76818b72d72fc5857745 -size 5270 +oid sha256:c78b7ee42dbc073b4db329e7c10c2bc1d321f1ab7137b8c29dfdd53ee219e2bf +size 5278 diff --git a/Content/Shaders/SMAA.flax b/Content/Shaders/SMAA.flax index 0ce75b266..1f48782c9 100644 --- a/Content/Shaders/SMAA.flax +++ b/Content/Shaders/SMAA.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3128227f815eb1b8c126362c378bdd1089aa75995f7380a38f3dbef6f2acba58 -size 46481 +oid sha256:dc656a344b32043fe8998d0b4966da591f141655fd2db66fa727a87da02dedef +size 46525 diff --git a/Source/Shaders/ACES.hlsl b/Source/Shaders/ACES.hlsl index 322bf31e0..2ae650687 100644 --- a/Source/Shaders/ACES.hlsl +++ b/Source/Shaders/ACES.hlsl @@ -238,7 +238,7 @@ float cubic_basis_shaper if ((x > knots[0]) && (x < knots[4])) { float knot_coord = (x - knots[0]) * 4.0 / w; - int j = knot_coord; + int j = (int)knot_coord; float t = knot_coord - j; float monomials[4] = { t*t*t, t*t, t, 1.0 }; @@ -338,7 +338,7 @@ float segmented_spline_c5_fwd( float x ) else if (( logx > log10(C.minPoint.x) ) && ( logx < log10(C.midPoint.x) )) { float knot_coord = (N_KNOTS_LOW-1) * (logx-log10(C.minPoint.x))/(log10(C.midPoint.x)-log10(C.minPoint.x)); - int j = knot_coord; + int j = (int)knot_coord; float t = knot_coord - j; float3 cf = { C.coefsLow[ j], C.coefsLow[ j + 1], C.coefsLow[ j + 2]}; @@ -349,7 +349,7 @@ float segmented_spline_c5_fwd( float x ) else if (( logx >= log10(C.midPoint.x) ) && ( logx < log10(C.maxPoint.x) )) { float knot_coord = (N_KNOTS_HIGH-1) * (logx-log10(C.midPoint.x))/(log10(C.maxPoint.x)-log10(C.midPoint.x)); - int j = knot_coord; + int j = (int)knot_coord; float t = knot_coord - j; float3 cf = { C.coefsHigh[ j], C.coefsHigh[ j + 1], C.coefsHigh[ j + 2]}; @@ -486,7 +486,7 @@ float segmented_spline_c9_fwd( float x, const SegmentedSplineParams_c9 C ) else if ((logx > log10(C.minPoint.x)) && (logx < log10(C.midPoint.x))) { float knot_coord = (N_KNOTS_LOW - 1) * (logx - log10(C.minPoint.x)) / (log10(C.midPoint.x) - log10(C.minPoint.x)); - int j = knot_coord; + int j = (int)knot_coord; float t = knot_coord - j; float3 cf = { C.coefsLow[j], C.coefsLow[j + 1], C.coefsLow[j + 2] }; @@ -497,7 +497,7 @@ float segmented_spline_c9_fwd( float x, const SegmentedSplineParams_c9 C ) else if ((logx >= log10(C.midPoint.x)) && (logx < log10(C.maxPoint.x))) { float knot_coord = (N_KNOTS_HIGH - 1) * (logx - log10(C.midPoint.x)) / (log10(C.maxPoint.x) - log10(C.midPoint.x)); - int j = knot_coord; + int j = (int)knot_coord; float t = knot_coord - j; float3 cf = { C.coefsHigh[j], C.coefsHigh[j + 1], C.coefsHigh[j + 2] }; diff --git a/Source/Shaders/GI/DDGI.shader b/Source/Shaders/GI/DDGI.shader index 98f54339b..213c6fca9 100644 --- a/Source/Shaders/GI/DDGI.shader +++ b/Source/Shaders/GI/DDGI.shader @@ -296,24 +296,17 @@ void CS_Classify(uint3 DispatchThreadId : SV_DispatchThreadID) #endif { #if DDGI_PROBE_RELOCATE_FIND_BEST - // Sample Global SDF around the probe base location + // Sample Global SDF around the probe base location and select the best probe offset uint sdfCascade = GetGlobalSDFCascade(GlobalSDF, probeBasePosition); - float4 CachedProbeOffsets[64]; + float4 bestOffset = float4(0, 0, 0, 0); for (uint x = 0; x < 4; x++) for (uint y = 0; y < 4; y++) for (uint z = 0; z < 4; z++) { float3 offset = Remap(float3(x, y, z), 0, 3, -0.707f, 0.707f) * relocateLimit; float offsetSdf = SampleGlobalSDFCascade(GlobalSDF, GlobalSDFTex, probeBasePosition + offset, sdfCascade); - CachedProbeOffsets[x * 16 + y * 4 + z] = float4(offset, offsetSdf); - } - - // Select the best probe location around the base position - float4 bestOffset = CachedProbeOffsets[0]; - for (uint i = 1; i < 64; i++) - { - if (CachedProbeOffsets[i].w > bestOffset.w) - bestOffset = CachedProbeOffsets[i]; + if (offsetSdf > bestOffset.w) + bestOffset = float4(offset, offsetSdf); } if (bestOffset.w <= voxelLimit) { diff --git a/Source/Shaders/GlobalSignDistanceField.shader b/Source/Shaders/GlobalSignDistanceField.shader index ac6a20536..3713e049a 100644 --- a/Source/Shaders/GlobalSignDistanceField.shader +++ b/Source/Shaders/GlobalSignDistanceField.shader @@ -328,7 +328,7 @@ float4 PS_Debug(Quad_VS2PS input) : SV_Target if (hit.IsHit()) { // Normalize step count back to default scale (higher precision is just for preview) - hit.StepsCount *= stepScale; + hit.StepsCount = (uint)(hit.StepsCount * stepScale); #if 1 float3 hitPosition = hit.GetHitPosition(trace); diff --git a/Source/Shaders/Lights.shader b/Source/Shaders/Lights.shader index 8b9c00d78..fa4763faf 100644 --- a/Source/Shaders/Lights.shader +++ b/Source/Shaders/Lights.shader @@ -171,7 +171,7 @@ float4 PS_Complexity(Quad_VS2PS input) : SV_Target0 float4(1.0, 0.0, 0.5, 1.0), float4(1.0, 0.9, 0.9, 1.0) }; - return colors[min(complexity * colorsCount, colorsCount - 1)] * outline; + return colors[min((uint)(complexity * colorsCount), colorsCount - 1)] * outline; } #endif diff --git a/Source/Shaders/SMAA.shader b/Source/Shaders/SMAA.shader index 00139982a..6c129e6d4 100644 --- a/Source/Shaders/SMAA.shader +++ b/Source/Shaders/SMAA.shader @@ -610,6 +610,7 @@ float4 SMAADecodeDiagBilinearAccess(float4 e) { * These functions allows to perform diagonal pattern searches. */ float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) { + e = float2(0, 0); float4 coord = float4(texcoord, -1.0, 1.0); float3 t = float3(SMAA_RT_METRICS.xy, 1.0); while (coord.z < float(SMAA_MAX_SEARCH_STEPS_DIAG - 1) && @@ -622,6 +623,7 @@ float2 SMAASearchDiag1(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out } float2 SMAASearchDiag2(SMAATexture2D(edgesTex), float2 texcoord, float2 dir, out float2 e) { + e = float2(0, 0); float4 coord = float4(texcoord, -1.0, 1.0); coord.x += 0.25 * SMAA_RT_METRICS.x; // See @SearchDiag2Optimization float3 t = float3(SMAA_RT_METRICS.xy, 1.0); diff --git a/Source/Shaders/SSR.hlsl b/Source/Shaders/SSR.hlsl index e504b9655..63d55c062 100644 --- a/Source/Shaders/SSR.hlsl +++ b/Source/Shaders/SSR.hlsl @@ -89,7 +89,7 @@ float3 TraceScreenSpaceReflection( bool validHit = false; uint2 depthBufferSize; depthBuffer.GetDimensions(depthBufferSize.x, depthBufferSize.y); - float3 hit = FFX_SSSR_HierarchicalRaymarch(depthBuffer, hzbMips, depthDiffError, uncertainHit, startUV, rayUV, depthBufferSize, 0, numSamples, validHit); + float3 hit = FFX_SSSR_HierarchicalRaymarch(depthBuffer, hzbMips, depthDiffError, uncertainHit, startUV, rayUV, (float2)depthBufferSize, 0, (uint)numSamples, validHit); if (!validHit) return 0; currOffset = hit; diff --git a/Source/ThirdParty/FidelityFX/ffx_sssr.h b/Source/ThirdParty/FidelityFX/ffx_sssr.h index b57238ae9..fe580b73e 100644 --- a/Source/ThirdParty/FidelityFX/ffx_sssr.h +++ b/Source/ThirdParty/FidelityFX/ffx_sssr.h @@ -79,7 +79,7 @@ bool FFX_SSSR_AdvanceRay(float3 origin, float3 direction, float3 inv_direction, } float2 FFX_SSSR_GetMipResolution(float2 screen_dimensions, int mip_level) { - return screen_dimensions * pow(0.5, mip_level); + return screen_dimensions * pow(0.5, (float)mip_level); } // Requires origin and direction of the ray to be in screen space [0, 1] x [0, 1] @@ -95,11 +95,11 @@ float3 FFX_SSSR_HierarchicalRaymarch(Texture2D depthBuffer, uint hzbMips, float // Offset to the bounding boxes uv space to intersect the ray with the center of the next pixel. // This means we ever so slightly over shoot into the next region. - float2 uv_offset = 0.005 * exp2(most_detailed_mip) / screen_size; + float2 uv_offset = 0.005 * exp2((float)most_detailed_mip) / screen_size; uv_offset = select(direction.xy < 0, -uv_offset, uv_offset); // Offset applied depending on current mip resolution to move the boundary to the left/right upper/lower border depending on ray direction. - float2 floor_offset = select(direction.xy < 0, 0, 1); + float2 floor_offset = select(direction.xy < 0, float2(0, 0), float2(1, 1)); // Initially advance ray to avoid immediate self intersections. float current_t;