Add minor improvements and adjust 3rd DDGI cascade for better world coverage
This commit is contained in:
@@ -127,7 +127,7 @@ public:
|
||||
/// <summary>
|
||||
/// The Global Illumination probes spacing distance (in world units). Defines the quality of the GI resolution. Adjust to 200-500 to improve performance and lower frequency GI data.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(2120), Limit(50, 1000), EditorDisplay(\"Global Illumination\")")
|
||||
API_FIELD(Attributes="EditorOrder(2120), Limit(50, 1000), EditorDisplay(\"Global Illumination\"), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float GIProbesSpacing = 100;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -382,7 +382,7 @@ API_STRUCT() struct FLAXENGINE_API GlobalIlluminationSettings : ISerializable
|
||||
/// <summary>
|
||||
/// Draw distance of the Global Illumination effect. Scene outside the range will use fallback irradiance.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(30), Limit(1000), PostProcessSetting((int)GlobalIlluminationSettingsOverride.Distance)")
|
||||
API_FIELD(Attributes="EditorOrder(30), Limit(1000), PostProcessSetting((int)GlobalIlluminationSettingsOverride.Distance), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float Distance = 20000.0f;
|
||||
|
||||
/// <summary>
|
||||
@@ -1819,17 +1819,17 @@ API_STRUCT() struct FLAXENGINE_API ScreenSpaceReflectionsSettings : ISerializabl
|
||||
/// <summary>
|
||||
/// The effect fade out end distance from camera (in world units).
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="Limit(0), EditorOrder(31), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.FadeOutDistance)")
|
||||
API_FIELD(Attributes="Limit(0), EditorOrder(31), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.FadeOutDistance), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float FadeOutDistance = 5000.0f;
|
||||
|
||||
/// <summary>
|
||||
/// The effect fade distance (in world units). Defines the size of the effect fade from fully visible to fully invisible at FadeOutDistance.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="Limit(0), EditorOrder(32), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.FadeDistance)")
|
||||
API_FIELD(Attributes="Limit(0), EditorOrder(32), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.FadeDistance), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float FadeDistance = 500.0f;
|
||||
|
||||
/// <summary>
|
||||
/// "The input color buffer downscale mode that uses blurred mipmaps when resolving the reflection color. Produces more realistic results by blurring distant parts of reflections in rough (low-gloss) materials. It also improves performance on most platforms but uses more memory.
|
||||
/// The input color buffer downscale mode that uses blurred mipmaps when resolving the reflection color. Produces more realistic results by blurring distant parts of reflections in rough (low-gloss) materials. It also improves performance on most platforms but uses more memory.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(40), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.UseColorBufferMips), EditorDisplay(null, \"Use Color Buffer Mips\")")
|
||||
bool UseColorBufferMips = true;
|
||||
|
||||
@@ -31,7 +31,7 @@ public:
|
||||
/// <summary>
|
||||
/// Controls light visibility range. The distance at which the light becomes completely faded (blend happens on the last 10% of that range). Use a value of 0 to always draw light.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(35), Limit(0, float.MaxValue, 10.0f), EditorDisplay(\"Light\")")
|
||||
API_FIELD(Attributes="EditorOrder(35), Limit(0, float.MaxValue, 10.0f), EditorDisplay(\"Light\"), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float ViewDistance = 0.0f;
|
||||
|
||||
/// <summary>
|
||||
@@ -126,13 +126,13 @@ public:
|
||||
/// <summary>
|
||||
/// Shadows casting distance from view.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(80), EditorDisplay(\"Shadow\", \"Distance\"), Limit(0, 1000000)")
|
||||
API_FIELD(Attributes="EditorOrder(80), EditorDisplay(\"Shadow\", \"Distance\"), Limit(0, 1000000), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float ShadowsDistance = 5000.0f;
|
||||
|
||||
/// <summary>
|
||||
/// Shadows fade off distance.
|
||||
/// </summary>
|
||||
API_FIELD(Attributes="EditorOrder(90), EditorDisplay(\"Shadow\", \"Fade Distance\"), Limit(0.0f, 10000.0f, 0.1f)")
|
||||
API_FIELD(Attributes="EditorOrder(90), EditorDisplay(\"Shadow\", \"Fade Distance\"), Limit(0.0f, 10000.0f, 0.1f), ValueCategory(Utils.ValueCategory.Distance)")
|
||||
float ShadowsFadeDistance = 500.0f;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -343,7 +343,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
||||
}
|
||||
|
||||
// Calculate the probes count based on the amount of cascades and the distance to cover
|
||||
const float cascadesDistanceScales[] = { 1.0f, 3.0f, 5.0f, 10.0f }; // Scales each cascade further away from the camera origin
|
||||
const float cascadesDistanceScales[] = { 1.0f, 3.0f, 6.0f, 10.0f }; // Scales each cascade further away from the camera origin
|
||||
const float distanceExtent = distance / cascadesDistanceScales[cascadesCount - 1];
|
||||
const float verticalRangeScale = 0.8f; // Scales the probes volume size at Y axis (horizontal aspect ratio makes the DDGI use less probes vertically to cover whole screen)
|
||||
Int3 probesCounts(Float3::Ceil(Float3(distanceExtent, distanceExtent * verticalRangeScale, distanceExtent) / probesSpacing));
|
||||
@@ -601,7 +601,7 @@ bool DynamicDiffuseGlobalIlluminationPass::RenderInner(RenderContext& renderCont
|
||||
// For inactive probes, search nearby ones to find the closest valid for quick fallback when sampling irradiance
|
||||
{
|
||||
PROFILE_GPU_CPU_NAMED("Update Inactive Probes");
|
||||
// TODO: this could run within GPUComputePass during Trace Rays or Update Probes to overlap compute works
|
||||
// TODO: this could run within GPUComputePass during Trace Rays or Update Probes to overlap compute works (just move StepSize to other Cb to avoid data overlaps)
|
||||
context->BindUA(0, ddgiData.Result.ProbesData);
|
||||
Data1 data;
|
||||
data.CascadeIndex = cascadeIndex;
|
||||
|
||||
Reference in New Issue
Block a user