diff --git a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli index 9e4520121..405452096 100644 --- a/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli +++ b/features/Skylighting/Shaders/Skylighting/Skylighting.hlsli @@ -9,8 +9,8 @@ Texture3D SkylightingProbeArray : register(t29); namespace Skylighting { - const static uint3 ARRAY_DIM = uint3(128, 128, 64); - const static float3 ARRAY_SIZE = float3(10000, 10000, 10000 * 0.5); + const static uint3 ARRAY_DIM = uint3(256, 256, 128); + const static float3 ARRAY_SIZE = 4096.f * 3.f * float3(1, 1, 0.5); const static float3 CELL_SIZE = ARRAY_SIZE / ARRAY_DIM; float getFadeOutFactor(float3 positionMS) diff --git a/features/Skylighting/Shaders/Skylighting/UpdateProbesCS.hlsl b/features/Skylighting/Shaders/Skylighting/UpdateProbesCS.hlsl index 4531f9fca..39d010418 100644 --- a/features/Skylighting/Shaders/Skylighting/UpdateProbesCS.hlsl +++ b/features/Skylighting/Shaders/Skylighting/UpdateProbesCS.hlsl @@ -8,20 +8,17 @@ RWTexture3D outAccumFramesArray : register(u1); SamplerState samplerPointClamp : register(s0); -#define ARRAY_DIM uint3(128, 128, 64) -#define ARRAY_SIZE float3(10000, 10000, 10000 * 0.5) - [numthreads(8, 8, 1)] void main(uint3 dtid : SV_DispatchThreadID) { const float fadeInThreshold = 255; const static sh2 unitSH = float4(sqrt(4.0 * Math::PI), 0, 0, 0); const SkylightingSettings settings = skylightingSettings; - uint3 cellID = (int3(dtid) - settings.ArrayOrigin.xyz) % ARRAY_DIM; - bool isValid = all(cellID >= max(0, settings.ValidMargin.xyz)) && all(cellID <= ARRAY_DIM - 1 + min(0, settings.ValidMargin.xyz)); // check if the cell is newly added + uint3 cellID = (int3(dtid) - settings.ArrayOrigin.xyz) % Skylighting::ARRAY_DIM; + bool isValid = all(cellID >= max(0, settings.ValidMargin.xyz)) && all(cellID <= Skylighting::ARRAY_DIM - 1 + min(0, settings.ValidMargin.xyz)); // check if the cell is newly added - float3 cellCentreMS = cellID + 0.5 - ARRAY_DIM / 2; - cellCentreMS = cellCentreMS / ARRAY_DIM * ARRAY_SIZE + settings.PosOffset.xyz; + float3 cellCentreMS = cellID + 0.5 - Skylighting::ARRAY_DIM / 2; + cellCentreMS = cellCentreMS / Skylighting::ARRAY_DIM * Skylighting::ARRAY_SIZE + settings.PosOffset.xyz; float3 cellCentreOS = mul(settings.OcclusionViewProj, float4(cellCentreMS, 1)).xyz; cellCentreOS.y = -cellCentreOS.y; diff --git a/src/Features/Skylighting.h b/src/Features/Skylighting.h index 3830dd1b9..64d257b4e 100644 --- a/src/Features/Skylighting.h +++ b/src/Features/Skylighting.h @@ -78,8 +78,8 @@ struct Skylighting : Feature // misc parameters bool doOcclusion = true; - uint probeArrayDims[3] = { 128, 128, 64 }; - float occlusionDistance = 10000.f; + uint probeArrayDims[3] = { 256, 256, 128 }; + float occlusionDistance = 4096.f * 3.f; // 3 cells // cached variables bool inOcclusion = false;