dewctl 0.14.0 → 0.15.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.
@@ -110,11 +110,12 @@ 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). Give each light its real brightness: a sun in lux, a sky light and a glow in nits, a lamp in candela.
113
+ small sun). Give each light its real brightness, with `renderer.physicalLights = true`: a sun in lux, a sky
114
+ light and a glow in nits, a lamp in candela.
114
115
  Default: the recipe's ([lights and materials](https://alpha.dewdrop.world/docs/lighting)).
115
116
  - **How dark.** For a night or an indoor look: "can the player see the whole room, or only what the light
116
117
  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
+ day; a fixed exposure (`ev`) chooses exactly how dark. Only what the light reaches means `shadowLift` at 0
118
119
  and lights placed where the player should look
119
120
  ([exposure and tone](https://alpha.dewdrop.world/docs/lighting#exposure-and-tone)). Default: Dewdrop's own
120
121
  exposure.
@@ -206,7 +207,7 @@ nothing that has a description of its own.)
206
207
  | ... | | | | |
207
208
 
208
209
  Exposure: Dewdrop's own (`renderer.exposure = null`), or the settings and why (a fixed `ev`, a
209
- `compensationCurve`, `localShadowsEv`).
210
+ `compensationCurve`, `shadowLift`).
210
211
 
211
212
  ## Palette
212
213
 
@@ -267,7 +268,9 @@ and [lights and materials](https://alpha.dewdrop.world/docs/lighting) each light
267
268
  | glass, water, ice | a transparent material with `userData.modelLayer = 'surface'`, described as the surface |
268
269
  | wet ground, reflections | the ground at low `roughness`, which shows the lights in it, and "wet" in its words |
269
270
  | 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 `DewMaterial` whose WGSL program moves the vertices every frame, drawn in its one `color` ([moving vertices](https://alpha.dewdrop.world/docs/vertex)) |
271
+ | grass in the wind, a waving flag, a swell on the water | a `DewMaterial` whose WGSL `vertex` function moves the vertices every frame ([moving vertices](https://alpha.dewdrop.world/docs/vertex)) |
272
+ | a picture on a moving mesh, grass of many greens, a pulsing sign | the same file's `fragment` function, which colors each pixel of the surface ([coloring a surface](https://alpha.dewdrop.world/docs/fragment)) |
273
+ | a color grade, darkened corners, a hit flash | a `ScreenProgram` whose `output` function changes the final picture ([screen effects](https://alpha.dewdrop.world/docs/screen)) |
271
274
  | shadows | every light casts them; a softer edge from a larger `userData.angle` on the sun |
272
275
  | a sign you can read | the letters built as meshes or in the sign's texture; a sign only described shows no word |
273
276
  | big clouds | white spheres stacked into towers about 1 km or more away, described as a cloud |
@@ -37,8 +37,9 @@ Dewdrop lights the three.js scene, then draws every frame in the game's style
37
37
  `renderer.backgroundDescription`, the sky, with a matching `scene.background` color
38
38
  ([prompt and descriptions](https://alpha.dewdrop.world/docs/prompting)).
39
39
 
40
- `scene.fog`, lines (`Line`, `LineSegments`, `LineLoop`), render targets and post-processing don't show. A
41
- `ShaderMaterial`'s shaders don't run (to move vertices, use a `DewMaterial`, below), and `RectAreaLight` and `scene.environment` light nothing. Sprites, points and
40
+ `scene.fog`, lines (`Line`, `LineSegments`, `LineLoop`), render targets and post-processing don't show (for an
41
+ effect over the final picture, use a `ScreenProgram`, below). A `ShaderMaterial`'s shaders don't run (for a shader
42
+ of your own, use a `DewMaterial`, below), and `RectAreaLight` and `scene.environment` light nothing. Sprites, points and
42
43
  transparent materials draw as glows. The prompt is at most 4 KiB, the background description and each description
43
44
  at most 1 KiB. A scene draws at most 65,536 objects (each mesh counts once, and so does each instance), and holds
44
45
  up to 4,096 lights and 4,096 textures ([what works](https://alpha.dewdrop.world/docs/limits#the-look)).
@@ -57,12 +58,13 @@ Light and color ([lights and materials](https://alpha.dewdrop.world/docs/lightin
57
58
  `castShadow` needed, and light bounces. A scene with no light shows every surface evenly at its own color; once
58
59
  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
60
  as a sun.
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.
61
+ - **Light is in real units once `renderer.physicalLights = true`,** which a new game sets; without it, intensities
62
+ are three.js's own, where 1 is an ordinary light, and none of the numbers here hold. A sun's `color` times its
63
+ `intensity` is lux (the noon sun about 100,000, an overcast day 10,000, the full moon 0.1); a sky light's is nits
64
+ (a clear day's sky a few thousand, a night sky under 0.01); a lamp's is candela (a candle about 1, a 60 W bulb
65
+ about 70), falling off with the square of the distance, its `distance` and `decay` not read. Set each light as
66
+ bright as its real counterpart: the exposure adapts as a camera does, and keeps a night darker than a day. A sun's
67
+ `userData.angle` softens its shadows: 0.02 to 0.05 gives a hazy sun.
66
68
  - **The sky's color is a brightness too:** `scene.background` in nits, such as
67
69
  `new THREE.Color('#8ec5ff').multiplyScalar(12000)` for a clear day's sky, about 6,000 nits. A plain hex color is
68
70
  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
@@ -70,8 +72,8 @@ Light and color ([lights and materials](https://alpha.dewdrop.world/docs/lightin
70
72
  - **Night is dim light, not dark colors.** Keep the materials' everyday colors and turn the lights down to a
71
73
  night's. To choose exactly how dark, fix the exposure: `renderer.exposure = { ev: 2 }`, in EV100, each step up
72
74
  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)).
75
+ `compensation`, `compensationCurve`, `up`, `down`, `highlightCompression`, `shadowLift`, `contrast` and
76
+ `saturation` ([exposure and tone](https://alpha.dewdrop.world/docs/lighting#exposure-and-tone)).
75
77
  - **A glowing thing is a mesh that glows:** a lamp, a candle flame, a lit window or neon is a material's
76
78
  `emissive` times its `emissiveIntensity`, its brightness in nits (a candle flame about 10,000, a lit screen
77
79
  100), and it lights what's around it, so a candle can light a dark room by itself. Only an opaque mesh with a
@@ -102,12 +104,20 @@ Shapes ([shapes](https://alpha.dewdrop.world/docs/renderer#shapes)):
102
104
  - **Small moving things lose their shape.** Make what matters large in frame. Fish, flocks and sparks: muted,
103
105
  about 0.6 m long or more, 8 m or more from the camera
104
106
  ([what to watch for](https://alpha.dewdrop.world/docs/renderer#what-to-watch-for)).
105
- - **Moving vertices is a `DewMaterial`:** 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 `module` of a
107
- `THREE.DewMaterial` with a `maxDisplacement` (0 unless set, which holds every vertex still) and its numbers as
108
- `params`; the mesh is drawn in the material's `color`, with no map. Set `renderer.programTime` from the game's
109
- clock every frame for its `time()`, and `paramsNeedUpdate = true` after changing `params`. `vite build` names the
110
- line of a program Dewdrop can't run ([moving vertices](https://alpha.dewdrop.world/docs/vertex)).
107
+ - **A shader of your own is a `.wgsl` file,** imported and given as the `module` of a `THREE.DewMaterial`. In it,
108
+ `fn vertex(v: Vertex) -> Moved` moves the mesh's vertices every frame (grass in the wind, a waving flag, a swell
109
+ on the water), and needs a `maxDisplacement` (0 unless set, which holds every vertex still); `fn fragment(p:
110
+ Point) -> Surface` colors each pixel of its surface (a flag's picture from `texture0(p.uv)` and the material's
111
+ `textures`, each grass blade's own green from `tint()`, a glow, a finish with `shade: 'standard'`). A file may
112
+ hold either or both; without `fragment` the mesh is drawn in the material's one `color`. Its numbers are `params`,
113
+ read with `param(i)`: set `paramsNeedUpdate = true` after changing them, and `renderer.programTime` from the
114
+ game's clock every frame for `time()`. `vite build` names the line of a program Dewdrop can't run ([moving
115
+ vertices](https://alpha.dewdrop.world/docs/vertex), [coloring a
116
+ surface](https://alpha.dewdrop.world/docs/fragment)).
117
+ - **An effect over the final picture is a `ScreenProgram`:** a grade, darkened corners, a flash, a blur. Write `fn
118
+ output(p: Pixel) -> vec3f` alone in a `.wgsl` file, import it, and add `new THREE.ScreenProgram({ module, stage:
119
+ 'output', params })` to the scene; always set `stage: 'output'`. Keep it short: it runs for every pixel of every
120
+ frame ([screen effects](https://alpha.dewdrop.world/docs/screen)).
111
121
  - **Atmosphere is words.** Haze, mist, rain and god rays go in the prompt's scene sentence.
112
122
 
113
123
  Words ([prompt and descriptions](https://alpha.dewdrop.world/docs/prompting)):
@@ -5,7 +5,9 @@ const scene=new THREE.Scene();
5
5
  const camera=new THREE.PerspectiveCamera(55,innerWidth/innerHeight,0.1,100);
6
6
  camera.position.set(0,0,5);
7
7
  const renderer=new THREE.WebGLRenderer();
8
- // On Dewdrop, the style of your whole game: a medium with its light, then the scene…
8
+ // On Dewdrop, this puts lights, glows and the sky's color in real units (lux, candela, nits)…
9
+ renderer.physicalLights=true;
10
+ // …the style of your whole game: a medium with its light, then the scene…
9
11
  renderer.prompt='style: Clean stylized 3D game render with soft studio lighting. A minimal studio scene, eye-level view, centered framing.';
10
12
  // …the sky, its color and brightness in nits, and in words…
11
13
  scene.background=new THREE.Color('#142232').multiplyScalar(10000);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dewctl",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "Build and publish three.js games on Dewdrop.",
5
5
  "license": "MIT",
6
6
  "type": "module",
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.13.0';
183
+ const SDK_RANGE='^0.14.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:'ec04fda6fce1cfd83f053fa5bf0e2dd93eff6190'};
187
+ const STARTERS={repo:'DewdropLabs/starter-templates',commit:'3e8f03d7fe10a60cad643d5bf1b79b291d4be7cd'};
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'],