Migrate scene document to include environmentIntensity

This commit is contained in:
2026-03-31 23:14:05 +02:00
parent 9a93e8dbcb
commit 850836f599

View File

@@ -584,7 +584,11 @@ function readWorldSettings(value: unknown): WorldSettings {
} else {
resolvedBackground = {
mode: "image",
assetId: expectString(background.assetId, "world.background.assetId")
assetId: expectString(background.assetId, "world.background.assetId"),
// Default to 0.5 for documents saved before environmentIntensity was added
environmentIntensity: typeof background.environmentIntensity === "number" && isFinite(background.environmentIntensity) && background.environmentIntensity >= 0
? background.environmentIntensity
: 0.5
};
}