Reduce DDGI probes distance limit to improve performance

This commit is contained in:
2022-08-12 09:53:57 +02:00
parent d8c224112b
commit 9b816a321c
2 changed files with 6 additions and 3 deletions
@@ -46,7 +46,8 @@ PACK_STRUCT(struct Data0
GlobalSignDistanceFieldPass::ConstantsData GlobalSDF;
GlobalSurfaceAtlasPass::ConstantsData GlobalSurfaceAtlas;
GBufferData GBuffer;
Float2 Padding0;
float Padding0;
float ProbesDistanceLimit;
float ResetBlend;
float TemporalTime;
Int4 ProbeScrollClears[4];
@@ -471,6 +472,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
data.DDGI = ddgiData.Result.Constants;
data.GlobalSDF = bindingDataSDF.Constants;
data.GlobalSurfaceAtlas = bindingDataSurfaceAtlas.Constants;
data.ProbesDistanceLimit = 1.05f; // TODO: expose to be configurable?
data.ResetBlend = clear ? 1.0f : 0.0f;
for (int32 cascadeIndex = 0; cascadeIndex < cascadesCount; cascadeIndex++)
{
+3 -2
View File
@@ -27,7 +27,8 @@ DDGIData DDGI;
GlobalSDFData GlobalSDF;
GlobalSurfaceAtlasData GlobalSurfaceAtlas;
GBufferData GBuffer;
float2 Padding0;
float Padding0;
float ProbesDistanceLimit;
float ResetBlend;
float TemporalTime;
int4 ProbeScrollClears[4];
@@ -111,7 +112,7 @@ void CS_Classify(uint3 DispatchThreadId : SV_DispatchThreadID)
#endif
float sdfDst = abs(sdf);
float threshold = GlobalSDF.CascadeVoxelSize[CascadeIndex];
float distanceLimit = length(probesSpacing) * 1.5f;
float distanceLimit = length(probesSpacing) * ProbesDistanceLimit;
float relocateLimit = length(probesSpacing) * 0.6f;
if (sdfDst > distanceLimit) // Probe is too far from geometry
{