effect-motion 0.5.0 → 0.6.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 CHANGED
@@ -9,7 +9,7 @@ A scene is an Effect generator program: instantiate entities, then tween or spri
9
9
  `effect` is a peer dependency — install it alongside:
10
10
 
11
11
  ```bash
12
- pnpm add effect-motion effect
12
+ bun add effect-motion effect
13
13
  ```
14
14
 
15
15
  ## Write a scene
package/dist/Entity.d.ts CHANGED
@@ -45,12 +45,12 @@ export declare const vec3: (input: {
45
45
  readonly x?: number;
46
46
  readonly y?: number;
47
47
  readonly z?: number;
48
- }, options?: Schema.MakeOptions) => Schema.Struct.ReadonlySide<{
49
- readonly _tag: Schema.tag<"Vec3">;
50
- readonly x: Schema.withConstructorDefault<Schema.Number>;
51
- readonly y: Schema.withConstructorDefault<Schema.Number>;
52
- readonly z: Schema.withConstructorDefault<Schema.Number>;
53
- }, "Type">;
48
+ }, options?: Schema.MakeOptions) => {
49
+ readonly _tag: "Vec3";
50
+ readonly x: number;
51
+ readonly y: number;
52
+ readonly z: number;
53
+ };
54
54
  export declare const PathCommand: Schema.TaggedUnion<{
55
55
  readonly L: Schema.TaggedStruct<"L", {
56
56
  x: Schema.Number;
@@ -362,9 +362,19 @@ export declare const Image: Schema.TaggedStruct<"Image", {
362
362
  * that world point and any explicit `rotation` composes on top of the aim.
363
363
  * The `Camera` module's helpers are the ergonomic way to drive it.
364
364
  *
365
- * `aperture` and `focusDistance` describe depth of field. They are carried
366
- * on the frame but currently have NO visual effect — depth-of-field
367
- * rendering is not implemented, and every frame renders sharp.
365
+ * `aperture` and `focusDistance` drive depth of field. `focusDistance` is
366
+ * the view-space distance to the sharp plane (the runner defaults it to the
367
+ * resting distance, so `z = 0` is in focus). `aperture` is the lens radius in
368
+ * world units; 0 (the default) is a pinhole and bypasses DoF entirely. A
369
+ * point at view distance d blurs to a disc of radius
370
+ * `aperture · |d − focusDistance| / d` world units on the focus plane — at
371
+ * rest, where one world unit is one pixel on that plane, that is its blur
372
+ * radius in pixels. Rack focus is a plain tween of `focusDistance`.
373
+ *
374
+ * Limits: blur is computed from the depth buffer, so it is correct for
375
+ * opaque shapes only — a semi-transparent shape blurs at its own depth, not
376
+ * what shows through it. Perspective cameras only. DoF roughly doubles the
377
+ * scene's draw cost (the scene renders twice per frame).
368
378
  */
369
379
  export declare const Camera: Schema.TaggedStruct<"Camera", {
370
380
  readonly position: Schema.withConstructorDefault<Schema.TaggedStruct<"Vec3", {
package/dist/Entity.js CHANGED
@@ -230,9 +230,19 @@ export const Image = Schema.TaggedStruct("Image", {
230
230
  * that world point and any explicit `rotation` composes on top of the aim.
231
231
  * The `Camera` module's helpers are the ergonomic way to drive it.
232
232
  *
233
- * `aperture` and `focusDistance` describe depth of field. They are carried
234
- * on the frame but currently have NO visual effect — depth-of-field
235
- * rendering is not implemented, and every frame renders sharp.
233
+ * `aperture` and `focusDistance` drive depth of field. `focusDistance` is
234
+ * the view-space distance to the sharp plane (the runner defaults it to the
235
+ * resting distance, so `z = 0` is in focus). `aperture` is the lens radius in
236
+ * world units; 0 (the default) is a pinhole and bypasses DoF entirely. A
237
+ * point at view distance d blurs to a disc of radius
238
+ * `aperture · |d − focusDistance| / d` world units on the focus plane — at
239
+ * rest, where one world unit is one pixel on that plane, that is its blur
240
+ * radius in pixels. Rack focus is a plain tween of `focusDistance`.
241
+ *
242
+ * Limits: blur is computed from the depth buffer, so it is correct for
243
+ * opaque shapes only — a semi-transparent shape blurs at its own depth, not
244
+ * what shows through it. Perspective cameras only. DoF roughly doubles the
245
+ * scene's draw cost (the scene renders twice per frame).
236
246
  */
237
247
  export const Camera = Schema.TaggedStruct("Camera", {
238
248
  ...transformMixin,
@@ -35,19 +35,18 @@ export interface CameraView {
35
35
  readonly rotZ: number;
36
36
  readonly focalLength: number;
37
37
  /**
38
- * View-space distance to the intended sharp plane. Runner-filled to the
39
- * resting camera distance.
40
- *
41
- * @remarks
42
- * Currently inert: depth-of-field rendering is not implemented, so every
43
- * frame renders sharp regardless of this value.
38
+ * View-space distance to the sharp plane, world units. Runner-filled to
39
+ * the resting camera distance.
44
40
  */
45
41
  readonly focusDistance: number;
46
42
  /**
47
- * Intended depth-of-field blur strength; 0 is a pinhole.
43
+ * Lens radius in world units; 0 is a pinhole and bypasses depth of field.
48
44
  *
49
45
  * @remarks
50
- * Currently inert — see {@link CameraView.focusDistance}.
46
+ * Thin-lens circle of confusion: a point at view distance d blurs to
47
+ * radius `aperture · |d − focusDistance| / d` world units on the focus
48
+ * plane. Opaque shapes only (semi-transparent ones blur at their own
49
+ * depth); perspective only; roughly doubles the scene's draw cost.
51
50
  */
52
51
  readonly aperture: number;
53
52
  }