dewctl 0.11.0 → 0.12.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/examples/.agents/skills/look/SKILL.md +15 -11
- package/examples/AGENTS.md +27 -11
- package/examples/starter/src/main.js +7 -5
- package/package.json +1 -1
- package/src/project.js +2 -2
|
@@ -110,12 +110,14 @@ For each: what to ask, why it changes the build, and what to take when the user
|
|
|
110
110
|
sun is a `DirectionalLight`, the sky a `HemisphereLight`, a lamp a `PointLight` or `SpotLight`, and a candle,
|
|
111
111
|
a lit window, a neon tube or a lantern's shade a mesh that glows, which lights what's near it. Every light casts
|
|
112
112
|
shadows by itself; ask whether they're soft (a hazy sun, `userData.angle` about 0.03) or hard and long (a low,
|
|
113
|
-
small sun).
|
|
113
|
+
small sun). Give each light its real brightness: a sun in lux, a sky light and a glow in nits, a lamp in candela.
|
|
114
|
+
Default: the recipe's ([lights and materials](https://alpha.dewdrop.world/docs/lighting)).
|
|
114
115
|
- **How dark.** For a night or an indoor look: "can the player see the whole room, or only what the light
|
|
115
|
-
reaches?" Night is dim lights over everyday colors,
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
exposure
|
|
116
|
+
reaches?" Night is a night's dim lights over everyday colors, which Dewdrop's own exposure keeps darker than a
|
|
117
|
+
day; a fixed exposure (`ev`) chooses exactly how dark. Only what the light reaches means `localShadowsEv` at 0
|
|
118
|
+
and lights placed where the player should look
|
|
119
|
+
([exposure and tone](https://alpha.dewdrop.world/docs/lighting#exposure-and-tone)). Default: Dewdrop's own
|
|
120
|
+
exposure.
|
|
119
121
|
- **Palette.** Three or four colors by their roles: the ground, the sky, the main built thing, the player or hero.
|
|
120
122
|
Ask in color names and choose the hex yourself. They are the things' everyday colors: the light makes them warm
|
|
121
123
|
or cold, bright or dim. Default: the recipe's colors.
|
|
@@ -193,17 +195,18 @@ nothing that has a description of its own.)
|
|
|
193
195
|
|
|
194
196
|
## Sky
|
|
195
197
|
|
|
196
|
-
`scene.background`: `#8fd0f5
|
|
198
|
+
`scene.background`: `#8fd0f5` at 8,000 nits. `renderer.backgroundDescription`: "plain pale blue studio backdrop".
|
|
197
199
|
|
|
198
200
|
## Light
|
|
199
201
|
|
|
200
202
|
| Light | three.js | Color | Intensity | Where |
|
|
201
203
|
| --- | --- | --- | --- | --- |
|
|
202
|
-
| key | `DirectionalLight`, `userData.angle` 0.05 | `#fff1dc` |
|
|
203
|
-
| sky | `HemisphereLight` | `#cfe8ff` / `#7a6a50` |
|
|
204
|
+
| key | `DirectionalLight`, `userData.angle` 0.05 | `#fff1dc` | 30,000 lux | high, from the left |
|
|
205
|
+
| sky | `HemisphereLight` | `#cfe8ff` / `#7a6a50` | 3,000 nits | |
|
|
204
206
|
| ... | | | | |
|
|
205
207
|
|
|
206
|
-
Exposure: Dewdrop's own (`renderer.exposure = null`), or the
|
|
208
|
+
Exposure: Dewdrop's own (`renderer.exposure = null`), or the settings and why (a fixed `ev`, a
|
|
209
|
+
`compensationCurve`, `localShadowsEv`).
|
|
207
210
|
|
|
208
211
|
## Palette
|
|
209
212
|
|
|
@@ -250,7 +253,7 @@ and [lights and materials](https://alpha.dewdrop.world/docs/lighting) each light
|
|
|
250
253
|
| The user says | You change |
|
|
251
254
|
| --- | --- |
|
|
252
255
|
| softer, dreamier | a hazier sun (`userData.angle` 0.02 to 0.05) and a brighter sky light; paler colors; "soft, diffused" light in the style phrase; fewer small meshes far away |
|
|
253
|
-
| darker, moodier | dimmer lights and a fixed exposure
|
|
256
|
+
| darker, moodier | dimmer lights, the colors kept, and a fixed exposure for an exact darkness; the light words in the style phrase ("dim candlelight", "hard low-key lighting") |
|
|
254
257
|
| a carried candle or torch | a glowing flame mesh moving with the player, which lights what's around it |
|
|
255
258
|
| a lit side and a dark side, long shadows | a low `DirectionalLight` sun with a weaker sky light; a smaller `userData.angle` for harder edges |
|
|
256
259
|
| warmer, colder | the lights' colors: a warm sun and a cool sky, or the other way round |
|
|
@@ -258,12 +261,13 @@ and [lights and materials](https://alpha.dewdrop.world/docs/lighting) each light
|
|
|
258
261
|
| fog, mist, rain, god rays | words in the prompt's scene sentence |
|
|
259
262
|
| smoke, steam, dust | words in the prompt. Sparks and embers are small transparent glowing meshes |
|
|
260
263
|
| wood grain, fabric, rust, any texture | a texture of it as the material's `map`, and the material in the words |
|
|
261
|
-
| glow, neon, fire, a lit window | a mesh with an `emissive` color and `emissiveIntensity
|
|
264
|
+
| glow, neon, fire, a lit window | a mesh with an `emissive` color and `emissiveIntensity` in nits (a flame about 10,000, a lit screen 100), which lights what's near it |
|
|
262
265
|
| a lantern, a frosted globe | the shade or the lantern's windows glow: a light inside a closed shade is hidden by it, but still shines through an open bottom or cut-out holes |
|
|
263
266
|
| shiny, polished, metal | low `roughness`; `metalness` 1 with the metal's own color for metal |
|
|
264
267
|
| glass, water, ice | a transparent material with `userData.modelLayer = 'surface'`, described as the surface |
|
|
265
268
|
| wet ground, reflections | the ground at low `roughness`, which shows the lights in it, and "wet" in its words |
|
|
266
269
|
| leaves, grass, a fence, lace | cards with a cut-out texture and an `alphaTest` |
|
|
270
|
+
| grass in the wind, a waving flag, a swell on the water | a `VertexMaterial` whose WGSL program moves the vertices every frame ([moving vertices](https://alpha.dewdrop.world/docs/vertex)) |
|
|
267
271
|
| shadows | every light casts them; a softer edge from a larger `userData.angle` on the sun |
|
|
268
272
|
| a sign you can read | the letters built as meshes or in the sign's texture; a sign only described shows no word |
|
|
269
273
|
| big clouds | white spheres stacked into towers about 1 km or more away, described as a cloud |
|
package/examples/AGENTS.md
CHANGED
|
@@ -38,7 +38,7 @@ Dewdrop lights the three.js scene, then draws every frame in the game's style
|
|
|
38
38
|
([prompt and descriptions](https://alpha.dewdrop.world/docs/prompting)).
|
|
39
39
|
|
|
40
40
|
`scene.fog`, lines (`Line`, `LineSegments`, `LineLoop`), render targets and post-processing don't show. A
|
|
41
|
-
`ShaderMaterial`'s shaders don't run, and `RectAreaLight` and `scene.environment` light nothing. Sprites, points and
|
|
41
|
+
`ShaderMaterial`'s shaders don't run (to move vertices, use a `VertexMaterial`, below), and `RectAreaLight` and `scene.environment` light nothing. Sprites, points and
|
|
42
42
|
transparent materials draw as glows. The prompt is at most 4 KiB, the background description and each description
|
|
43
43
|
at most 1 KiB. A scene draws at most 65,536 objects (each mesh counts once, and so does each instance), and holds
|
|
44
44
|
up to 4,096 lights and 4,096 textures ([what works](https://alpha.dewdrop.world/docs/limits#the-look)).
|
|
@@ -57,16 +57,27 @@ Light and color ([lights and materials](https://alpha.dewdrop.world/docs/lightin
|
|
|
57
57
|
`castShadow` needed, and light bounces. A scene with no light shows every surface evenly at its own color; once
|
|
58
58
|
the game adds a light or a glowing mesh, only its lights and glowing meshes light it, so give it a sky as well
|
|
59
59
|
as a sun.
|
|
60
|
-
- **
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
- **Light is in real units.** A sun's `color` times its `intensity` is lux (the noon sun about 100,000, an
|
|
61
|
+
overcast day 10,000, the full moon 0.1); a sky light's is nits (a clear day's sky a few thousand, a night sky
|
|
62
|
+
under 0.01); a lamp's is candela (a candle about 1, a 60 W bulb about 70), falling off with the square of the
|
|
63
|
+
distance, its `distance` and `decay` not read. Set each light as bright as its real counterpart: the exposure
|
|
64
|
+
adapts as a camera does, and keeps a night darker than a day. A sun's `userData.angle` softens its shadows:
|
|
65
|
+
0.02 to 0.05 gives a hazy sun.
|
|
66
|
+
- **The sky's color is a brightness too:** `scene.background` in nits, such as
|
|
67
|
+
`new THREE.Color('#8ec5ff').multiplyScalar(12000)` for a clear day's sky, about 6,000 nits. A plain hex color is
|
|
68
|
+
at most 1 nit, a black sky by day. A frame that is mostly sky or backdrop is exposed for it, so a backdrop that must
|
|
69
|
+
stay darker than middle grey wants a fixed exposure, as a studio's camera has.
|
|
70
|
+
- **Night is dim light, not dark colors.** Keep the materials' everyday colors and turn the lights down to a
|
|
71
|
+
night's. To choose exactly how dark, fix the exposure: `renderer.exposure = { ev: 2 }`, in EV100, each step up
|
|
72
|
+
halving the brightness (a street at night about 2, a lit room 7), chosen on Dewdrop. Its other settings are
|
|
73
|
+
`compensationCurve`, `up`, `down`, `shadowContrast`, `highlightContrast`, `localShadowsEv` and
|
|
74
|
+
`localHighlightsEv` ([exposure and tone](https://alpha.dewdrop.world/docs/lighting#exposure-and-tone)).
|
|
65
75
|
- **A glowing thing is a mesh that glows:** a lamp, a candle flame, a lit window or neon is a material's
|
|
66
|
-
`emissive` times its `emissiveIntensity`,
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
lantern, is hidden by it: make the
|
|
76
|
+
`emissive` times its `emissiveIntensity`, its brightness in nits (a candle flame about 10,000, a lit screen
|
|
77
|
+
100), and it lights what's around it, so a candle can light a dark room by itself. Only an opaque mesh with a
|
|
78
|
+
lit material (`MeshStandardMaterial` and the like) lights its surroundings; a transparent one, sprites and
|
|
79
|
+
points glow but light nothing. A light inside a closed shade, such as a paper lantern, is hidden by it: make the
|
|
80
|
+
shade or the lantern's windows glow instead
|
|
70
81
|
([glowing things](https://alpha.dewdrop.world/docs/lighting#glowing-things)).
|
|
71
82
|
- **Give every mesh a material with a color.** `MeshStandardMaterial` takes highlights by its `roughness` (0
|
|
72
83
|
polished to 1 matte) and `metalness`; `MeshBasicMaterial` is unlit. A geometry needs normals to be lit.
|
|
@@ -91,6 +102,11 @@ Shapes ([shapes](https://alpha.dewdrop.world/docs/renderer#shapes)):
|
|
|
91
102
|
- **Small moving things lose their shape.** Make what matters large in frame. Fish, flocks and sparks: muted,
|
|
92
103
|
about 0.6 m long or more, 8 m or more from the camera
|
|
93
104
|
([what to watch for](https://alpha.dewdrop.world/docs/renderer#what-to-watch-for)).
|
|
105
|
+
- **Moving vertices is a `VertexMaterial`:** grass in the wind, a waving flag, a swell on the water. Write
|
|
106
|
+
`fn vertex(v: Vertex) -> Moved` in a `.wgsl` file in `src/`, import it, and give it as the `program` of a
|
|
107
|
+
`VertexMaterial` from `dewdrop-sdk/vertex`, shaded as a standard material; set `renderer.programTime` from the
|
|
108
|
+
game's clock every frame for its `time()`. `vite build` names the line of a program Dewdrop can't run
|
|
109
|
+
([moving vertices](https://alpha.dewdrop.world/docs/vertex)).
|
|
94
110
|
- **Atmosphere is words.** Haze, mist, rain and god rays go in the prompt's scene sentence.
|
|
95
111
|
|
|
96
112
|
Words ([prompt and descriptions](https://alpha.dewdrop.world/docs/prompting)):
|
|
@@ -121,7 +137,7 @@ Words ([prompt and descriptions](https://alpha.dewdrop.world/docs/prompting)):
|
|
|
121
137
|
part's name, `of the` and the character's own description
|
|
122
138
|
([characters and their parts](https://alpha.dewdrop.world/docs/prompting#characters-and-their-parts)).
|
|
123
139
|
- **The sky is the background.** Describe it in `renderer.backgroundDescription`, with a matching `scene.background`
|
|
124
|
-
color. Big clouds are stacked white spheres about 1 km or more away.
|
|
140
|
+
color at the sky's brightness in nits. Big clouds are stacked white spheres about 1 km or more away.
|
|
125
141
|
- **A change of look is a cut**, 0.15 to 0.3 s later, with no blend. Change the prompt, lights, colors and
|
|
126
142
|
descriptions in the same frame ([a change of look](https://alpha.dewdrop.world/docs/renderer#a-change-of-look-is-a-cut)).
|
|
127
143
|
|
|
@@ -7,15 +7,17 @@ camera.position.set(0,0,5);
|
|
|
7
7
|
const renderer=new THREE.WebGLRenderer();
|
|
8
8
|
// On Dewdrop, the style of your whole game: a medium with its light, then the scene…
|
|
9
9
|
renderer.prompt='style: Clean stylized 3D game render with soft studio lighting. A minimal studio scene, eye-level view, centered framing.';
|
|
10
|
-
// …the sky,
|
|
11
|
-
scene.background=new THREE.Color('#142232');
|
|
10
|
+
// …the sky, its color and brightness in nits, and in words…
|
|
11
|
+
scene.background=new THREE.Color('#142232').multiplyScalar(10000);
|
|
12
12
|
renderer.backgroundDescription='plain dark blue studio backdrop';
|
|
13
|
+
// …a fixed exposure, as a studio's camera has…
|
|
14
|
+
renderer.exposure={ev:13};
|
|
13
15
|
renderer.setSize(innerWidth,innerHeight);
|
|
14
16
|
document.body.appendChild(renderer.domElement);
|
|
15
|
-
// …the light: a key light and a soft sky…
|
|
16
|
-
const key=new THREE.DirectionalLight('#fff4e6',
|
|
17
|
+
// …the light, in real units: a key light in lux and a soft sky in nits…
|
|
18
|
+
const key=new THREE.DirectionalLight('#fff4e6',30000);
|
|
17
19
|
key.position.set(3,5,4);
|
|
18
|
-
scene.add(key,new THREE.HemisphereLight('#cfe2ff','#1c2838',
|
|
20
|
+
scene.add(key,new THREE.HemisphereLight('#cfe2ff','#1c2838',3000));
|
|
19
21
|
// …and what each thing is.
|
|
20
22
|
const cube=new THREE.Mesh(new THREE.BoxGeometry(1.5,1.5,1.5),new THREE.MeshStandardMaterial({color:'#4edbb1',roughness:0.35}));
|
|
21
23
|
cube.userData.description='turquoise cube';
|
package/package.json
CHANGED
package/src/project.js
CHANGED
|
@@ -180,11 +180,11 @@ export async function build(project, signal) {
|
|
|
180
180
|
const STARTER_FILES=['package.json','src','index.html','vite.config.js'];
|
|
181
181
|
// The SDK a new game depends on — the range moves with the SDK's minor, since a caret on 0.x stays within one —
|
|
182
182
|
// and this CLI, at its own version.
|
|
183
|
-
const SDK_RANGE='^0.
|
|
183
|
+
const SDK_RANGE='^0.11.0';
|
|
184
184
|
const CLI_RANGE=`^${JSON.parse(readFileSync(new URL('../package.json',import.meta.url),'utf8')).version}`;
|
|
185
185
|
// The games a new one can start from: Blank, which ships with this CLI, and the starter games in the public
|
|
186
186
|
// starter-templates repository, a folder each, at the commit this release pins.
|
|
187
|
-
const STARTERS={repo:'DewdropLabs/starter-templates',commit:'
|
|
187
|
+
const STARTERS={repo:'DewdropLabs/starter-templates',commit:'81bb3cca05bbd547503591539b101bf0e10eba3b'};
|
|
188
188
|
const TEMPLATES={
|
|
189
189
|
blank:['Blank','a cube and a style prompt, the smallest game'],
|
|
190
190
|
'golden-glide':['Golden Glide','flight over golden-hour countryside, in gouache'],
|