Implement Dynamic Global Illumination support and versioning in scene documents
This commit is contained in:
@@ -300,6 +300,7 @@ import {
|
||||
createDefaultWorldTimePhaseProfile,
|
||||
createDefaultWorldShaderSkySettings,
|
||||
DEFAULT_NIGHT_IMAGE_ENVIRONMENT_INTENSITY,
|
||||
isAdvancedRenderingDynamicGlobalIlluminationQuality,
|
||||
isAdvancedRenderingWaterReflectionMode,
|
||||
createDefaultAdvancedRenderingSettings,
|
||||
isBoxVolumeRenderPath,
|
||||
@@ -764,6 +765,15 @@ function readAdvancedRenderingSettings(
|
||||
throw new Error("world.advancedRendering.bloom must be an object.");
|
||||
}
|
||||
|
||||
if (
|
||||
value.dynamicGlobalIllumination !== undefined &&
|
||||
!isRecord(value.dynamicGlobalIllumination)
|
||||
) {
|
||||
throw new Error(
|
||||
"world.advancedRendering.dynamicGlobalIllumination must be an object."
|
||||
);
|
||||
}
|
||||
|
||||
if (value.toneMapping !== undefined && !isRecord(value.toneMapping)) {
|
||||
throw new Error("world.advancedRendering.toneMapping must be an object.");
|
||||
}
|
||||
@@ -780,6 +790,9 @@ function readAdvancedRenderingSettings(
|
||||
const ambientOcclusion = value.ambientOcclusion as
|
||||
| Record<string, unknown>
|
||||
| undefined;
|
||||
const dynamicGlobalIllumination = value.dynamicGlobalIllumination as
|
||||
| Record<string, unknown>
|
||||
| undefined;
|
||||
const bloom = value.bloom as Record<string, unknown> | undefined;
|
||||
const toneMapping = value.toneMapping as Record<string, unknown> | undefined;
|
||||
const depthOfField = value.depthOfField as
|
||||
@@ -807,6 +820,12 @@ function readAdvancedRenderingSettings(
|
||||
defaults.toneMapping.mode,
|
||||
isAdvancedRenderingToneMappingMode
|
||||
);
|
||||
const dynamicGlobalIlluminationQuality = readOptionalAllowedValue(
|
||||
dynamicGlobalIllumination?.quality,
|
||||
"world.advancedRendering.dynamicGlobalIllumination.quality",
|
||||
defaults.dynamicGlobalIllumination.quality,
|
||||
isAdvancedRenderingDynamicGlobalIlluminationQuality
|
||||
);
|
||||
const fogPath = readOptionalAllowedValue(
|
||||
value.fogPath,
|
||||
"world.advancedRendering.fogPath",
|
||||
@@ -868,6 +887,24 @@ function readAdvancedRenderingSettings(
|
||||
defaults.ambientOcclusion.samples
|
||||
)
|
||||
},
|
||||
dynamicGlobalIllumination: {
|
||||
enabled: readOptionalBoolean(
|
||||
dynamicGlobalIllumination?.enabled,
|
||||
"world.advancedRendering.dynamicGlobalIllumination.enabled",
|
||||
defaults.dynamicGlobalIllumination.enabled
|
||||
),
|
||||
intensity: readOptionalNonNegativeFiniteNumber(
|
||||
dynamicGlobalIllumination?.intensity,
|
||||
"world.advancedRendering.dynamicGlobalIllumination.intensity",
|
||||
defaults.dynamicGlobalIllumination.intensity
|
||||
),
|
||||
radius: readOptionalNonNegativeFiniteNumber(
|
||||
dynamicGlobalIllumination?.radius,
|
||||
"world.advancedRendering.dynamicGlobalIllumination.radius",
|
||||
defaults.dynamicGlobalIllumination.radius
|
||||
),
|
||||
quality: dynamicGlobalIlluminationQuality
|
||||
},
|
||||
bloom: {
|
||||
enabled: readOptionalBoolean(
|
||||
bloom?.enabled,
|
||||
|
||||
@@ -29,7 +29,8 @@ import {
|
||||
} from "../sequencer/project-sequences";
|
||||
import type { Terrain } from "./terrains";
|
||||
|
||||
export const SCENE_DOCUMENT_VERSION = 84 as const;
|
||||
export const SCENE_DOCUMENT_VERSION = 85 as const;
|
||||
export const DYNAMIC_GLOBAL_ILLUMINATION_SCENE_DOCUMENT_VERSION = 85 as const;
|
||||
export const PLAYER_START_MOUSE_INVERT_SCENE_DOCUMENT_VERSION = 84 as const;
|
||||
export const PLAYER_START_TARGETING_SETTINGS_SCENE_DOCUMENT_VERSION =
|
||||
83 as const;
|
||||
|
||||
Reference in New Issue
Block a user