feat(web): add scene color management authoring
This commit is contained in:
@@ -713,6 +713,15 @@ function assertFutureCapability(payload: Extract<WebEngineRequest["command"], {
|
||||
for (const field of ["particlesViewport", "particlesRender", "volumes"] as const) if (properties[field] !== undefined && !boundedNumber(properties[field], 0, 1000)) throw report("RENDER_PROPERTY_INVALID", `Scene ${field} is outside the simplify range`);
|
||||
return;
|
||||
}
|
||||
case "setSceneColorManagement": {
|
||||
const scene = currentSnapshot?.scenes.find((candidate) => candidate.id === payload.dataId);
|
||||
const properties = payload.properties;
|
||||
if (!scene || !validPropertyKeys(properties, ["displayDevice", "temperature", "tint"])) throw report("RENDER_PROPERTY_INVALID", "Scene color management target or properties are invalid");
|
||||
if (properties.displayDevice !== undefined && (typeof properties.displayDevice !== "string" || properties.displayDevice.length === 0 || new TextEncoder().encode(properties.displayDevice).byteLength > 63)) throw report("RENDER_PROPERTY_INVALID", "Scene displayDevice is not a bounded string");
|
||||
if (properties.temperature !== undefined && !boundedNumber(properties.temperature, 1000, 20000)) throw report("RENDER_PROPERTY_INVALID", "Scene temperature is outside the color-management range");
|
||||
if (properties.tint !== undefined && !boundedNumber(properties.tint, -100, 100)) throw report("RENDER_PROPERTY_INVALID", "Scene tint is outside the color-management range");
|
||||
return;
|
||||
}
|
||||
case "setGeometryNodeGraph": {
|
||||
const snapshot = currentSnapshot;
|
||||
const availableResourceIds = new Set([
|
||||
|
||||
Reference in New Issue
Block a user