Reduce DDGI probes distance limit to improve performance
This commit is contained in:
@@ -46,7 +46,8 @@ PACK_STRUCT(struct Data0
|
|||||||
GlobalSignDistanceFieldPass::ConstantsData GlobalSDF;
|
GlobalSignDistanceFieldPass::ConstantsData GlobalSDF;
|
||||||
GlobalSurfaceAtlasPass::ConstantsData GlobalSurfaceAtlas;
|
GlobalSurfaceAtlasPass::ConstantsData GlobalSurfaceAtlas;
|
||||||
GBufferData GBuffer;
|
GBufferData GBuffer;
|
||||||
Float2 Padding0;
|
float Padding0;
|
||||||
|
float ProbesDistanceLimit;
|
||||||
float ResetBlend;
|
float ResetBlend;
|
||||||
float TemporalTime;
|
float TemporalTime;
|
||||||
Int4 ProbeScrollClears[4];
|
Int4 ProbeScrollClears[4];
|
||||||
@@ -471,6 +472,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
|||||||
data.DDGI = ddgiData.Result.Constants;
|
data.DDGI = ddgiData.Result.Constants;
|
||||||
data.GlobalSDF = bindingDataSDF.Constants;
|
data.GlobalSDF = bindingDataSDF.Constants;
|
||||||
data.GlobalSurfaceAtlas = bindingDataSurfaceAtlas.Constants;
|
data.GlobalSurfaceAtlas = bindingDataSurfaceAtlas.Constants;
|
||||||
|
data.ProbesDistanceLimit = 1.05f; // TODO: expose to be configurable?
|
||||||
data.ResetBlend = clear ? 1.0f : 0.0f;
|
data.ResetBlend = clear ? 1.0f : 0.0f;
|
||||||
for (int32 cascadeIndex = 0; cascadeIndex < cascadesCount; cascadeIndex++)
|
for (int32 cascadeIndex = 0; cascadeIndex < cascadesCount; cascadeIndex++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -27,7 +27,8 @@ DDGIData DDGI;
|
|||||||
GlobalSDFData GlobalSDF;
|
GlobalSDFData GlobalSDF;
|
||||||
GlobalSurfaceAtlasData GlobalSurfaceAtlas;
|
GlobalSurfaceAtlasData GlobalSurfaceAtlas;
|
||||||
GBufferData GBuffer;
|
GBufferData GBuffer;
|
||||||
float2 Padding0;
|
float Padding0;
|
||||||
|
float ProbesDistanceLimit;
|
||||||
float ResetBlend;
|
float ResetBlend;
|
||||||
float TemporalTime;
|
float TemporalTime;
|
||||||
int4 ProbeScrollClears[4];
|
int4 ProbeScrollClears[4];
|
||||||
@@ -111,7 +112,7 @@ void CS_Classify(uint3 DispatchThreadId : SV_DispatchThreadID)
|
|||||||
#endif
|
#endif
|
||||||
float sdfDst = abs(sdf);
|
float sdfDst = abs(sdf);
|
||||||
float threshold = GlobalSDF.CascadeVoxelSize[CascadeIndex];
|
float threshold = GlobalSDF.CascadeVoxelSize[CascadeIndex];
|
||||||
float distanceLimit = length(probesSpacing) * 1.5f;
|
float distanceLimit = length(probesSpacing) * ProbesDistanceLimit;
|
||||||
float relocateLimit = length(probesSpacing) * 0.6f;
|
float relocateLimit = length(probesSpacing) * 0.6f;
|
||||||
if (sdfDst > distanceLimit) // Probe is too far from geometry
|
if (sdfDst > distanceLimit) // Probe is too far from geometry
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user