Add IndirectShadowsStrength to GI settings for artist-controlled light leaking
This commit is contained in:
@@ -33,6 +33,7 @@ void GlobalIlluminationSettings::BlendWith(GlobalIlluminationSettings& other, fl
|
||||
BLEND_FLOAT(BounceIntensity);
|
||||
BLEND_FLOAT(TemporalResponse);
|
||||
BLEND_FLOAT(Distance);
|
||||
BLEND_FLOAT(IndirectShadowsStrength);
|
||||
BLEND_COL(FallbackIrradiance);
|
||||
}
|
||||
|
||||
|
||||
@@ -334,10 +334,15 @@ API_ENUM(Attributes="Flags") enum class GlobalIlluminationSettingsOverride : int
|
||||
/// </summary>
|
||||
BounceIntensity = 1 << 5,
|
||||
|
||||
/// <summary>
|
||||
/// Overrides <see cref="GlobalIlluminationSettings.IndirectShadowsStrength"/> property.
|
||||
/// </summary>
|
||||
IndirectShadowsStrength = 1 << 6,
|
||||
|
||||
/// <summary>
|
||||
/// All properties.
|
||||
/// </summary>
|
||||
All = Mode | Intensity | TemporalResponse | Distance | FallbackIrradiance | BounceIntensity,
|
||||
All = Mode | Intensity | TemporalResponse | Distance | FallbackIrradiance | BounceIntensity | IndirectShadowsStrength,
|
||||
};
|
||||
|
||||
/// <summary>
|
||||
@@ -385,6 +390,12 @@ API_STRUCT() struct FLAXENGINE_API GlobalIlluminationSettings : ISerializable
|
||||
API_FIELD(Attributes="EditorOrder(30), Limit(1000), PostProcessSetting((int)GlobalIlluminationSettingsOverride.Distance), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float Distance = 20000.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Indirect lighting shadows intensity. Default is 1 for fully opaque shadowing, lower values bleed the lighting into shadowed areas. Can be sued for artistic control over GI.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes = "EditorOrder(35), Limit(0.0f, 1.0f, 0.001f), PostProcessSetting((int)GlobalIlluminationSettingsOverride.IndirectShadowsStrength)")
|
||||
float IndirectShadowsStrength = 1.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The irradiance lighting outside the GI range used as a fallback to prevent pure-black scene outside the Global Illumination range.
|
||||
/// </summary>
|
||||
|
||||
@@ -546,6 +546,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
||||
ddgiData.Result.Constants.RaysCount = probeRaysCount;
|
||||
ddgiData.Result.Constants.ProbeHistoryWeight = probeHistoryWeight;
|
||||
ddgiData.Result.Constants.IndirectLightingIntensity = indirectLightingIntensity;
|
||||
ddgiData.Result.Constants.IndirectShadowsStrength = settings.IndirectShadowsStrength;
|
||||
ddgiData.Result.Constants.FallbackIrradiance = settings.FallbackIrradiance.ToFloat4();
|
||||
ddgiData.Result.ProbesData = ddgiData.ProbesData->View();
|
||||
ddgiData.Result.ProbesDistance = ddgiData.ProbesDistance->View();
|
||||
|
||||
@@ -19,10 +19,10 @@ public:
|
||||
Int4 ProbesScrollOffsets[4]; // w is unused
|
||||
uint32 ProbesCounts[3];
|
||||
uint32 CascadesCount;
|
||||
float Padding;
|
||||
float ProbeHistoryWeight;
|
||||
float RayMaxDistance;
|
||||
float IndirectLightingIntensity;
|
||||
float IndirectShadowsStrength;
|
||||
Float3 ViewPos;
|
||||
uint32 RaysCount;
|
||||
Float4 FallbackIrradiance;
|
||||
|
||||
Reference in New Issue
Block a user