oda-engine 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +151 -2
- package/bin/nowhere.mjs +352 -0
- package/lib/account.mjs +57 -0
- package/lib/agentModules.mjs +57 -0
- package/lib/devServer.mjs +351 -0
- package/lib/headless.mjs +231 -0
- package/lib/headlessPreview.mjs +212 -0
- package/lib/keys.mjs +517 -0
- package/lib/make.mjs +855 -0
- package/lib/mcp.mjs +537 -0
- package/lib/open.mjs +22 -0
- package/lib/preview.mjs +87 -0
- package/lib/previewRpc.mjs +134 -0
- package/lib/project.mjs +359 -0
- package/lib/publishFlow.mjs +90 -0
- package/lib/resources.mjs +50 -0
- package/lib/rules.mjs +60 -0
- package/lib/scaffold.mjs +42 -0
- package/lib/setup.mjs +59 -0
- package/lib/tools.mjs +668 -0
- package/package.json +51 -4
- package/template/game.config.json +9 -0
- package/template/scene.json +4 -0
- package/template/src/main.ts +11 -0
- package/vendor/DOCS.md +447 -0
- package/vendor/agent/appRun.mjs +520 -0
- package/vendor/agent/assets/brief.mjs +242 -0
- package/vendor/agent/assets/collider.mjs +531 -0
- package/vendor/agent/assets/environments/index.mjs +12 -0
- package/vendor/agent/assets/environments/worldlabs.mjs +161 -0
- package/vendor/agent/assets/fetch.mjs +168 -0
- package/vendor/agent/assets/footprint.mjs +13 -0
- package/vendor/agent/assets/gltf.mjs +547 -0
- package/vendor/agent/assets/hdr.mjs +269 -0
- package/vendor/agent/assets/imageOps.mjs +171 -0
- package/vendor/agent/assets/images/codex.mjs +307 -0
- package/vendor/agent/assets/images/fal.mjs +75 -0
- package/vendor/agent/assets/images/gemini.mjs +84 -0
- package/vendor/agent/assets/images/index.mjs +25 -0
- package/vendor/agent/assets/images/openai.mjs +75 -0
- package/vendor/agent/assets/images/stability.mjs +71 -0
- package/vendor/agent/assets/images/views.mjs +31 -0
- package/vendor/agent/assets/import.mjs +1352 -0
- package/vendor/agent/assets/inspect.mjs +465 -0
- package/vendor/agent/assets/jobs.mjs +196 -0
- package/vendor/agent/assets/ktx2.mjs +290 -0
- package/vendor/agent/assets/ledger.mjs +466 -0
- package/vendor/agent/assets/net.mjs +254 -0
- package/vendor/agent/assets/prices.json +39 -0
- package/vendor/agent/assets/providers/fal.mjs +115 -0
- package/vendor/agent/assets/providers/index.mjs +22 -0
- package/vendor/agent/assets/providers/meshy.mjs +119 -0
- package/vendor/agent/assets/providers/tripo.mjs +188 -0
- package/vendor/agent/assets/sources/ambientcg.mjs +129 -0
- package/vendor/agent/assets/sources/index.mjs +23 -0
- package/vendor/agent/assets/sources/polyhaven.mjs +237 -0
- package/vendor/agent/assets/sources/polypizza.mjs +121 -0
- package/vendor/agent/assets/splat.mjs +631 -0
- package/vendor/agent/assets/targets.mjs +122 -0
- package/vendor/agent/assets/tile.mjs +261 -0
- package/vendor/agent/assets/unzip.mjs +180 -0
- package/vendor/agent/blender/cleanup.py +360 -0
- package/vendor/agent/blender/convert.py +167 -0
- package/vendor/agent/blender/find.mjs +192 -0
- package/vendor/agent/blender/nw_export.py +104 -0
- package/vendor/agent/blender/nw_rubric.py +426 -0
- package/vendor/agent/blender/run.mjs +193 -0
- package/vendor/agent/blender/runner.py +252 -0
- package/vendor/agent/blender/sheet.py +743 -0
- package/vendor/agent/depth.mjs +134 -0
- package/vendor/agent/director/board.mjs +451 -0
- package/vendor/agent/director/contracts.mjs +663 -0
- package/vendor/agent/director/director.mjs +2365 -0
- package/vendor/agent/director/estimate.mjs +200 -0
- package/vendor/agent/director/gate.mjs +802 -0
- package/vendor/agent/director/limits.json +16 -0
- package/vendor/agent/director/methods.mjs +457 -0
- package/vendor/agent/director/policy.json +33 -0
- package/vendor/agent/director/prompts.mjs +244 -0
- package/vendor/agent/director/reading.mjs +341 -0
- package/vendor/agent/director/router.mjs +184 -0
- package/vendor/agent/director/seams.mjs +243 -0
- package/vendor/agent/director/session.mjs +643 -0
- package/vendor/agent/director/store.mjs +119 -0
- package/vendor/agent/director/taskGate.mjs +110 -0
- package/vendor/agent/director/teamLedger.mjs +118 -0
- package/vendor/agent/director/triage.mjs +63 -0
- package/vendor/agent/downloads.cjs +363 -0
- package/vendor/agent/flow.mjs +78 -0
- package/vendor/agent/guard.mjs +613 -0
- package/vendor/agent/host.mjs +1736 -0
- package/vendor/agent/language.mjs +58 -0
- package/vendor/agent/ledger.mjs +360 -0
- package/vendor/agent/locale.cjs +186 -0
- package/vendor/agent/loop/capacity.mjs +74 -0
- package/vendor/agent/loop/compose.mjs +127 -0
- package/vendor/agent/loop/gate.mjs +205 -0
- package/vendor/agent/loop/judge.mjs +189 -0
- package/vendor/agent/loop/levels.mjs +273 -0
- package/vendor/agent/loop/state.mjs +358 -0
- package/vendor/agent/notes.cjs +278 -0
- package/vendor/agent/pace.mjs +258 -0
- package/vendor/agent/panels.mjs +431 -0
- package/vendor/agent/prompt.mjs +342 -0
- package/vendor/agent/reference/board.mjs +410 -0
- package/vendor/agent/reference/compose.mjs +364 -0
- package/vendor/agent/reference/decode.mjs +56 -0
- package/vendor/agent/reference/facts.mjs +1874 -0
- package/vendor/agent/reference/png.mjs +107 -0
- package/vendor/agent/reference/records.mjs +63 -0
- package/vendor/agent/reference/web.mjs +252 -0
- package/vendor/agent/roles/artist.mjs +69 -0
- package/vendor/agent/roles/builder.mjs +79 -0
- package/vendor/agent/roles/checks.mjs +223 -0
- package/vendor/agent/roles/common.mjs +188 -0
- package/vendor/agent/roles/critic.mjs +171 -0
- package/vendor/agent/roles/index.mjs +39 -0
- package/vendor/agent/roles/modeller.mjs +142 -0
- package/vendor/agent/roles/qa.mjs +58 -0
- package/vendor/agent/roles/rubrics.mjs +79 -0
- package/vendor/agent/roles/sound.mjs +69 -0
- package/vendor/agent/rounds.cjs +333 -0
- package/vendor/agent/shared.mjs +284 -0
- package/vendor/agent/stopGate.mjs +574 -0
- package/vendor/agent/subagents.mjs +129 -0
- package/vendor/agent/tools/assets.mjs +499 -0
- package/vendor/agent/tools/blender.mjs +754 -0
- package/vendor/agent/tools/cards.mjs +479 -0
- package/vendor/agent/tools/choices.mjs +479 -0
- package/vendor/agent/tools/compose.mjs +74 -0
- package/vendor/agent/tools/environment.mjs +488 -0
- package/vendor/agent/tools/eyes.mjs +733 -0
- package/vendor/agent/tools/generate.mjs +338 -0
- package/vendor/agent/tools/guide.mjs +46 -0
- package/vendor/agent/tools/harness.mjs +193 -0
- package/vendor/agent/tools/image.mjs +643 -0
- package/vendor/agent/tools/index.mjs +162 -0
- package/vendor/agent/tools/look.mjs +578 -0
- package/vendor/agent/tools/loop.mjs +858 -0
- package/vendor/agent/tools/others.mjs +123 -0
- package/vendor/agent/tools/pictures.mjs +535 -0
- package/vendor/agent/tools/reference.mjs +366 -0
- package/vendor/agent/transcripts.mjs +118 -0
- package/vendor/agent-loop.mjs +602 -0
- package/vendor/agent-plugin/.claude-plugin/plugin.json +5 -0
- package/vendor/agent-plugin/skills/art-direction/SKILL.md +82 -0
- package/vendor/agent-plugin/skills/asset-legality/SKILL.md +101 -0
- package/vendor/agent-plugin/skills/asset-sources/SKILL.md +111 -0
- package/vendor/agent-plugin/skills/blender-modeling/SKILL.md +97 -0
- package/vendor/agent-plugin/skills/look-dev/SKILL.md +104 -0
- package/vendor/agent-plugin/skills/playtesting/SKILL.md +74 -0
- package/vendor/agent-plugin/skills/reference-loop/SKILL.md +102 -0
- package/vendor/agent-plugin/skills/sound-design/SKILL.md +60 -0
- package/vendor/agent-plugin/skills/style/SKILL.md +35 -0
- package/vendor/agent-plugin/skills/tsl-r185/SKILL.md +107 -0
- package/vendor/auth.cjs +570 -0
- package/vendor/build.cjs +953 -0
- package/vendor/catalog.json +455 -0
- package/vendor/connectors.cjs +688 -0
- package/vendor/eyes.mjs +733 -0
- package/vendor/gameExports.json +1390 -0
- package/vendor/git.cjs +222 -0
- package/vendor/models.json +57 -0
- package/vendor/publish.cjs +1018 -0
- package/vendor/refBoard.cjs +301 -0
- package/vendor/schema/dist/assets.d.ts +335 -0
- package/vendor/schema/dist/assets.js +439 -0
- package/vendor/schema/dist/brief.d.ts +357 -0
- package/vendor/schema/dist/brief.js +302 -0
- package/vendor/schema/dist/common.d.ts +9 -0
- package/vendor/schema/dist/common.js +13 -0
- package/vendor/schema/dist/config.d.ts +406 -0
- package/vendor/schema/dist/config.js +355 -0
- package/vendor/schema/dist/contract.d.ts +599 -0
- package/vendor/schema/dist/contract.js +1146 -0
- package/vendor/schema/dist/index.d.ts +14 -0
- package/vendor/schema/dist/index.js +21 -0
- package/vendor/schema/dist/look.d.ts +463 -0
- package/vendor/schema/dist/look.js +681 -0
- package/vendor/schema/dist/lookStats.d.ts +230 -0
- package/vendor/schema/dist/lookStats.js +768 -0
- package/vendor/schema/dist/pilot.d.ts +32 -0
- package/vendor/schema/dist/pilot.js +44 -0
- package/vendor/schema/dist/publish.d.ts +214 -0
- package/vendor/schema/dist/publish.js +291 -0
- package/vendor/schema/dist/scene.d.ts +75 -0
- package/vendor/schema/dist/scene.js +120 -0
- package/vendor/schema/dist/skyLight.d.ts +141 -0
- package/vendor/schema/dist/skyLight.js +436 -0
- package/vendor/schema/dist/style.d.ts +131 -0
- package/vendor/schema/dist/style.js +155 -0
- package/vendor/schema/package.json +1 -0
- package/vendor/selectionPrompt.mjs +51 -0
- package/vendor/useTools.mjs +195 -0
- package/vendor/userMessage.mjs +26 -0
- package/web-dist/assets/GaussianSplatUtils-CB77cP9U.js +1 -0
- package/web-dist/assets/KTX2Loader-6OIWUF7s.js +2 -0
- package/web-dist/assets/SPZLoader-zYj0Alfv.js +1 -0
- package/web-dist/assets/gaussianSplat-CJTI1sEh.js +1 -0
- package/web-dist/assets/index-CcjyyQco.css +1 -0
- package/web-dist/assets/index-DMyJcoZJ.js +693 -0
- package/web-dist/assets/meshopt_decoder.module-BvwdjiD3.js +1 -0
- package/web-dist/assets/zstddec.module-CfFeQW7d.js +1 -0
- package/web-dist/index.html +34 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export * from './common.js';
|
|
2
|
+
export * from './config.js';
|
|
3
|
+
export * from './scene.js';
|
|
4
|
+
export * from './publish.js';
|
|
5
|
+
export * from './pilot.js';
|
|
6
|
+
export * from './contract.js';
|
|
7
|
+
export * from './brief.js';
|
|
8
|
+
export * from './style.js';
|
|
9
|
+
/** Document kinds the agent can ask for a schema of. */
|
|
10
|
+
export declare const DOC_KINDS: readonly ["config", "scene", "brief", "style"];
|
|
11
|
+
export type DocKind = (typeof DOC_KINDS)[number];
|
|
12
|
+
/** JSON Schema for a document kind, so the agent's tools describe themselves
|
|
13
|
+
* from this package rather than from a prompt that can drift out of date. */
|
|
14
|
+
export declare function jsonSchemaFor(kind: DocKind): unknown;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { GameConfig } from './config.js';
|
|
3
|
+
import { SceneDoc } from './scene.js';
|
|
4
|
+
import { SpaceBrief } from './brief.js';
|
|
5
|
+
import { SpaceStyle } from './style.js';
|
|
6
|
+
export * from './common.js';
|
|
7
|
+
export * from './config.js';
|
|
8
|
+
export * from './scene.js';
|
|
9
|
+
export * from './publish.js';
|
|
10
|
+
export * from './pilot.js';
|
|
11
|
+
export * from './contract.js';
|
|
12
|
+
export * from './brief.js';
|
|
13
|
+
export * from './style.js';
|
|
14
|
+
/** Document kinds the agent can ask for a schema of. */
|
|
15
|
+
export const DOC_KINDS = ['config', 'scene', 'brief', 'style'];
|
|
16
|
+
/** JSON Schema for a document kind, so the agent's tools describe themselves
|
|
17
|
+
* from this package rather than from a prompt that can drift out of date. */
|
|
18
|
+
export function jsonSchemaFor(kind) {
|
|
19
|
+
const doc = kind === 'scene' ? SceneDoc : kind === 'brief' ? SpaceBrief : kind === 'style' ? SpaceStyle : GameConfig;
|
|
20
|
+
return z.toJSONSchema(doc, { target: 'draft-2020-12' });
|
|
21
|
+
}
|
|
@@ -0,0 +1,463 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { GameConfigT } from './config.js';
|
|
3
|
+
export declare const TONE_MAPPINGS: readonly ["agx", "neutral", "aces", "none"];
|
|
4
|
+
export declare const QUALITY_TIERS: readonly ["low", "medium", "high"];
|
|
5
|
+
/** How edges are smoothed. traa: temporal (three's TRAANode), which also
|
|
6
|
+
* smooths what MSAA never reaches (a shader's own edges, alpha-tested
|
|
7
|
+
* leaves, the shadow's dither); smaa and fxaa: one frame, on the finished
|
|
8
|
+
* picture; msaa: four samples in the scene pass; none. */
|
|
9
|
+
export declare const AA_METHODS: readonly ["traa", "smaa", "fxaa", "msaa", "none"];
|
|
10
|
+
export type ToneMappingId = (typeof TONE_MAPPINGS)[number];
|
|
11
|
+
export type QualityTier = (typeof QUALITY_TIERS)[number];
|
|
12
|
+
export type AaMethod = (typeof AA_METHODS)[number];
|
|
13
|
+
/** The grade, applied in scene-linear light before the tone curve (the LUT and
|
|
14
|
+
* posterize after it, on the display picture). Every field is optional and
|
|
15
|
+
* its absence is the identity. */
|
|
16
|
+
export declare const Grade: z.ZodObject<{
|
|
17
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
18
|
+
tint: z.ZodOptional<z.ZodNumber>;
|
|
19
|
+
saturation: z.ZodOptional<z.ZodNumber>;
|
|
20
|
+
contrast: z.ZodOptional<z.ZodNumber>;
|
|
21
|
+
cdl: z.ZodOptional<z.ZodObject<{
|
|
22
|
+
slope: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
23
|
+
offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
24
|
+
power: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
25
|
+
}, z.core.$strip>>;
|
|
26
|
+
lut: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
27
|
+
asset: z.ZodString;
|
|
28
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
29
|
+
}, z.core.$strip>>>;
|
|
30
|
+
posterize: z.ZodOptional<z.ZodNumber>;
|
|
31
|
+
}, z.core.$strip>;
|
|
32
|
+
/**
|
|
33
|
+
* How the picture is drawn, when the space's style is not a photograph: the
|
|
34
|
+
* marks a drawing makes, laid over the lit and graded picture. Each block is
|
|
35
|
+
* one technique and is off when absent; what it needs to mean anything is
|
|
36
|
+
* required, so no technique arrives with the engine's taste in it. Sizes in
|
|
37
|
+
* px are measured on a picture 1080 pixels high and scale with the real
|
|
38
|
+
* one, so a still at 2560 wide draws the same marks the viewport does.
|
|
39
|
+
*
|
|
40
|
+
* These are techniques, not styles: which of them a space uses, and with
|
|
41
|
+
* what numbers, comes from its own style.json (analysed from the creator's
|
|
42
|
+
* pictures, or the direction they chose), never from a list of looks.
|
|
43
|
+
*/
|
|
44
|
+
export declare const LookStyle: z.ZodObject<{
|
|
45
|
+
outline: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
46
|
+
width: z.ZodNumber;
|
|
47
|
+
color: z.ZodString;
|
|
48
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
crease: z.ZodOptional<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>>>;
|
|
51
|
+
bands: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
52
|
+
count: z.ZodNumber;
|
|
53
|
+
softness: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
}, z.core.$strip>>>;
|
|
55
|
+
hatch: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
56
|
+
amount: z.ZodNumber;
|
|
57
|
+
spacing: z.ZodNumber;
|
|
58
|
+
color: z.ZodString;
|
|
59
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
60
|
+
}, z.core.$strip>>>;
|
|
61
|
+
halftone: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
62
|
+
amount: z.ZodNumber;
|
|
63
|
+
spacing: z.ZodNumber;
|
|
64
|
+
color: z.ZodString;
|
|
65
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
66
|
+
}, z.core.$strip>>>;
|
|
67
|
+
paint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
68
|
+
radius: z.ZodNumber;
|
|
69
|
+
}, z.core.$strip>>>;
|
|
70
|
+
paper: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
71
|
+
amount: z.ZodNumber;
|
|
72
|
+
color: z.ZodString;
|
|
73
|
+
grain: z.ZodNumber;
|
|
74
|
+
}, z.core.$strip>>>;
|
|
75
|
+
pixel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
76
|
+
size: z.ZodNumber;
|
|
77
|
+
}, z.core.$strip>>>;
|
|
78
|
+
}, z.core.$strip>;
|
|
79
|
+
export type LookStyleT = z.infer<typeof LookStyle>;
|
|
80
|
+
/** Every field optional: resolveLook fills the rest, so a config stays short.
|
|
81
|
+
* A key it does not know (the old `preset`) is dropped by this lenient parse
|
|
82
|
+
* and refused by LookSpecStrict. */
|
|
83
|
+
export declare const LookSpec: z.ZodObject<{
|
|
84
|
+
toneMapping: z.ZodOptional<z.ZodEnum<{
|
|
85
|
+
agx: "agx";
|
|
86
|
+
neutral: "neutral";
|
|
87
|
+
aces: "aces";
|
|
88
|
+
none: "none";
|
|
89
|
+
}>>;
|
|
90
|
+
exposure: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
grade: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
temperature: z.ZodOptional<z.ZodNumber>;
|
|
93
|
+
tint: z.ZodOptional<z.ZodNumber>;
|
|
94
|
+
saturation: z.ZodOptional<z.ZodNumber>;
|
|
95
|
+
contrast: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
cdl: z.ZodOptional<z.ZodObject<{
|
|
97
|
+
slope: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
98
|
+
offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
99
|
+
power: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
|
|
100
|
+
}, z.core.$strip>>;
|
|
101
|
+
lut: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
102
|
+
asset: z.ZodString;
|
|
103
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
104
|
+
}, z.core.$strip>>>;
|
|
105
|
+
posterize: z.ZodOptional<z.ZodNumber>;
|
|
106
|
+
}, z.core.$strip>>;
|
|
107
|
+
ao: z.ZodOptional<z.ZodObject<{
|
|
108
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
radius: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
strength: z.ZodOptional<z.ZodNumber>;
|
|
111
|
+
}, z.core.$strip>>;
|
|
112
|
+
aa: z.ZodOptional<z.ZodEnum<{
|
|
113
|
+
none: "none";
|
|
114
|
+
traa: "traa";
|
|
115
|
+
smaa: "smaa";
|
|
116
|
+
fxaa: "fxaa";
|
|
117
|
+
msaa: "msaa";
|
|
118
|
+
}>>;
|
|
119
|
+
shadows: z.ZodOptional<z.ZodObject<{
|
|
120
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
121
|
+
low: "low";
|
|
122
|
+
medium: "medium";
|
|
123
|
+
high: "high";
|
|
124
|
+
}>>;
|
|
125
|
+
softness: z.ZodOptional<z.ZodNumber>;
|
|
126
|
+
cascades: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
128
|
+
}, z.core.$strip>>;
|
|
129
|
+
ssr: z.ZodOptional<z.ZodObject<{
|
|
130
|
+
enabled: z.ZodOptional<z.ZodBoolean>;
|
|
131
|
+
distance: z.ZodOptional<z.ZodNumber>;
|
|
132
|
+
thickness: z.ZodOptional<z.ZodNumber>;
|
|
133
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
134
|
+
}, z.core.$strip>>;
|
|
135
|
+
gi: z.ZodOptional<z.ZodObject<{
|
|
136
|
+
kind: z.ZodLiteral<"probes">;
|
|
137
|
+
spacing: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
box: z.ZodOptional<z.ZodObject<{
|
|
140
|
+
center: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
141
|
+
size: z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
}, z.core.$strip>>;
|
|
144
|
+
vignette: z.ZodOptional<z.ZodObject<{
|
|
145
|
+
amount: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
smoothness: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strip>>;
|
|
148
|
+
grain: z.ZodOptional<z.ZodNumber>;
|
|
149
|
+
environment: z.ZodOptional<z.ZodObject<{
|
|
150
|
+
intensity: z.ZodOptional<z.ZodNumber>;
|
|
151
|
+
}, z.core.$strip>>;
|
|
152
|
+
style: z.ZodOptional<z.ZodObject<{
|
|
153
|
+
outline: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
154
|
+
width: z.ZodNumber;
|
|
155
|
+
color: z.ZodString;
|
|
156
|
+
depth: z.ZodOptional<z.ZodNumber>;
|
|
157
|
+
crease: z.ZodOptional<z.ZodNumber>;
|
|
158
|
+
}, z.core.$strip>>>;
|
|
159
|
+
bands: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
160
|
+
count: z.ZodNumber;
|
|
161
|
+
softness: z.ZodOptional<z.ZodNumber>;
|
|
162
|
+
}, z.core.$strip>>>;
|
|
163
|
+
hatch: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
164
|
+
amount: z.ZodNumber;
|
|
165
|
+
spacing: z.ZodNumber;
|
|
166
|
+
color: z.ZodString;
|
|
167
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
168
|
+
}, z.core.$strip>>>;
|
|
169
|
+
halftone: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
170
|
+
amount: z.ZodNumber;
|
|
171
|
+
spacing: z.ZodNumber;
|
|
172
|
+
color: z.ZodString;
|
|
173
|
+
angle: z.ZodOptional<z.ZodNumber>;
|
|
174
|
+
}, z.core.$strip>>>;
|
|
175
|
+
paint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
176
|
+
radius: z.ZodNumber;
|
|
177
|
+
}, z.core.$strip>>>;
|
|
178
|
+
paper: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
179
|
+
amount: z.ZodNumber;
|
|
180
|
+
color: z.ZodString;
|
|
181
|
+
grain: z.ZodNumber;
|
|
182
|
+
}, z.core.$strip>>>;
|
|
183
|
+
pixel: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
184
|
+
size: z.ZodNumber;
|
|
185
|
+
}, z.core.$strip>>>;
|
|
186
|
+
}, z.core.$strip>>;
|
|
187
|
+
tiers: z.ZodOptional<z.ZodObject<{
|
|
188
|
+
low: z.ZodOptional<z.ZodObject<{
|
|
189
|
+
ao: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
bloom: z.ZodOptional<z.ZodBoolean>;
|
|
191
|
+
grain: z.ZodOptional<z.ZodBoolean>;
|
|
192
|
+
aa: z.ZodOptional<z.ZodEnum<{
|
|
193
|
+
none: "none";
|
|
194
|
+
traa: "traa";
|
|
195
|
+
smaa: "smaa";
|
|
196
|
+
fxaa: "fxaa";
|
|
197
|
+
msaa: "msaa";
|
|
198
|
+
}>>;
|
|
199
|
+
cascades: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
ssr: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
gi: z.ZodOptional<z.ZodBoolean>;
|
|
202
|
+
}, z.core.$strip>>;
|
|
203
|
+
medium: z.ZodOptional<z.ZodObject<{
|
|
204
|
+
ao: z.ZodOptional<z.ZodBoolean>;
|
|
205
|
+
bloom: z.ZodOptional<z.ZodBoolean>;
|
|
206
|
+
grain: z.ZodOptional<z.ZodBoolean>;
|
|
207
|
+
aa: z.ZodOptional<z.ZodEnum<{
|
|
208
|
+
none: "none";
|
|
209
|
+
traa: "traa";
|
|
210
|
+
smaa: "smaa";
|
|
211
|
+
fxaa: "fxaa";
|
|
212
|
+
msaa: "msaa";
|
|
213
|
+
}>>;
|
|
214
|
+
cascades: z.ZodOptional<z.ZodBoolean>;
|
|
215
|
+
ssr: z.ZodOptional<z.ZodBoolean>;
|
|
216
|
+
gi: z.ZodOptional<z.ZodBoolean>;
|
|
217
|
+
}, z.core.$strip>>;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
}, z.core.$strip>;
|
|
220
|
+
export type LookSpecT = z.infer<typeof LookSpec>;
|
|
221
|
+
/** The same, refusing unknown keys at every depth: what look_apply validates with, so a typo is a finding
|
|
222
|
+
* rather than silently ignored. The config itself stays lenient so an older studio can open a newer project. */
|
|
223
|
+
export declare const LookSpecStrict: z.ZodType;
|
|
224
|
+
type V3 = [number, number, number];
|
|
225
|
+
export interface ResolvedLook {
|
|
226
|
+
/** The config has no look block: the studio's look from before, exactly. */
|
|
227
|
+
legacy: boolean;
|
|
228
|
+
/** Always null: there are no presets any more. Kept for one release so a
|
|
229
|
+
* reader of the field (the world's player page) still compiles. */
|
|
230
|
+
preset: null;
|
|
231
|
+
tier: QualityTier;
|
|
232
|
+
toneMapping: ToneMappingId;
|
|
233
|
+
exposure: number;
|
|
234
|
+
grade: {
|
|
235
|
+
temperature: number;
|
|
236
|
+
tint: number;
|
|
237
|
+
saturation: number;
|
|
238
|
+
contrast: number;
|
|
239
|
+
cdl: {
|
|
240
|
+
slope: V3;
|
|
241
|
+
offset: V3;
|
|
242
|
+
power: V3;
|
|
243
|
+
};
|
|
244
|
+
lut: {
|
|
245
|
+
asset: string;
|
|
246
|
+
intensity: number;
|
|
247
|
+
} | null;
|
|
248
|
+
posterize: number;
|
|
249
|
+
};
|
|
250
|
+
ao: {
|
|
251
|
+
enabled: boolean;
|
|
252
|
+
radius: number;
|
|
253
|
+
strength: number;
|
|
254
|
+
};
|
|
255
|
+
/** From config.bloom. */
|
|
256
|
+
bloom: {
|
|
257
|
+
enabled: boolean;
|
|
258
|
+
strength: number;
|
|
259
|
+
radius: number;
|
|
260
|
+
threshold: number;
|
|
261
|
+
};
|
|
262
|
+
/** From config.fog, filled in. */
|
|
263
|
+
fog: {
|
|
264
|
+
mode: 'range' | 'exp2' | 'height';
|
|
265
|
+
color: string;
|
|
266
|
+
near: number;
|
|
267
|
+
far: number;
|
|
268
|
+
density: number;
|
|
269
|
+
height: number;
|
|
270
|
+
heightDensity: number;
|
|
271
|
+
} | null;
|
|
272
|
+
/** mapSize is the most texels any sun's map gets on this device (a sun
|
|
273
|
+
* the game made is capped to it). The SDK's own sun gets sunMapSize, or
|
|
274
|
+
* cascadeMapSize in each cascade: as fine as its penumbra can show
|
|
275
|
+
* (shadowMapSizes), never more than mapSize. cascades 0 is one map (the
|
|
276
|
+
* whole map on a small planet, a square that follows the player on a
|
|
277
|
+
* bigger one); distance is how far cascades reach. */
|
|
278
|
+
shadows: {
|
|
279
|
+
mapSize: 1024 | 2048 | 4096;
|
|
280
|
+
sunMapSize: number;
|
|
281
|
+
cascadeMapSize: number;
|
|
282
|
+
softness: number;
|
|
283
|
+
cascades: number;
|
|
284
|
+
distance: number;
|
|
285
|
+
};
|
|
286
|
+
vignette: {
|
|
287
|
+
amount: number;
|
|
288
|
+
smoothness: number;
|
|
289
|
+
};
|
|
290
|
+
grain: number;
|
|
291
|
+
environment: {
|
|
292
|
+
intensity: number;
|
|
293
|
+
};
|
|
294
|
+
/** The edge smoothing this device draws with. */
|
|
295
|
+
aa: AaMethod;
|
|
296
|
+
/** Reflections, or null for none. */
|
|
297
|
+
ssr: {
|
|
298
|
+
distance: number;
|
|
299
|
+
thickness: number;
|
|
300
|
+
intensity: number;
|
|
301
|
+
} | null;
|
|
302
|
+
/** Probe GI as the brief asks it and this device bakes it, or null. */
|
|
303
|
+
gi: ResolvedGi | null;
|
|
304
|
+
pixelRatioMax: 1 | 1.5 | 2;
|
|
305
|
+
/** The most pixels the drawing buffer holds (a phone's budget), or null
|
|
306
|
+
* for no budget beyond pixelRatioMax. */
|
|
307
|
+
pixelBudget: number | null;
|
|
308
|
+
/** 4 only for aa msaa: TRAA and the post methods want one sample. */
|
|
309
|
+
msaa: 0 | 4;
|
|
310
|
+
/** The drawing techniques, each null when off (LookStyle). */
|
|
311
|
+
style: ResolvedStyle;
|
|
312
|
+
}
|
|
313
|
+
/** LookStyle with every number filled in; null is a technique that is off. */
|
|
314
|
+
export interface ResolvedStyle {
|
|
315
|
+
outline: {
|
|
316
|
+
width: number;
|
|
317
|
+
color: string;
|
|
318
|
+
depth: number;
|
|
319
|
+
crease: number;
|
|
320
|
+
} | null;
|
|
321
|
+
bands: {
|
|
322
|
+
count: number;
|
|
323
|
+
softness: number;
|
|
324
|
+
} | null;
|
|
325
|
+
hatch: {
|
|
326
|
+
amount: number;
|
|
327
|
+
spacing: number;
|
|
328
|
+
color: string;
|
|
329
|
+
angle: number;
|
|
330
|
+
} | null;
|
|
331
|
+
halftone: {
|
|
332
|
+
amount: number;
|
|
333
|
+
spacing: number;
|
|
334
|
+
color: string;
|
|
335
|
+
angle: number;
|
|
336
|
+
} | null;
|
|
337
|
+
paint: {
|
|
338
|
+
radius: number;
|
|
339
|
+
} | null;
|
|
340
|
+
paper: {
|
|
341
|
+
amount: number;
|
|
342
|
+
color: string;
|
|
343
|
+
grain: number;
|
|
344
|
+
} | null;
|
|
345
|
+
pixel: {
|
|
346
|
+
size: number;
|
|
347
|
+
} | null;
|
|
348
|
+
}
|
|
349
|
+
/** No technique: the picture as lit and graded. */
|
|
350
|
+
export declare const NO_STYLE: ResolvedStyle;
|
|
351
|
+
/** Whether a look draws with any technique of LookStyle. */
|
|
352
|
+
export declare const hasStyle: (style: ResolvedStyle | null | undefined) => boolean;
|
|
353
|
+
/** Probe GI as a device bakes it (resolveLook; the SDK's look/gi.ts). */
|
|
354
|
+
export interface ResolvedGi {
|
|
355
|
+
kind: 'probes';
|
|
356
|
+
/** Metres between probes, as the brief asks; wider when the box needs more than maxProbes. */
|
|
357
|
+
spacing: number;
|
|
358
|
+
intensity: number;
|
|
359
|
+
/** The brief's box, or null: what stands on the map, measured when it bakes. */
|
|
360
|
+
box: {
|
|
361
|
+
center: V3;
|
|
362
|
+
size: V3;
|
|
363
|
+
} | null;
|
|
364
|
+
/** The most probes this device bakes. */
|
|
365
|
+
maxProbes: number;
|
|
366
|
+
/** Past maxProbes: 'space' the probes wider apart, or 'skip' GI (a phone
|
|
367
|
+
* keeps it only for a grid that small at the brief's own spacing). */
|
|
368
|
+
fit: 'space' | 'skip';
|
|
369
|
+
/** Passes after the first, each one more bounce of light between surfaces. */
|
|
370
|
+
bounces: number;
|
|
371
|
+
/** Each probe's view of the world, pixels a cube side. */
|
|
372
|
+
cubeSize: number;
|
|
373
|
+
}
|
|
374
|
+
/** The size a world with no `tiles` is taken to be where something needs a
|
|
375
|
+
* number (how far the sun's shadows reach, how far a camera stands back). It
|
|
376
|
+
* is not an edge: such a world has none. */
|
|
377
|
+
export declare const OPEN_WORLD_SIDE = 400;
|
|
378
|
+
/** The square a single map follows the player over, past SHADOW_WHOLE_MAP:
|
|
379
|
+
* half its side, metres (world.ts). */
|
|
380
|
+
export declare const SHADOW_FOLLOW = 40;
|
|
381
|
+
/** The largest half-side of planet one shadow map covers whole (world.ts
|
|
382
|
+
* fits it to the map up to here and makes it follow the player past it).
|
|
383
|
+
* Past it the cascades are on by default. */
|
|
384
|
+
export declare const SHADOW_WHOLE_MAP = 60;
|
|
385
|
+
/** A phone's drawing buffer, about 1.5 million pixels: sharper than one
|
|
386
|
+
* pixel per CSS pixel (0.33 MP on a 390 x 844 phone) and well short of
|
|
387
|
+
* its panel (3 MP at a pixel ratio of 3). */
|
|
388
|
+
export declare const PHONE_PIXEL_BUDGET = 1500000;
|
|
389
|
+
/** The look a config with a look block starts from. */
|
|
390
|
+
export declare const LOOK_DEFAULTS: Omit<ResolvedLook, 'legacy' | 'preset' | 'tier' | 'bloom' | 'fog'>;
|
|
391
|
+
/** LOOK_DEFAULTS with toneMapping 'neutral': what the studio drew before
|
|
392
|
+
* there was a look block, so a config without one looks as it always did. */
|
|
393
|
+
export declare const LEGACY_LOOK: typeof LOOK_DEFAULTS;
|
|
394
|
+
/** fog.heightDensity when a height fog gives none. The ground fog's factor is
|
|
395
|
+
* 1 - exp(-(heightDensity x metres below fog.height x distance)^2): depth
|
|
396
|
+
* and distance multiply, so for ground 2.3 m under the top, at 5, 10, 20,
|
|
397
|
+
* 40 and 80 m, 0.005 gives 0.00, 0.01, 0.05, 0.19, 0.57; 0.01 gives 0.01,
|
|
398
|
+
* 0.05, 0.19, 0.57, 0.97; 0.08 gives 0.57 at 5 m and 0.97 by 10 m. */
|
|
399
|
+
export declare const FOG_HEIGHT_DENSITY = 0.01;
|
|
400
|
+
/** Above this a height fog turns everything under its top to fog colour
|
|
401
|
+
* within a few metres; look_apply says so. */
|
|
402
|
+
export declare const FOG_HEIGHT_DENSITY_THICK = 0.04;
|
|
403
|
+
/**
|
|
404
|
+
* The look a config asks for, on a device of `tier` (default high: the studio
|
|
405
|
+
* and the CLI always draw high). In order, each over the last: LOOK_DEFAULTS
|
|
406
|
+
* (LEGACY_LOOK when the config has no look block), the config's look fields,
|
|
407
|
+
* then the tier, which only ever takes things away: low draws without AO and
|
|
408
|
+
* grain (unless look.tiers.low gives them back), FXAA where TRAA or MSAA was
|
|
409
|
+
* asked, no cascades and no reflections, a 1024 shadow map and a phone's
|
|
410
|
+
* pixel budget; medium a 2048 map, 1.5 pixels, three cascades at most and no
|
|
411
|
+
* reflections. Either tier's flags may also drop bloom, and choose their own
|
|
412
|
+
* edge smoothing, cascades and reflections. Bloom and fog are config.bloom
|
|
413
|
+
* and config.fog, filled in.
|
|
414
|
+
*
|
|
415
|
+
* Two defaults follow the config rather than a constant. The sun's cascades
|
|
416
|
+
* are on where one map cannot hold the planet (a half-side past
|
|
417
|
+
* SHADOW_WHOLE_MAP), reaching the map's diagonal. The sky lights at its own
|
|
418
|
+
* strength (1) when it is measured light, an HDRI or a physical sky: 0.4
|
|
419
|
+
* there dimmed a photographed sky to 40% of what it was shot at.
|
|
420
|
+
*/
|
|
421
|
+
export declare function resolveLook(config: GameConfigT | null | undefined, tier?: QualityTier): ResolvedLook;
|
|
422
|
+
/**
|
|
423
|
+
* The SDK sun's map sizes, texels a side, within the device's cap.
|
|
424
|
+
*
|
|
425
|
+
* sun one map over what it covers (the whole map up to
|
|
426
|
+
* SHADOW_WHOLE_MAP, the square that follows the player past
|
|
427
|
+
* it): as fine as its penumbra can show and no finer, at least
|
|
428
|
+
* SUN_MAP_MIN. Texels finer than half the penumbra are blurred
|
|
429
|
+
* away by the soft filter (light.ts spreads its taps over the
|
|
430
|
+
* penumbra's width), so they cost GPU memory (5 bytes a texel:
|
|
431
|
+
* depth and the lean colour target) and show nothing. A 7 cm
|
|
432
|
+
* penumbra keeps the cap on a one-tile map; a 35 cm one there
|
|
433
|
+
* would need 1024 and gets SUN_MAP_MIN.
|
|
434
|
+
* cascade half the cap, so four cascades cost what one full map does.
|
|
435
|
+
* Not sized by the penumbra: only the nearest cascade's texels
|
|
436
|
+
* are finer than a penumbra, the far ones' are already coarser
|
|
437
|
+
* (a 300 m cascade's 2048 texels are 15 cm), and halving them
|
|
438
|
+
* moved the shadows inside laputa-v2's window arches at its
|
|
439
|
+
* hero view, 216 m out.
|
|
440
|
+
*/
|
|
441
|
+
export declare function shadowMapSizes(o: {
|
|
442
|
+
half: number;
|
|
443
|
+
softness: number;
|
|
444
|
+
cap: number;
|
|
445
|
+
}): {
|
|
446
|
+
sun: number;
|
|
447
|
+
cascade: number;
|
|
448
|
+
};
|
|
449
|
+
/** The parts of a resolved look that change the shader graph (tone mapping, ao on, bloom on, lut on,
|
|
450
|
+
* posterize on, vignette on, grain on, msaa, fog mode). Equal keys: only uniforms changed. */
|
|
451
|
+
export declare function lookStructureKey(look: ResolvedLook): string;
|
|
452
|
+
export * from './lookStats.js';
|
|
453
|
+
export * from './skyLight.js';
|
|
454
|
+
/**
|
|
455
|
+
* The look values a config leaves to the engine's own numbers, and a sky of
|
|
456
|
+
* kind none, as sentences for nw_check: each one is a value every space that
|
|
457
|
+
* leaves it out shares, so it reads as a stock look rather than as this
|
|
458
|
+
* space's. Read from the raw document, before the schema fills its defaults.
|
|
459
|
+
* Technical values (edge smoothing, cascades, tiers) are never named: their
|
|
460
|
+
* defaults are not a look. Identity values (a grade, vignette and grain
|
|
461
|
+
* left out are none of them) are not named either.
|
|
462
|
+
*/
|
|
463
|
+
export declare function lookAdvice(raw: unknown): string[];
|