Refactor DDGI fallback radiance to use alpha for blending between fixed color and color at snapped location of the last cascade
This means artists don't need to adjust the value anymore as it can cover vista geometry with GI at last cascade borders.
This commit is contained in:
@@ -191,7 +191,7 @@ bool GlobalIlluminationFeature::Bind(MaterialShader::BindParameters& params, Spa
|
||||
{
|
||||
// Unbind SRVs to prevent issues
|
||||
data.DDGI.CascadesCount = 0;
|
||||
data.DDGI.FallbackIrradiance = Float3::Zero;
|
||||
data.DDGI.FallbackIrradiance = Float4::Zero;
|
||||
params.GPUContext->UnBindSR(srv + 0);
|
||||
params.GPUContext->UnBindSR(srv + 1);
|
||||
params.GPUContext->UnBindSR(srv + 2);
|
||||
|
||||
@@ -378,7 +378,7 @@ API_STRUCT() struct FLAXENGINE_API GlobalIlluminationSettings : ISerializable
|
||||
/// The irradiance lighting outside the GI range used as a fallback to prevent pure-black scene outside the Global Illumination range.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(40), PostProcessSetting((int)GlobalIlluminationSettingsOverride.FallbackIrradiance)")
|
||||
Color FallbackIrradiance = Color::Black;
|
||||
Color FallbackIrradiance = Color::Transparent;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
|
||||
@@ -328,7 +328,6 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
||||
const float indirectLightingIntensity = settings.Intensity;
|
||||
const float probeHistoryWeight = Math::Clamp(settings.TemporalResponse, 0.0f, 0.98f);
|
||||
const float distance = settings.Distance;
|
||||
const Color fallbackIrradiance = settings.FallbackIrradiance;
|
||||
|
||||
// Automatically calculate amount of cascades to cover the GI distance at the current probes spacing
|
||||
const int32 idealProbesCount = 20; // Ideal amount of probes per-cascade to try to fit in order to cover whole distance
|
||||
@@ -518,7 +517,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
||||
ddgiData.Result.Constants.ProbeHistoryWeight = probeHistoryWeight;
|
||||
ddgiData.Result.Constants.IrradianceGamma = 1.5f;
|
||||
ddgiData.Result.Constants.IndirectLightingIntensity = indirectLightingIntensity;
|
||||
ddgiData.Result.Constants.FallbackIrradiance = fallbackIrradiance.ToFloat3() * fallbackIrradiance.A;
|
||||
ddgiData.Result.Constants.FallbackIrradiance = settings.FallbackIrradiance.ToFloat4();
|
||||
ddgiData.Result.ProbesData = ddgiData.ProbesData->View();
|
||||
ddgiData.Result.ProbesDistance = ddgiData.ProbesDistance->View();
|
||||
ddgiData.Result.ProbesIrradiance = ddgiData.ProbesIrradiance->View();
|
||||
|
||||
@@ -25,8 +25,7 @@ public:
|
||||
float IndirectLightingIntensity;
|
||||
Float3 ViewPos;
|
||||
uint32 RaysCount;
|
||||
Float3 FallbackIrradiance;
|
||||
float Padding0;
|
||||
Float4 FallbackIrradiance;
|
||||
});
|
||||
|
||||
// Binding data for the GPU.
|
||||
|
||||
Reference in New Issue
Block a user