Add validation for foliage wind settings in world document validation
This commit is contained in:
@@ -136,6 +136,10 @@ import {
|
|||||||
MAX_FOLIAGE_QUALITY_DENSITY_MULTIPLIER,
|
MAX_FOLIAGE_QUALITY_DENSITY_MULTIPLIER,
|
||||||
MIN_FOLIAGE_QUALITY_MAX_DISTANCE_MULTIPLIER,
|
MIN_FOLIAGE_QUALITY_MAX_DISTANCE_MULTIPLIER,
|
||||||
MAX_FOLIAGE_QUALITY_MAX_DISTANCE_MULTIPLIER,
|
MAX_FOLIAGE_QUALITY_MAX_DISTANCE_MULTIPLIER,
|
||||||
|
MIN_FOLIAGE_QUALITY_WIND_SPEED,
|
||||||
|
MAX_FOLIAGE_QUALITY_WIND_SPEED,
|
||||||
|
MIN_FOLIAGE_QUALITY_WIND_STRENGTH,
|
||||||
|
MAX_FOLIAGE_QUALITY_WIND_STRENGTH,
|
||||||
MAX_ADVANCED_RENDERING_LENS_FLARE_GHOST_COUNT,
|
MAX_ADVANCED_RENDERING_LENS_FLARE_GHOST_COUNT,
|
||||||
isHexColorString,
|
isHexColorString,
|
||||||
isWorldShaderSkyPresetId,
|
isWorldShaderSkyPresetId,
|
||||||
@@ -1541,6 +1545,68 @@ function validateWorldSettings(
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isBoolean(advancedRendering.foliage.windEnabled)) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-foliage-quality-wind-enabled",
|
||||||
|
"Foliage wind enabled must be a boolean.",
|
||||||
|
"world.advancedRendering.foliage.windEnabled"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!isFiniteNumberInRange(
|
||||||
|
advancedRendering.foliage.windStrength,
|
||||||
|
MIN_FOLIAGE_QUALITY_WIND_STRENGTH,
|
||||||
|
MAX_FOLIAGE_QUALITY_WIND_STRENGTH
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-foliage-quality-wind-strength",
|
||||||
|
`Foliage wind strength must be a finite number between ${MIN_FOLIAGE_QUALITY_WIND_STRENGTH} and ${MAX_FOLIAGE_QUALITY_WIND_STRENGTH}.`,
|
||||||
|
"world.advancedRendering.foliage.windStrength"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!isFiniteNumberInRange(
|
||||||
|
advancedRendering.foliage.windSpeed,
|
||||||
|
MIN_FOLIAGE_QUALITY_WIND_SPEED,
|
||||||
|
MAX_FOLIAGE_QUALITY_WIND_SPEED
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-foliage-quality-wind-speed",
|
||||||
|
`Foliage wind speed must be a finite number between ${MIN_FOLIAGE_QUALITY_WIND_SPEED} and ${MAX_FOLIAGE_QUALITY_WIND_SPEED}.`,
|
||||||
|
"world.advancedRendering.foliage.windSpeed"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (
|
||||||
|
!isFiniteNumberInRange(
|
||||||
|
advancedRendering.foliage.windDirectionDegrees,
|
||||||
|
0,
|
||||||
|
360
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
diagnostics.push(
|
||||||
|
createDiagnostic(
|
||||||
|
"error",
|
||||||
|
"invalid-foliage-quality-wind-direction",
|
||||||
|
"Foliage wind direction must be a finite number between 0 and 360 degrees.",
|
||||||
|
"world.advancedRendering.foliage.windDirectionDegrees"
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
if (!isBoxVolumeRenderPath(advancedRendering.fogPath)) {
|
if (!isBoxVolumeRenderPath(advancedRendering.fogPath)) {
|
||||||
diagnostics.push(
|
diagnostics.push(
|
||||||
createDiagnostic(
|
createDiagnostic(
|
||||||
|
|||||||
Reference in New Issue
Block a user