feat(web): wire Blender world probe controls
Some checks failed
M6 deployable RC / quick (push) Has been cancelled
M6 deployable RC / chromium (push) Has been cancelled
M6 deployable RC / release (push) Has been cancelled

This commit is contained in:
mes123456
2026-08-30 20:32:02 +08:00
parent b15ac3770a
commit 6692739cfe
38 changed files with 1976 additions and 20 deletions

View File

@@ -288,6 +288,9 @@ export interface WorldIR {
sunShadowMaximumResolution?: number;
sunShadowJitterOverblur?: number;
sunShadowFilterRadius?: number;
probeResolution?: number;
useSunShadow?: boolean;
useSunShadowJitter?: boolean;
backgroundVisible?: boolean;
lightgroup?: string | null;
mist?: {
@@ -1578,7 +1581,8 @@ export function parseSceneSnapshotIR(value: unknown): SceneSnapshotIR {
if (world.environmentImageId !== undefined && world.environmentImageId !== null) requireString(world.environmentImageId, `worlds[${index}].environmentImageId`);
if (world.environmentStrength !== undefined) requireNumber(world.environmentStrength, `worlds[${index}].environmentStrength`);
if (world.environmentRotation !== undefined) requireNumber(world.environmentRotation, `worlds[${index}].environmentRotation`);
for (const field of ["ambientOcclusionDistance", "ambientOcclusionEnergy", "sunThreshold", "sunAngle", "sunShadowMaximumResolution", "sunShadowJitterOverblur", "sunShadowFilterRadius"] as const) if (world[field] !== undefined) requireNumber(world[field], `worlds[${index}].${field}`);
for (const field of ["ambientOcclusionDistance", "ambientOcclusionEnergy", "sunThreshold", "sunAngle", "sunShadowMaximumResolution", "sunShadowJitterOverblur", "sunShadowFilterRadius", "probeResolution"] as const) if (world[field] !== undefined) requireNumber(world[field], `worlds[${index}].${field}`);
for (const field of ["useSunShadow", "useSunShadowJitter"] as const) if (world[field] !== undefined) requireBoolean(world[field], `worlds[${index}].${field}`);
if (world.backgroundVisible !== undefined && typeof world.backgroundVisible !== "boolean") throw new Error(`SceneIR.worlds[${index}].backgroundVisible must be a boolean`);
if (world.mist !== undefined) {
if (!isRecord(world.mist) || !["QUADRATIC", "LINEAR", "INVERSE_QUADRATIC"].includes(world.mist.type as string)) throw new Error(`SceneIR.worlds[${index}].mist is invalid`);