Add minor improvements and adjust 3rd DDGI cascade for better world coverage
This commit is contained in:
@@ -127,7 +127,7 @@ public:
|
|||||||
/// <summary>
|
/// <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.
|
/// 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>
|
/// </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;
|
float GIProbesSpacing = 100;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ API_STRUCT() struct FLAXENGINE_API GlobalIlluminationSettings : ISerializable
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Draw distance of the Global Illumination effect. Scene outside the range will use fallback irradiance.
|
/// Draw distance of the Global Illumination effect. Scene outside the range will use fallback irradiance.
|
||||||
/// </summary>
|
/// </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;
|
float Distance = 20000.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -1819,17 +1819,17 @@ API_STRUCT() struct FLAXENGINE_API ScreenSpaceReflectionsSettings : ISerializabl
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The effect fade out end distance from camera (in world units).
|
/// The effect fade out end distance from camera (in world units).
|
||||||
/// </summary>
|
/// </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;
|
float FadeOutDistance = 5000.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The effect fade distance (in world units). Defines the size of the effect fade from fully visible to fully invisible at FadeOutDistance.
|
/// The effect fade distance (in world units). Defines the size of the effect fade from fully visible to fully invisible at FadeOutDistance.
|
||||||
/// </summary>
|
/// </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;
|
float FadeDistance = 500.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <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>
|
/// </summary>
|
||||||
API_FIELD(Attributes="EditorOrder(40), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.UseColorBufferMips), EditorDisplay(null, \"Use Color Buffer Mips\")")
|
API_FIELD(Attributes="EditorOrder(40), PostProcessSetting((int)ScreenSpaceReflectionsSettingsOverride.UseColorBufferMips), EditorDisplay(null, \"Use Color Buffer Mips\")")
|
||||||
bool UseColorBufferMips = true;
|
bool UseColorBufferMips = true;
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ public:
|
|||||||
/// <summary>
|
/// <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.
|
/// 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>
|
/// </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;
|
float ViewDistance = 0.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -126,13 +126,13 @@ public:
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shadows casting distance from view.
|
/// Shadows casting distance from view.
|
||||||
/// </summary>
|
/// </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;
|
float ShadowsDistance = 5000.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Shadows fade off distance.
|
/// Shadows fade off distance.
|
||||||
/// </summary>
|
/// </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;
|
float ShadowsFadeDistance = 500.0f;
|
||||||
|
|
||||||
/// <summary>
|
/// <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
|
// 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 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)
|
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));
|
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
|
// For inactive probes, search nearby ones to find the closest valid for quick fallback when sampling irradiance
|
||||||
{
|
{
|
||||||
PROFILE_GPU_CPU_NAMED("Update Inactive Probes");
|
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);
|
context->BindUA(0, ddgiData.Result.ProbesData);
|
||||||
Data1 data;
|
Data1 data;
|
||||||
data.CascadeIndex = cascadeIndex;
|
data.CascadeIndex = cascadeIndex;
|
||||||
|
|||||||
Reference in New Issue
Block a user