feat(web): wire Blender world lighting 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:10:15 +08:00
parent e9e1788b14
commit b15ac3770a
40 changed files with 1985 additions and 22 deletions

View File

@@ -281,6 +281,13 @@ export interface WorldIR {
environmentImageId?: string | null;
environmentStrength?: number;
environmentRotation?: number;
ambientOcclusionDistance?: number;
ambientOcclusionEnergy?: number;
sunThreshold?: number;
sunAngle?: number;
sunShadowMaximumResolution?: number;
sunShadowJitterOverblur?: number;
sunShadowFilterRadius?: number;
backgroundVisible?: boolean;
lightgroup?: string | null;
mist?: {
@@ -1571,6 +1578,7 @@ 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}`);
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`);