From c878c613c799c224ee0612f2f61b5a6d0300e53c Mon Sep 17 00:00:00 2001 From: Wojtek Figat Date: Sun, 5 Feb 2023 23:48:11 +0100 Subject: [PATCH] Update consoles building --- Content/Shaders/GI/DDGI.flax | 4 ++-- Content/Shaders/GI/GlobalSurfaceAtlas.flax | 4 ++-- Content/Shaders/GUI.flax | 4 ++-- Content/Shaders/GlobalSignDistanceField.flax | 4 ++-- Content/Shaders/ProbesFilter.flax | 4 ++-- Content/Shaders/SSR.flax | 4 ++-- Content/Shaders/TAA.flax | 4 ++-- Source/Editor/Cooker/Steps/CookAssetsStep.cpp | 5 ++++- .../GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp | 1 + .../GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp | 2 +- Source/Engine/Level/Scene/SceneRendering.cpp | 2 +- Source/Engine/Level/Scene/SceneRendering.h | 2 +- Source/Engine/Particles/Particles.cpp | 2 +- .../Engine/Renderer/GlobalSignDistanceFieldPass.cpp | 2 +- Source/Engine/Renderer/PostProcessingPass.cpp | 2 +- Source/Engine/Renderer/ProbesRenderer.cpp | 6 +++--- Source/Shaders/Atmosphere.hlsl | 6 +----- Source/Shaders/GI/DDGI.hlsl | 2 +- Source/Shaders/GI/DDGI.shader | 4 ++-- Source/Shaders/GI/GlobalSurfaceAtlas.hlsl | 2 +- Source/Shaders/GI/GlobalSurfaceAtlas.shader | 2 +- Source/Shaders/GUI.shader | 2 +- Source/Shaders/GlobalSignDistanceField.shader | 12 ++++++++++-- Source/Shaders/ProbesFilter.shader | 2 +- Source/Shaders/SSR.shader | 6 +++--- Source/Shaders/ShadowsSampling.hlsl | 2 +- Source/Shaders/TAA.shader | 2 +- 27 files changed, 51 insertions(+), 43 deletions(-) diff --git a/Content/Shaders/GI/DDGI.flax b/Content/Shaders/GI/DDGI.flax index 5ad91546e..6b387f70b 100644 --- a/Content/Shaders/GI/DDGI.flax +++ b/Content/Shaders/GI/DDGI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7e314ba50df6a9358dfe10d383f20e7a4bb30e180e32f5bb83e8a63d9dfbcb39 -size 23668 +oid sha256:d851e919211c073ac83ba5e9e2c75529164c588ea1ace8eca858995643f5744a +size 23686 diff --git a/Content/Shaders/GI/GlobalSurfaceAtlas.flax b/Content/Shaders/GI/GlobalSurfaceAtlas.flax index f74572140..fc09f8b77 100644 --- a/Content/Shaders/GI/GlobalSurfaceAtlas.flax +++ b/Content/Shaders/GI/GlobalSurfaceAtlas.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8b69d6b93baa29702789073f911dbe784dc65ccd66a43cef837a217959d24d13 -size 12612 +oid sha256:de6aea50d923fb5ca9fec7a9eb2186e643a3edad21772a12ee27e703050aee77 +size 12616 diff --git a/Content/Shaders/GUI.flax b/Content/Shaders/GUI.flax index fc197f16a..e46a9abf3 100644 --- a/Content/Shaders/GUI.flax +++ b/Content/Shaders/GUI.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b0560421c43d81b73bc970ea77ff5d72661ef3817bbbf38cb91297596fb4c583 -size 5111 +oid sha256:9f30f532a71194bb7a2d3b538b18cff80862407c9950516c4751767df8290d63 +size 4951 diff --git a/Content/Shaders/GlobalSignDistanceField.flax b/Content/Shaders/GlobalSignDistanceField.flax index 8014efcd5..e013618f3 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:0a96e3dec992385e4e4e7073fdd990baf1351d027648c7e52808c3eaceb55348 -size 11787 +oid sha256:3e12440d4fcc78a0d7e07da6584efcc95750046db500d0aff2dc9a41360aac36 +size 11798 diff --git a/Content/Shaders/ProbesFilter.flax b/Content/Shaders/ProbesFilter.flax index 219e309e4..4df12098a 100644 --- a/Content/Shaders/ProbesFilter.flax +++ b/Content/Shaders/ProbesFilter.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c86511466b35459fd56d56bbb967eeba2a62f81ff3bbb5350caa4053f582424c -size 2108 +oid sha256:7f61b3517bafb1f02771a39b9fff037495b893525de272d89e2c211985cfb30f +size 2032 diff --git a/Content/Shaders/SSR.flax b/Content/Shaders/SSR.flax index 9e63ae962..a422ce5c0 100644 --- a/Content/Shaders/SSR.flax +++ b/Content/Shaders/SSR.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:c400f07912ab73b91d4707ebbb94127b835265365ac37a6264e54e9dbba92f9f -size 11205 +oid sha256:0317fb2ca888fee6d32c7754d6f83e2f1e58924725a8221c5131e974501168ac +size 10912 diff --git a/Content/Shaders/TAA.flax b/Content/Shaders/TAA.flax index e9575793e..03d9d6617 100644 --- a/Content/Shaders/TAA.flax +++ b/Content/Shaders/TAA.flax @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:26cf20668dc0d93fdffa3ea715130b618e9c491e73dc8be779c1d182e73b255b -size 3257 +oid sha256:9c528dc72d727f847b89da70b827b629e7eec8dc7205cf50b212152e62a0786c +size 3265 diff --git a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp index 1b6d13fa6..92ebf39f6 100644 --- a/Source/Editor/Cooker/Steps/CookAssetsStep.cpp +++ b/Source/Editor/Cooker/Steps/CookAssetsStep.cpp @@ -354,7 +354,7 @@ bool CookAssetsStep::Process(CookingData& data, CacheData& cache, Asset* asset) if (asset->WaitForLoaded()) { LOG(Error, "Failed to load asset \'{0}\'", asset->ToString()); - return false; + return true; } // Switch based on an asset type @@ -1132,7 +1132,10 @@ bool CookAssetsStep::Perform(CookingData& data) // Cook asset if (Process(data, cache, assetRef.Get())) + { + cache.Save(); return true; + } data.Stats.CookedAssets++; // Auto save build cache after every few cooked assets (reduces next build time if cooking fails later) diff --git a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp index 2ac639e30..10d85c179 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX11/GPUContextDX11.cpp @@ -428,6 +428,7 @@ void GPUContextDX11::Dispatch(GPUShaderProgramCS* shader, uint32 threadGroupCoun void GPUContextDX11::DispatchIndirect(GPUShaderProgramCS* shader, GPUBuffer* bufferForArgs, uint32 offsetForArgs) { + ASSERT(bufferForArgs && EnumHasAnyFlags(bufferForArgs->GetFlags(), GPUBufferFlags::Argument)); CurrentCS = (GPUShaderProgramCSDX11*)shader; auto bufferForArgsDX11 = (GPUBufferDX11*)bufferForArgs; diff --git a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp index 0f389a9c3..5d2d97f0b 100644 --- a/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp +++ b/Source/Engine/GraphicsDevice/DirectX/DX12/GPUBufferDX12.cpp @@ -111,7 +111,7 @@ bool GPUBufferDX12::OnInit() if (useUAV) resourceDesc.Flags |= D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS; #if PLATFORM_XBOX_SCARLETT || PLATFORM_XBOX_ONE - if (_desc.Flags & GPUBufferFlags::Argument) + if (EnumHasAnyFlags(_desc.Flags, GPUBufferFlags::Argument)) resourceDesc.Flags |= D3D12XBOX_RESOURCE_FLAG_ALLOW_INDIRECT_BUFFER; #endif diff --git a/Source/Engine/Level/Scene/SceneRendering.cpp b/Source/Engine/Level/Scene/SceneRendering.cpp index 7f3d32ecc..b75cd6851 100644 --- a/Source/Engine/Level/Scene/SceneRendering.cpp +++ b/Source/Engine/Level/Scene/SceneRendering.cpp @@ -152,7 +152,7 @@ void SceneRendering::AddActor(Actor* a, int32& key) listener->OnSceneRenderingAddActor(a); } -void SceneRendering::UpdateActor(Actor* a, int32 key) +void SceneRendering::UpdateActor(Actor* a, int32& key) { const int32 category = a->_drawCategory; ScopeLock lock(Locker); diff --git a/Source/Engine/Level/Scene/SceneRendering.h b/Source/Engine/Level/Scene/SceneRendering.h index 1fa3bc725..ef9fc6c3c 100644 --- a/Source/Engine/Level/Scene/SceneRendering.h +++ b/Source/Engine/Level/Scene/SceneRendering.h @@ -123,7 +123,7 @@ public: public: void AddActor(Actor* a, int32& key); - void UpdateActor(Actor* a, int32 key); + void UpdateActor(Actor* a, int32& key); void RemoveActor(Actor* a, int32& key); FORCE_INLINE void AddPostFxProvider(IPostFxSettingsProvider* obj) diff --git a/Source/Engine/Particles/Particles.cpp b/Source/Engine/Particles/Particles.cpp index b1ab02f18..873c4bd52 100644 --- a/Source/Engine/Particles/Particles.cpp +++ b/Source/Engine/Particles/Particles.cpp @@ -320,7 +320,7 @@ void DrawEmitterCPU(RenderContext& renderContext, ParticleBuffer* buffer, DrawCa auto positionOffset = emitter->Graph.GetPositionAttributeOffset(); if (positionOffset == -1 || buffer->CPU.Count < 2 || buffer->CPU.RibbonOrder.IsEmpty()) break; - int32 count = buffer->CPU.Count; + uint32 count = buffer->CPU.Count; ASSERT(buffer->CPU.RibbonOrder.Count() == emitter->Graph.RibbonRenderingModules.Count() * buffer->Capacity); int32* ribbonOrderData = buffer->CPU.RibbonOrder.Get() + module->RibbonOrderOffset; ParticleBufferCPUDataAccessor positionData(buffer, emitter->Graph.Layout.GetAttributeOffset(module->Attributes[0])); diff --git a/Source/Engine/Renderer/GlobalSignDistanceFieldPass.cpp b/Source/Engine/Renderer/GlobalSignDistanceFieldPass.cpp index fb3b9ee39..993b0c4b7 100644 --- a/Source/Engine/Renderer/GlobalSignDistanceFieldPass.cpp +++ b/Source/Engine/Renderer/GlobalSignDistanceFieldPass.cpp @@ -64,7 +64,7 @@ PACK_STRUCT(struct ModelsRasterizeData Int3 ChunkCoord; float MaxDistance; Float3 CascadeCoordToPosMul; - int32 ObjectsCount; + uint32 ObjectsCount; Float3 CascadeCoordToPosAdd; int32 CascadeResolution; int32 CascadeIndex; diff --git a/Source/Engine/Renderer/PostProcessingPass.cpp b/Source/Engine/Renderer/PostProcessingPass.cpp index 159282bcd..760b12ea0 100644 --- a/Source/Engine/Renderer/PostProcessingPass.cpp +++ b/Source/Engine/Renderer/PostProcessingPass.cpp @@ -198,7 +198,7 @@ void PostProcessingPass::Render(RenderContext& renderContext, GPUTexture* input, if (checkIfSkipPass() || !(useBloom || useToneMapping || useCameraArtifacts)) { // Resources are missing. Do not perform rendering. Just copy raw frame - context->SetViewportAndScissors(output->Width(), output->Height()); + context->SetViewportAndScissors((float)output->Width(), (float)output->Height()); context->SetRenderTarget(*output); context->Draw(input); return; diff --git a/Source/Engine/Renderer/ProbesRenderer.cpp b/Source/Engine/Renderer/ProbesRenderer.cpp index 769765102..e24022b07 100644 --- a/Source/Engine/Renderer/ProbesRenderer.cpp +++ b/Source/Engine/Renderer/ProbesRenderer.cpp @@ -73,7 +73,7 @@ PACK_STRUCT(struct Data { Float2 Dummy0; int32 CubeFace; - int32 SourceMipIndex; + float SourceMipIndex; }); namespace ProbesRendererImpl @@ -515,8 +515,8 @@ void ProbesRenderer::OnRender(RenderTask* task, GPUContext* context) auto cb = shader->GetCB(0); for (int32 mipIndex = 1; mipIndex < mipLevels; mipIndex++) { - int32 mipSize = 1 << (mipLevels - mipIndex - 1); - data.SourceMipIndex = mipIndex - 1; + const int32 mipSize = 1 << (mipLevels - mipIndex - 1); + data.SourceMipIndex = (float)mipIndex - 1.0f; context->SetViewportAndScissors((float)mipSize, (float)mipSize); for (int32 faceIndex = 0; faceIndex < 6; faceIndex++) { diff --git a/Source/Shaders/Atmosphere.hlsl b/Source/Shaders/Atmosphere.hlsl index 93fbf8d9c..2d68bd033 100644 --- a/Source/Shaders/Atmosphere.hlsl +++ b/Source/Shaders/Atmosphere.hlsl @@ -220,13 +220,9 @@ float3 TransmittanceWithDistance(float radius, float Mu, float D) float R1 = sqrt(radius * radius + D * D + 2.0 * radius * Mu * D); float Mu1 = (radius * Mu + D) / R1; if (Mu > 0.0) - { result = min(Transmittance(radius, Mu) / Transmittance(R1, Mu1), 1.0); - } else - { result = min(Transmittance(R1, -Mu1) / Transmittance(radius, -Mu), 1.0); - } return result; } @@ -249,7 +245,7 @@ float OpticalDepthWithDistance(float H, float radius, float Mu, float D) float particleDensity = 6.2831; // REK 04, Table 2 float a = sqrt(0.5 / H * radius); float2 A01 = a * float2(Mu, Mu + D / radius); - float2 A01Sign = sign(A01); + float2 A01Sign = (float2)sign(A01); float2 A01Squared = A01 * A01; float x = A01Sign.y > A01Sign.x ? exp(A01Squared.x) : 0.0; float2 y = A01Sign / (2.3193 * abs(A01) + sqrt(1.52 * A01Squared + 4.0)) * float2(1.0, exp(-D / H * (D / (2.0 * radius) + Mu))); diff --git a/Source/Shaders/GI/DDGI.hlsl b/Source/Shaders/GI/DDGI.hlsl index 2fe741133..ba91e632c 100644 --- a/Source/Shaders/GI/DDGI.hlsl +++ b/Source/Shaders/GI/DDGI.hlsl @@ -232,7 +232,7 @@ float3 SampleDDGIIrradiance(DDGIData data, Texture2D probesData, T weight *= Square(weight) * (1.0f / (minWeightThreshold * minWeightThreshold)); // Calculate trilinear weights based on the distance to each probe to smoothly transition between grid of 8 probes - float3 trilinear = lerp(1.0f - biasAlpha, biasAlpha, probeCoordsOffset); + float3 trilinear = lerp(1.0f - biasAlpha, biasAlpha, (float3)probeCoordsOffset); weight *= max(trilinear.x * trilinear.y * trilinear.z, 0.001f); // Sample irradiance texture diff --git a/Source/Shaders/GI/DDGI.shader b/Source/Shaders/GI/DDGI.shader index 258b38474..1c7b577b2 100644 --- a/Source/Shaders/GI/DDGI.shader +++ b/Source/Shaders/GI/DDGI.shader @@ -54,7 +54,7 @@ float3 GetSphericalFibonacci(float sampleIndex, float samplesCount) // Calculates a random normalized ray direction (based on the ray index and the current probes rotation phrase) float3 GetProbeRayDirection(DDGIData data, uint rayIndex) { - float3 direction = GetSphericalFibonacci(rayIndex, data.RaysCount); + float3 direction = GetSphericalFibonacci((float)rayIndex, (float)data.RaysCount); return normalize(QuaternionRotate(data.RaysRotation, direction)); } @@ -307,7 +307,7 @@ void CS_TraceRays(uint3 DispatchThreadId : SV_DispatchThreadID) else { // Ray hits sky - radiance.rgb = Skybox.SampleLevel(SamplerLinearClamp, probeRayDirection, 0); + radiance.rgb = Skybox.SampleLevel(SamplerLinearClamp, probeRayDirection, 0).rgb; radiance.a = 1e27f; // Sky is the limit } diff --git a/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl b/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl index 7c1cdc489..8676e3f87 100644 --- a/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl +++ b/Source/Shaders/GI/GlobalSurfaceAtlas.hlsl @@ -153,7 +153,7 @@ float4 SampleGlobalSurfaceAtlasTile(const GlobalSurfaceAtlasData data, GlobalSur bilinearWeights.w = (1 - bilinearWeightsUV.x) * (1 - bilinearWeightsUV.y); // Tile depth weight based on sample position occlusion - float4 tileZ = depth.Gather(SamplerLinearClamp, atlasUV, 0.0f); + float4 tileZ = depth.Gather(SamplerLinearClamp, atlasUV); float depthThreshold = 2.0f * surfaceThreshold / tile.ViewBoundsSize.z; float4 depthVisibility = 1.0f; UNROLL diff --git a/Source/Shaders/GI/GlobalSurfaceAtlas.shader b/Source/Shaders/GI/GlobalSurfaceAtlas.shader index 9c8aa7bcc..1a6f7a3d5 100644 --- a/Source/Shaders/GI/GlobalSurfaceAtlas.shader +++ b/Source/Shaders/GI/GlobalSurfaceAtlas.shader @@ -330,7 +330,7 @@ float4 PS_Debug(Quad_VS2PS input) : SV_Target else { // Sample skybox - float3 skybox = Skybox.SampleLevel(SamplerLinearClamp, viewRay, 0); + float3 skybox = Skybox.SampleLevel(SamplerLinearClamp, viewRay, 0).rgb; float3 sky = float3(0.4f, 0.4f, 1.0f) * saturate(hit.StepsCount / 80.0f); color = lerp(sky, skybox, SkyboxIntensity); } diff --git a/Source/Shaders/GUI.shader b/Source/Shaders/GUI.shader index 16b764707..b54fb77fa 100644 --- a/Source/Shaders/GUI.shader +++ b/Source/Shaders/GUI.shader @@ -34,7 +34,7 @@ VS2PS VS(Render2DVertex input) // Render2D::RenderingFeatures::VertexSnapping if ((int)input.CustomDataAndClipOrigin.y & 1) - input.Position = (int2)input.Position; + input.Position = (float2)(int2)input.Position; output.Position = mul(float4(input.Position, 0, 1), ViewProjection); output.Color = input.Color; diff --git a/Source/Shaders/GlobalSignDistanceField.shader b/Source/Shaders/GlobalSignDistanceField.shader index cface49ac..3d4f7dd46 100644 --- a/Source/Shaders/GlobalSignDistanceField.shader +++ b/Source/Shaders/GlobalSignDistanceField.shader @@ -34,7 +34,7 @@ META_CB_BEGIN(1, ModelsRasterizeData) int3 ChunkCoord; float MaxDistance; float3 CascadeCoordToPosMul; -int ObjectsCount; +uint ObjectsCount; float3 CascadeCoordToPosAdd; int CascadeResolution; int CascadeIndex; @@ -91,7 +91,11 @@ float DistanceToModelSDF(float minDistance, ObjectRasterizeData modelData, Textu BRANCH if (minDistance <= distanceToVolume) return distanceToVolume; // Sample SDF +#if defined(PLATFORM_PS4) || defined(PLATFORM_PS5) + float volumeDistance = 0; // TODO: fix shader compilation error +#else float volumeDistance = modelSDFTex.SampleLevel(SamplerLinearClamp, volumeUV, modelData.MipOffset).x * modelData.DecodeMul + modelData.DecodeAdd; +#endif volumeDistance *= volumeScale; // Apply uniform instance scale (non-uniform is not supported) // Combine distance to the volume with distance to the surface inside the model @@ -153,7 +157,11 @@ void CS_RasterizeHeightfield(uint3 DispatchThreadId : SV_DispatchThreadID) float2 heightfieldUV = float2(volumeUV.x, volumeUV.z); // Sample the heightfield +#if defined(PLATFORM_PS4) || defined(PLATFORM_PS5) + float4 heightmapValue = 0; // TODO: fix shader compilation error +#else float4 heightmapValue = ObjectsTextures[i].SampleLevel(SamplerLinearClamp, heightfieldUV, objectData.MipOffset); +#endif bool isHole = (heightmapValue.b + heightmapValue.a) >= 1.9f; if (isHole || any(heightfieldUV < 0.0f) || any(heightfieldUV > 1.0f)) continue; @@ -198,7 +206,7 @@ Texture3D GlobalSDFTex : register(t0); float SampleSDF(uint3 voxelCoordMip, int3 offset) { // Sample SDF - voxelCoordMip = (uint3)clamp((int3)voxelCoordMip * GenerateMipCoordScale + offset, 0, GenerateMipTexResolution - 1); + voxelCoordMip = (uint3)clamp((int3)(voxelCoordMip * GenerateMipCoordScale) + offset, int3(0, 0, 0), (int3)(GenerateMipTexResolution - 1)); voxelCoordMip.x += GenerateMipTexOffsetX; float result = GlobalSDFTex[voxelCoordMip].r; diff --git a/Source/Shaders/ProbesFilter.shader b/Source/Shaders/ProbesFilter.shader index 5fc5a7241..29859076b 100644 --- a/Source/Shaders/ProbesFilter.shader +++ b/Source/Shaders/ProbesFilter.shader @@ -8,7 +8,7 @@ META_CB_BEGIN(0, Data) float2 Dummy0; int CubeFace; -int SourceMipIndex; +float SourceMipIndex; META_CB_END TextureCube Cube : register(t0); diff --git a/Source/Shaders/SSR.shader b/Source/Shaders/SSR.shader index e023e2070..999dd93a3 100644 --- a/Source/Shaders/SSR.shader +++ b/Source/Shaders/SSR.shader @@ -199,11 +199,11 @@ float4 PS_ResolvePass(Quad_VS2PS input) : SV_Target0 { float2 offsetUV = Offsets[i] * SSRtexelSize; offsetUV = mul(offsetRotationMatrix, offsetUV); - float4 sample = Texture0.SampleLevel(SamplerLinearClamp, uv + offsetUV, 0); + float4 value = Texture0.SampleLevel(SamplerLinearClamp, uv + offsetUV, 0); #if SSR_REDUCE_HIGHLIGHTS - sample.rgb /= 1 + Luminance(sample.rgb); + value.rgb /= 1 + Luminance(value.rgb); #endif - result += sample; + result += value; } // Calculate final result value diff --git a/Source/Shaders/ShadowsSampling.hlsl b/Source/Shaders/ShadowsSampling.hlsl index b51c4a8db..88f93de3d 100644 --- a/Source/Shaders/ShadowsSampling.hlsl +++ b/Source/Shaders/ShadowsSampling.hlsl @@ -145,7 +145,7 @@ float SampleShadowMapFixedSizePCF(Texture2DArray shadowMap, float2 shadowMapSize s.x += (1.0f - fc.y) * (v1[0].w * (CSMFilterWeights[row + FS_2][col + FS_2] - CSMFilterWeights[row + FS_2][col + FS_2] * fc.x) + v1[0].z * (fc.x * (CSMFilterWeights[row + FS_2][col + FS_2] - - CSMFilterWeights[row + FS_2][col + FS_2 + 1.0f]) + - CSMFilterWeights[row + FS_2][col + FS_2 + 1]) + CSMFilterWeights[row + FS_2][col + FS_2 + 1])); s.y += fc.y * (v1[0].x * (CSMFilterWeights[row + FS_2][col + FS_2] - CSMFilterWeights[row + FS_2][col + FS_2] * fc.x) diff --git a/Source/Shaders/TAA.shader b/Source/Shaders/TAA.shader index 0ef3dd402..30f4e7f35 100644 --- a/Source/Shaders/TAA.shader +++ b/Source/Shaders/TAA.shader @@ -69,7 +69,7 @@ float4 PS(Quad_VS2PS input) : SV_Target0 // Sample history by clamp it to the nearby colors range to reduce artifacts float4 history = SAMPLE_RT_LINEAR(InputHistory, prevUV); - float lumaOffset = abs(Luminance(neighborhoodAvg) - Luminance(current)); + float lumaOffset = abs(Luminance(neighborhoodAvg.rgb) - Luminance(current.rgb)); float aabbMargin = lerp(4.0, 0.25, saturate(velocityLength * 100.0)) * lumaOffset; history = ClipToAABB(history, neighborhoodMin - aabbMargin, neighborhoodMax + aabbMargin); //history = clamp(history, neighborhoodMin, neighborhoodMax);