@genex-ai/cli-demo 1.5.0-dev.389 → 1.5.1-dev.392
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 +1 -3
- package/dist/index.js +26 -9
- package/package.json +1 -1
- package/templates/skills/genex-game-director/SKILL.md +5 -4
- package/templates/skills/genex-game-director/references/routing-map.md +1 -1
- package/templates/skills/genex-getting-started/SKILL.md +5 -3
- package/templates/skills/genex-monetization/SKILL.md +10 -0
- package/templates/skills/genex-threejs-adaptive-quality/SKILL.md +18 -12
- package/templates/skills/genex-threejs-adaptive-quality/references/adaptive-quality.md +1 -1
- package/templates/skills/genex-threejs-game-ui/SKILL.md +1 -1
- package/templates/skills/genex-ai-skybox/SKILL.md +0 -133
package/README.md
CHANGED
|
@@ -11,7 +11,6 @@ genex preview # build + push to the hosted draft URL (unlisted)
|
|
|
11
11
|
genex publish # build + push, then list the game in the gallery
|
|
12
12
|
genex make-remixable # make this game remixable — migrate a private source to a public repo
|
|
13
13
|
genex model "<prompt>" # generate a 3D model → prints an asset URL
|
|
14
|
-
genex skybox "<prompt>" # generate a 360° sky → prints an asset URL
|
|
15
14
|
genex sfx "<prompt>" # generate a sound fx → prints an asset URL
|
|
16
15
|
genex texture "<prompt>" # generate a texture → prints an asset URL
|
|
17
16
|
genex image "<prompt>" # generate an image → prints an asset URL
|
|
@@ -88,7 +87,7 @@ baked at build time via `GENEX_CLI_CHANNEL` (see `src/config.ts`).
|
|
|
88
87
|
|
|
89
88
|
## Generating assets
|
|
90
89
|
|
|
91
|
-
`genex model |
|
|
90
|
+
`genex model | sfx | texture | image | video "<prompt>"` turn a prompt into a
|
|
92
91
|
real, game-ready asset stored in R2. The command blocks until the asset is ready (live SSE
|
|
93
92
|
stream), then prints its public URL — the game loads it directly, nothing is
|
|
94
93
|
downloaded or committed:
|
|
@@ -96,7 +95,6 @@ downloaded or committed:
|
|
|
96
95
|
| Command | Provider | Prints (role) |
|
|
97
96
|
| --- | --- | --- |
|
|
98
97
|
| `genex model "<prompt>"` | Tripo | `…/generations/<id>/model-glb` |
|
|
99
|
-
| `genex skybox "<prompt>"` | Blockade Labs | `…/generations/<id>/skybox-equirect` |
|
|
100
98
|
| `genex sfx "<prompt>" [--duration <s>]` | ElevenLabs | `…/generations/<id>/audio-sfx` |
|
|
101
99
|
| `genex texture "<prompt>" [--terrain]` | Gemini | `…/generations/<id>/texture-basecolor` |
|
|
102
100
|
| `genex image "<prompt>" [--transparent] [--aspect <ratio>]` | fal.ai | `…/generations/<id>/image-main` |
|
package/dist/index.js
CHANGED
|
@@ -991,7 +991,7 @@ var CONTRACT_END = "<!-- genex:contract:end -->";
|
|
|
991
991
|
var GENEX_CONTRACT_BLOCK = `${CONTRACT_BEGIN}
|
|
992
992
|
# Genex build contract (always in effect for this game)
|
|
993
993
|
|
|
994
|
-
Your agentic capabilities that can boost your creation (all via \`npx genex \u2026\`): generate \`model\` \xB7 \`
|
|
994
|
+
Your agentic capabilities that can boost your creation (all via \`npx genex \u2026\`): generate \`model\` \xB7 \`sfx\` \xB7 \`music\` \xB7 \`voice\` \xB7 \`texture\` \xB7 \`image\` (\`--edit\` \xB7 \`--inpaint\` \xB7 \`--glass\` \xB7 \`--clean\` \xB7 \`--upscale\`) \xB7 \`video\` \xB7 rigged \`character\` / \`creature\` \xB7 \`character animate <id> "<verb>"\` (also \`creature animate\`; \`--locomotion\` for the 8-way movement set, \`--video\` for your own footage) \xB7 the pixel toolbox \`ui extract|masks|plate|text-color|trim|audit\` \xB7 vendored \`controller character|car|drone|touch|quality|chat\` \xB7 \`animations search\` \xB7 \`wait <id>\` / \`wait --all\` \xB7 \`preview\` / \`publish\` \xB7 \`rename <name>\` (move the game to a new address \u2014 keeps its plays and likes, kills the old link, needs \`--yes\` once published, and the game must be rebuilt after). Full options: \`npx genex --help\`. There is NO sky generator: every sky, horizon, time of day and weather mood is built in code \u2014 your call how, from a background colour and fog to an atmospheric sky shader with a real sun. It costs nothing, weighs nothing on phones, and keeps the sun in sync with the scene's own lighting, which a painted panorama never can. Task\u2192lane routing lives in the \`genex-game-director\` skill's routing map \u2014 re-load it whenever you're unsure which lane owns a task.
|
|
995
995
|
|
|
996
996
|
Important note: put soul into your creations, with many details and love. Aim to make them realistic and feel real. Use genex capabilities as an extension, but never limit your imagination \u2014 you are a powerful agent. Use your built-in sub-agents and iteration loops (\`/loop\` or your platform's equivalent) where you need them to reach outstanding results. Verify yourself. Anything you put in front of the player should already feel alive and impressive \u2014 never a bare scene waiting for "later". Build what's still missing before polishing what already works.
|
|
997
997
|
|
|
@@ -1119,6 +1119,11 @@ var REMOVED_SKILLS = [
|
|
|
1119
1119
|
"genex-explore",
|
|
1120
1120
|
"genex-threejs-procedural-materials",
|
|
1121
1121
|
// folded into genex-threejs-procedural-assets (AG-881)
|
|
1122
|
+
// 2026-08-12: the generated-panorama lane is paused at the provider, and
|
|
1123
|
+
// every sky is built in code now. Leaving this SKILL.md
|
|
1124
|
+
// installed would keep pointing agents at `npx genex skybox`, which the CLI
|
|
1125
|
+
// refuses.
|
|
1126
|
+
"genex-ai-skybox",
|
|
1122
1127
|
"genex-threejs-skill-router",
|
|
1123
1128
|
"genex-threejs-bloom",
|
|
1124
1129
|
"genex-threejs-screen-space-ambient-occlusion",
|
|
@@ -6680,7 +6685,10 @@ function printHint(kind, view, files, log) {
|
|
|
6680
6685
|
const url = files[0]?.url ?? "";
|
|
6681
6686
|
const hint = {
|
|
6682
6687
|
model: `Standard GLB \u2014 load with GLTFLoader straight from the URL \u2014 see the genex-ai-model skill. url = "${url}"`,
|
|
6683
|
-
|
|
6688
|
+
// Unreachable while the lane is paused (see src/index.ts) — kept so a
|
|
6689
|
+
// restore is one deletion. Games that already ship a panorama still load
|
|
6690
|
+
// it this way.
|
|
6691
|
+
skybox: `Load as an equirectangular texture \u2192 scene.background + scene.environment. url = "${url}"`,
|
|
6684
6692
|
sfx: `Load with AudioLoader into a THREE.PositionalAudio (camera needs an AudioListener) \u2014 see genex-ai-sfx. url = "${url}"`,
|
|
6685
6693
|
music: `Load with AudioLoader into a non-positional THREE.Audio: setLoop(true), setVolume(0.30), start on the first user gesture \u2014 and the settings screen MUST have Music + SFX volume sliders \u2014 see genex-ai-music. url = "${url}"`,
|
|
6686
6694
|
voice: `Load with AudioLoader into a THREE.Audio (or PositionalAudio at the speaker); voice lines are content \u2014 keep them short, SUBTITLED, and skippable \u2014 see genex-ai-voice. url = "${url}"`,
|
|
@@ -19412,7 +19420,6 @@ ${c.bold("Usage")}
|
|
|
19412
19420
|
so this is the only way one exists. Prices come
|
|
19413
19421
|
off a fixed grid, printed on any refusal.
|
|
19414
19422
|
genex model "<prompt>" [options] Generate a 3D model (GLB); prints a public asset URL.
|
|
19415
|
-
genex skybox "<prompt>" [options] Generate a skybox (equirect); prints a public asset URL.
|
|
19416
19423
|
genex sfx "<prompt>" [options] Generate a sound effect (mp3); prints a public asset URL.
|
|
19417
19424
|
genex music "<prompt>" [options] Generate an instrumental music track (mp3); prints a
|
|
19418
19425
|
public asset URL. --duration 10-300s (default 90).
|
|
@@ -19487,12 +19494,8 @@ ${c.bold("Usage")}
|
|
|
19487
19494
|
Pure local work (no API); the PNG tools read
|
|
19488
19495
|
a file or URL, audit scans the project.
|
|
19489
19496
|
|
|
19490
|
-
${c.bold("Options for the generators (`model` `
|
|
19497
|
+
${c.bold("Options for the generators (`model` `sfx` `music` `voice` `texture` `image` `video`)")}
|
|
19491
19498
|
--terrain (texture) seamless tiling surface for terrain/ground.
|
|
19492
|
-
--raw (skybox) send the prompt exactly as written \u2014 skip the
|
|
19493
|
-
appended environment-only clause AND the refusal on
|
|
19494
|
-
prompts that name structures/objects (a sky is sky only;
|
|
19495
|
-
landforms and weather always pass).
|
|
19496
19499
|
--duration <sec> (sfx, video, music) target clip length in seconds;
|
|
19497
19500
|
(character/creature animate) 3-6 s of reference video for
|
|
19498
19501
|
verbs that route to AI video (default 3) \u2014 longer gives a
|
|
@@ -19664,7 +19667,6 @@ ${c.bold("Examples")}
|
|
|
19664
19667
|
genex shop remove sku_123
|
|
19665
19668
|
genex publish --no-push --title "My Game"
|
|
19666
19669
|
genex model "weathered wooden barrel with iron bands"
|
|
19667
|
-
genex skybox "golden hour over a misty mountain range"
|
|
19668
19670
|
genex sfx "punchy laser zap" --duration 2
|
|
19669
19671
|
genex music "brooding orchestral battle loop, seamless loop, no intro or outro" --no-wait
|
|
19670
19672
|
genex voice "You shall not pass!" --voice gruff
|
|
@@ -20268,6 +20270,21 @@ async function main() {
|
|
|
20268
20270
|
ci: !!process.env.CI
|
|
20269
20271
|
});
|
|
20270
20272
|
try {
|
|
20273
|
+
if (parsed.command === "skybox") {
|
|
20274
|
+
log.error("The generated-sky lane is paused \u2014 `genex skybox` is not available.");
|
|
20275
|
+
log.plain(
|
|
20276
|
+
[
|
|
20277
|
+
` ${c.cyan("\u2192")} Build the sky in code instead \u2014 your call how: a background colour with`,
|
|
20278
|
+
` fog, a gradient dome, or three.js's own ${c.cyan("Sky")} shader with a real sun. It costs`,
|
|
20279
|
+
" no credits, no download and no phone memory, and the sun stays in sync with",
|
|
20280
|
+
" your lighting.",
|
|
20281
|
+
` ${c.cyan("\u2192")} A distant skyline or landmark was never a sky: build it as geometry, or`,
|
|
20282
|
+
` generate it with ${c.cyan("npx genex model")}.`
|
|
20283
|
+
].join("\n")
|
|
20284
|
+
);
|
|
20285
|
+
process.exitCode = 1;
|
|
20286
|
+
return;
|
|
20287
|
+
}
|
|
20271
20288
|
if (GEN_KINDS.has(parsed.command)) {
|
|
20272
20289
|
await runGenerate(parsed.command, {
|
|
20273
20290
|
...parsed.options,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.1-dev.392",
|
|
4
4
|
"description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -112,8 +112,8 @@ Genex asset and runtime lanes are:
|
|
|
112
112
|
|
|
113
113
|
- `npx genex model "<prompt>"`—a static GLB → `$genex-ai-model`
|
|
114
114
|
- `npx genex texture "<prompt>"`—a generated surface → `$genex-ai-texture`
|
|
115
|
-
-
|
|
116
|
-
|
|
115
|
+
- sky, horizon, time of day, weather mood—built in code, never generated; no
|
|
116
|
+
command and no skill owns it, so pick what this game needs
|
|
117
117
|
- `npx genex sfx "<prompt>"` / `music` / `voice` →
|
|
118
118
|
`$genex-ai-sfx`, `$genex-ai-music`, `$genex-ai-voice`
|
|
119
119
|
- `npx genex image "<prompt>"` / `video`—2D and motion art →
|
|
@@ -146,9 +146,10 @@ Assets row.
|
|
|
146
146
|
The request sets the floor for the asset plan, never the ceiling: a world
|
|
147
147
|
should feel dressed and alive, so plan the detail its genre implies — and pick
|
|
148
148
|
the more efficient engine per object. Paid generation buys hero pieces (the
|
|
149
|
-
player's character, key props,
|
|
149
|
+
player's character, key props, music); procedural code is the
|
|
150
150
|
unlimited detail engine for structures, buildings, modular kits, and repeated
|
|
151
|
-
or varied dressing (`$genex-threejs-procedural-assets` owns that lane)
|
|
151
|
+
or varied dressing (`$genex-threejs-procedural-assets` owns that lane) — and
|
|
152
|
+
for the sky, which is never generated at all. Mixing
|
|
152
153
|
both in one scene is the normal way to build, never a fallback. In focused
|
|
153
154
|
work, stay inside the touched scope. Run independent planned generations with
|
|
154
155
|
`--no-wait`, scaffold while they land, and preserve their IDs, URLs, and
|
|
@@ -54,7 +54,7 @@ copy demo architecture.
|
|
|
54
54
|
| fixed-view screenshots, input direction, facing, temporal and budget evidence | `$genex-threejs-visual-validation` |
|
|
55
55
|
| a static generated GLB for a concrete prop, vehicle, building, or non-rigged object | `$genex-ai-model` |
|
|
56
56
|
| generated surface or terrain texture with real-world UV scale | `$genex-ai-texture` |
|
|
57
|
-
|
|
|
57
|
+
| sky, skybox, horizon, time of day, weather mood, night or space backdrop | build it in code in the scene—there is no sky command and no owning skill, so pick the technique this game needs |
|
|
58
58
|
| poster, sign, sprite, decal, reference sheet, or other 2D art | `$genex-ai-image` |
|
|
59
59
|
| in-world motion art or another requested video | `$genex-ai-video` |
|
|
60
60
|
| sound effect, one looping music bed, or a short spoken line | `$genex-ai-sfx`, `$genex-ai-music`, or `$genex-ai-voice` |
|
|
@@ -40,7 +40,6 @@ the asset lives in Genex storage (R2), not your repo, so there's nothing to comm
|
|
|
40
40
|
|
|
41
41
|
```bash
|
|
42
42
|
npx genex model "weathered wooden barrel" # a 3D mesh (GLB)
|
|
43
|
-
npx genex skybox "golden hour over mountains" # a 360° sky + lighting
|
|
44
43
|
npx genex sfx "punchy laser zap" --duration 2 # a sound effect (mp3)
|
|
45
44
|
npx genex texture "mossy cobblestone" --terrain # a tiling surface texture
|
|
46
45
|
npx genex image "vintage travel poster" # a picture (poster/sign/sprite/decal)
|
|
@@ -51,8 +50,11 @@ npx genex video "waterfall mist drifting" --loop # a video clip (screen/bac
|
|
|
51
50
|
`npx genex` resolve to the right CLI.)
|
|
52
51
|
|
|
53
52
|
Each has a focused skill with the exact loader code — `$genex-ai-model`,
|
|
54
|
-
`$genex-ai-
|
|
55
|
-
`$genex-ai-video`.
|
|
53
|
+
`$genex-ai-sfx`, `$genex-ai-texture`, `$genex-ai-image`,
|
|
54
|
+
`$genex-ai-video`. The sky is not on that list: there is no sky command, so
|
|
55
|
+
every sky, horizon, and time of day is built in code — your call how, from a
|
|
56
|
+
background colour and fog to an atmospheric sky shader with a real sun. Two
|
|
57
|
+
more workflow skills draw UI art on the same commands,
|
|
56
58
|
for games whose style wants it: `$genex-ai-menu` (a cinematic menu — looping
|
|
57
59
|
video backdrop + DOM buttons) and `$genex-ai-hud` (a HUD sprite set with
|
|
58
60
|
masked fills). A restrained interface in clean CSS is a finished UI too —
|
|
@@ -150,6 +150,16 @@ Render `name`, `iconUrl`, `priceCoins` **and** `priceDisplayUsdCents`. Never
|
|
|
150
150
|
hardcode a price: the server charges what its own catalog says, so a hardcoded
|
|
151
151
|
number can silently disagree with what the player is charged.
|
|
152
152
|
|
|
153
|
+
`getShop()` works for a **guest** and inside a **preview** build, so the shop
|
|
154
|
+
window renders for everyone — that is the point of showing it to a signed-out
|
|
155
|
+
player at all. Buying is what needs an account.
|
|
156
|
+
|
|
157
|
+
**Your game cannot read the player's coin balance, and no HUD should show one.**
|
|
158
|
+
The wallet spans every game on the platform, so an untrusted game is not told how
|
|
159
|
+
much a player can spend. Show what you *can* know — what they own, from
|
|
160
|
+
`getEntitlements()` — and let `buy()` report `insufficient_balance` if it comes
|
|
161
|
+
to that.
|
|
162
|
+
|
|
153
163
|
### Buying
|
|
154
164
|
|
|
155
165
|
```ts
|
|
@@ -7,7 +7,7 @@ description: Make a Genex Three.js game phone-survivable with the vendored adapt
|
|
|
7
7
|
|
|
8
8
|
Phones enforce a hard GPU-memory ceiling desktops don't have: iOS silently
|
|
9
9
|
kills the page when a game allocates too much, and the kill arrives at BOOT —
|
|
10
|
-
exactly when
|
|
10
|
+
exactly when textures, models, and the post stack all decode at once. This
|
|
11
11
|
skill wires the vendored quality kit so the game boots conservatively on
|
|
12
12
|
phones, steps quality UP when the device proves smooth, and never gets uglier
|
|
13
13
|
on desktop. **You can recover from ugly; you cannot recover from a killed
|
|
@@ -115,22 +115,27 @@ reads; pause your own loop and audio on `visibilitychange` too.
|
|
|
115
115
|
|
|
116
116
|
## Generated assets: load through the rungs
|
|
117
117
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
rungs; phones must load through them:
|
|
118
|
+
A generated texture original can be several thousand pixels square — a handful
|
|
119
|
+
of them decode into more memory than a phone has. Every generated image asset
|
|
120
|
+
ships with downscale rungs; phones must load through them:
|
|
121
121
|
|
|
122
122
|
```ts
|
|
123
123
|
import { detectTier } from "./controllers/quality/tier.ts";
|
|
124
124
|
import { loadTextureWithFallback } from "./controllers/quality/pick-asset.ts";
|
|
125
125
|
|
|
126
|
-
const texture = await loadTextureWithFallback(
|
|
126
|
+
const texture = await loadTextureWithFallback(TEXTURE_URL, tier, (u) =>
|
|
127
127
|
new THREE.TextureLoader().loadAsync(u),
|
|
128
128
|
);
|
|
129
129
|
```
|
|
130
130
|
|
|
131
|
-
Desktop loads the original, phones the
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
Desktop loads the original, phones the small rung, and a missing rung falls
|
|
132
|
+
back to the original — never a broken boot. The `$genex-ai-texture` skill
|
|
133
|
+
shows the wiring in place.
|
|
134
|
+
|
|
135
|
+
The sky costs nothing here: it is built in code, so there
|
|
136
|
+
is no panorama to download, no rung ladder, and no boot-time decode. Games
|
|
137
|
+
carrying a generated equirect sky predate that and still load through the
|
|
138
|
+
`skybox-equirect` rungs the kit resolves for them.
|
|
134
139
|
|
|
135
140
|
## Generated models: load through the rungs
|
|
136
141
|
|
|
@@ -170,7 +175,7 @@ source, fetched only as the fallback of last resort. Meshy characters take
|
|
|
170
175
|
the same ladder through
|
|
171
176
|
`loadMeshyCharacter(manifestUrl, { loader: gltfLoader.loader, modelUrlCandidates: (u) => [pickModel(u, tier, { ktx2: gltfLoader.ktx2 }), pickModel(u, tier), u] })`.
|
|
172
177
|
KTX2-capable games can also pass `ktx2Load` to `loadTextureWithFallback` so
|
|
173
|
-
|
|
178
|
+
textures use their `.ktx2` variants.
|
|
174
179
|
|
|
175
180
|
## Quality picker in settings
|
|
176
181
|
|
|
@@ -219,9 +224,10 @@ runtime).
|
|
|
219
224
|
(antialias) are locked wrong for the session. Tier first, renderer second.
|
|
220
225
|
- Governor wired to context-creation flags → no-op at best. Runtime knobs
|
|
221
226
|
only: DPR, post toggles, distances, frame cap.
|
|
222
|
-
-
|
|
223
|
-
that targets phones →
|
|
224
|
-
`loadTextureWithFallback`.
|
|
227
|
+
- A generated texture loaded with a bare `TextureLoader.loadAsync(url)` on a
|
|
228
|
+
game that targets phones → the full-size original decoded; route it through
|
|
229
|
+
`loadTextureWithFallback`. (Same for the equirect sky of a game that predates
|
|
230
|
+
the procedural sky lane — the `skybox-equirect` rungs still resolve.)
|
|
225
231
|
- Quality stepping on every spike → shader compiles read as slowness. The
|
|
226
232
|
governor requires SUSTAINED slow windows; do not shorten them.
|
|
227
233
|
- Testing quality tiers by resizing the desktop window → tiers key off touch +
|
|
@@ -7,7 +7,7 @@ when, or teaching the governor a game-specific step.
|
|
|
7
7
|
|
|
8
8
|
The phone budget is a hard ceiling that includes GPU memory (textures,
|
|
9
9
|
framebuffers), and the OS kill arrives with no catchable event. Boot is the
|
|
10
|
-
danger window:
|
|
10
|
+
danger window: big textures + models + post targets decode together. So phone tiers
|
|
11
11
|
START one notch below what the heuristics suggest and the governor steps UP
|
|
12
12
|
after ~20 smooth seconds. The cost of guessing low is moments of softness; the
|
|
13
13
|
cost of guessing high is a dead page.
|
|
@@ -67,7 +67,7 @@ type.
|
|
|
67
67
|
|
|
68
68
|
**3. Never stall the build on art.** Scaffold, boot wiring, the core loop,
|
|
69
69
|
and the gameplay-logic modules keep moving in parallel whatever the UI is
|
|
70
|
-
doing — and the core asset set (hero model, ground texture,
|
|
70
|
+
doing — and the core asset set (hero model, ground texture, sky, sfx) is
|
|
71
71
|
prompted from the game IDEA, so it can launch up front behind placeholders.
|
|
72
72
|
Nothing ready to build waits on an art answer: decide, say the decision in
|
|
73
73
|
one line, keep going.
|
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: genex-ai-skybox
|
|
3
|
-
description: Generate a real 360° skybox (equirectangular panorama) from a text prompt with `npx genex skybox`, then load it as the scene background + environment lighting in Three.js. Use when the user wants a specific photoreal/painted sky or backdrop ("sunset over the ocean", "alien purple nebula", "foggy pine forest") as an image, rather than a procedural/shader sky.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Genex AI · Skybox
|
|
7
|
-
|
|
8
|
-
Turn a prompt into a 360° **equirectangular** panorama that wraps the scene and
|
|
9
|
-
also lights it (image-based lighting).
|
|
10
|
-
|
|
11
|
-
## When to use this vs. a procedural sky
|
|
12
|
-
|
|
13
|
-
- **Use `npx genex skybox`** for a specific, describable ENVIRONMENT — "golden
|
|
14
|
-
hour over misty mountains", "rolling thunderstorm, towering cumulonimbus",
|
|
15
|
-
"alien purple nebula", "hazy dusk sky over a distant sea horizon". You get a
|
|
16
|
-
real image.
|
|
17
|
-
- Build a procedural, animated, time-of-day sky directly in the game's existing
|
|
18
|
-
scene/runtime only when that is the requested deliverable; this image lane
|
|
19
|
-
owns static generated panoramas.
|
|
20
|
-
|
|
21
|
-
**A skybox is environment only — never content.** Buildings, trees, ruins,
|
|
22
|
-
towers, or any object painted into the sky render at infinite distance: they
|
|
23
|
-
never get closer as the player moves, they sit at the wrong parallax against
|
|
24
|
-
the real 3D world, and they read as broken the moment the camera strafes.
|
|
25
|
-
Structures belong in the scene as geometry (`npx genex model`); the sky
|
|
26
|
-
carries atmosphere — light, weather, clouds, haze, stars.
|
|
27
|
-
|
|
28
|
-
**Writing "no cathedral" does not rescue a prompt that also says "cathedral".**
|
|
29
|
-
Image models are steered by the nouns they ARE given; a ban loses to any
|
|
30
|
-
positive mention of the same thing in the same prompt. A real pilot asked for
|
|
31
|
-
a *"cinematic dark anime gothic atmosphere, ruined cathedral courtyard mood,
|
|
32
|
-
**no buildings or structures**"* — and got a full gothic cathedral with a
|
|
33
|
-
courtyard balustrade and a baked ground plane. Five negations in that prompt,
|
|
34
|
-
zero effect. So never name a structure in a skybox prompt **even to exclude
|
|
35
|
-
it**: describe only light, colour, cloud, weather and time of day.
|
|
36
|
-
|
|
37
|
-
The CLI enforces this both ways. It appends a closed-positive environment
|
|
38
|
-
clause to every prompt (you'll see `↳ environment-only guard applied`; the
|
|
39
|
-
full final prompt is stored with the generation), and it **refuses outright,
|
|
40
|
-
before spending any credits**, when the prompt itself names a structure or
|
|
41
|
-
object. Landforms are fine — "golden hour over misty mountains", "a distant
|
|
42
|
-
sea horizon", "towering cumulonimbus" all pass. If you genuinely need content
|
|
43
|
-
baked into the sky — e.g. a space station panorama for a scene with no world
|
|
44
|
-
geometry — pass `--raw` to send your prompt exactly as written.
|
|
45
|
-
|
|
46
|
-
## Run
|
|
47
|
-
|
|
48
|
-
```bash
|
|
49
|
-
npx genex skybox "<prompt>"
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Blocks until ready, then prints its public URL:
|
|
53
|
-
|
|
54
|
-
```
|
|
55
|
-
https://assets.genex.technology/generations/<id>/skybox-equirect
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
The image lives in Genex storage (R2) and loads straight from that URL — you don't
|
|
59
|
-
download it and nothing is committed to your repo. The URL is permanent (works the same
|
|
60
|
-
in local dev, the published game, and remixes).
|
|
61
|
-
|
|
62
|
-
## Load it as background + environment
|
|
63
|
-
|
|
64
|
-
Load the equirect JPG through the quality tier's rung ladder, mark it
|
|
65
|
-
equirectangular, and use it for both the visible background and the lighting.
|
|
66
|
-
The bare URL is an 8192×4096 original — ~178 MB decoded, over half a phone's
|
|
67
|
-
GPU budget in one texture — so phones must load the downscale rung the platform
|
|
68
|
-
stores next to every skybox (`$genex-threejs-adaptive-quality`):
|
|
69
|
-
|
|
70
|
-
```ts
|
|
71
|
-
import * as THREE from "three";
|
|
72
|
-
import { detectTier } from "./controllers/quality/tier.ts";
|
|
73
|
-
import { loadTextureWithFallback } from "./controllers/quality/pick-asset.ts";
|
|
74
|
-
|
|
75
|
-
// the URL `npx genex skybox` printed (R2 sends CORS headers, so cross-origin works):
|
|
76
|
-
const SKYBOX_URL = "https://assets.genex.technology/generations/<id>/skybox-equirect";
|
|
77
|
-
const tier = detectTier(); // reuse the boot tier if you already have it
|
|
78
|
-
const texture = await loadTextureWithFallback(SKYBOX_URL, tier, (u) =>
|
|
79
|
-
new THREE.TextureLoader().loadAsync(u),
|
|
80
|
-
);
|
|
81
|
-
texture.mapping = THREE.EquirectangularReflectionMapping;
|
|
82
|
-
texture.colorSpace = THREE.SRGBColorSpace;
|
|
83
|
-
|
|
84
|
-
scene.background = texture; // visible sky
|
|
85
|
-
scene.environment = texture; // image-based lighting on PBR materials
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
Desktop gets the original; phones get the `@2048`/`@4096` rung; a missing rung
|
|
89
|
-
falls back to the original automatically — never a broken boot.
|
|
90
|
-
|
|
91
|
-
For sharper reflections/lighting, pre-filter it with `PMREMGenerator`:
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
const pmrem = new THREE.PMREMGenerator(renderer);
|
|
95
|
-
const envMap = pmrem.fromEquirectangular(texture).texture;
|
|
96
|
-
scene.environment = envMap;
|
|
97
|
-
scene.background = texture; // keep the raw texture for the visible sky
|
|
98
|
-
// Do NOT dispose `texture` here — it IS the visible background. Dispose it only
|
|
99
|
-
// if you later stop using it as the sky.
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
## Publish checklist
|
|
103
|
-
|
|
104
|
-
- Load it from the **URL** the command printed — absolute and permanent, so it resolves
|
|
105
|
-
the same in local dev, the published game, and remixes. Nothing to commit.
|
|
106
|
-
- Don't copy the image into `public/assets/` — generated assets live in R2, not the repo.
|
|
107
|
-
|
|
108
|
-
## Options
|
|
109
|
-
|
|
110
|
-
- `--raw` — send the prompt exactly as written, skipping the appended
|
|
111
|
-
environment-only guard (for the rare sky that must carry content).
|
|
112
|
-
- `--no-wait` — enqueue and return immediately with the generation id; pick
|
|
113
|
-
the result up later with `npx genex wait <id>` (safe to re-run — it attaches
|
|
114
|
-
to the SAME generation).
|
|
115
|
-
- `--api-url <url>` — override the API base (local dev).
|
|
116
|
-
|
|
117
|
-
## Troubleshooting
|
|
118
|
-
|
|
119
|
-
- **"Not authorized"** — run `npx @genex-ai/cli-demo@dev init` first (it writes your `GENEX_TOKEN`).
|
|
120
|
-
- **"Out of credits" (`insufficient_credits`)** — the account has no credits left for
|
|
121
|
-
this skybox generation. Tell the user the facts the CLI printed: their balance, this
|
|
122
|
-
generation's cost, and when their credits refill. Then offer to continue the build
|
|
123
|
-
with a procedurally-coded placeholder (a gradient/procedural sky or a plain
|
|
124
|
-
`scene.background` color) and mark the spot with
|
|
125
|
-
`// TODO(genex): regenerate when credits refill` so the real asset is one command
|
|
126
|
-
away later. Do not stop the session over this.
|
|
127
|
-
- **"Email not verified" (`email_verification_required`)** — generation credits
|
|
128
|
-
unlock after the account's email is verified. Give the user the verify link the
|
|
129
|
-
CLI printed, wait for them to confirm, then re-run the command.
|
|
130
|
-
- **Sky looks too dark/bright** — adjust `renderer.toneMappingExposure`, or scale
|
|
131
|
-
`scene.environment` influence via material `envMapIntensity`.
|
|
132
|
-
- **Seam/pole artifacts** — that's inherent to equirect images; keep the camera
|
|
133
|
-
away from looking straight up/down, or use PMREM for the lighting.
|