@aethervtt/shard-render 0.1.0 → 0.2.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/dist/ablation.d.ts +74 -0
- package/dist/ablation.js +117 -0
- package/dist/atmosphere-nodes.js +100 -12
- package/dist/atmosphere-shaders.js +17 -5
- package/dist/baseline/exposure.d.ts +1 -1
- package/dist/baseline/exposure.js +18 -5
- package/dist/crowd.d.ts +21 -0
- package/dist/crowd.js +121 -0
- package/dist/decals-plugin.d.ts +5 -0
- package/dist/decals-plugin.js +54 -0
- package/dist/decals.d.ts +69 -0
- package/dist/decals.js +326 -0
- package/dist/deferred.js +4 -1
- package/dist/display-nodes.js +24 -11
- package/dist/foliage-budget.d.ts +64 -0
- package/dist/foliage-budget.js +108 -0
- package/dist/foliage-path.d.ts +19 -0
- package/dist/foliage-path.js +7 -0
- package/dist/foliage-shaders.d.ts +11 -0
- package/dist/foliage-shaders.js +504 -0
- package/dist/foliage.d.ts +194 -0
- package/dist/foliage.js +1027 -0
- package/dist/forward.js +26 -2
- package/dist/graph.d.ts +34 -0
- package/dist/graph.js +139 -14
- package/dist/index.d.ts +11 -1
- package/dist/index.js +57 -0
- package/dist/overlay-registry.d.ts +3 -1
- package/dist/overlay-registry.js +3 -1
- package/dist/overlays.js +5 -2
- package/dist/perf-overlay.d.ts +9 -0
- package/dist/perf-overlay.js +125 -0
- package/dist/plugin.d.ts +11 -1
- package/dist/plugin.js +33 -2
- package/dist/post-common.d.ts +20 -2
- package/dist/post-common.js +79 -2
- package/dist/post-nodes.d.ts +5 -0
- package/dist/post-nodes.js +136 -104
- package/dist/post-scene.d.ts +130 -0
- package/dist/post-scene.js +164 -0
- package/dist/post-shaders.js +41 -63
- package/dist/post.js +11 -1
- package/dist/ribbons-plugin.d.ts +5 -0
- package/dist/ribbons-plugin.js +59 -0
- package/dist/ribbons.d.ts +44 -0
- package/dist/ribbons.js +288 -0
- package/dist/scenario.d.ts +70 -0
- package/dist/scenario.js +125 -0
- package/dist/shaders.js +58 -5
- package/dist/shadows.d.ts +2 -1
- package/dist/shadows.js +3 -1
- package/dist/standard.js +6 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.js +6 -0
- package/dist/timer.d.ts +16 -1
- package/dist/timer.js +66 -19
- package/dist/vfx-draw.d.ts +37 -0
- package/dist/vfx-draw.js +291 -0
- package/dist/vfx-state.d.ts +42 -0
- package/dist/vfx-state.js +81 -0
- package/dist/vfx.d.ts +69 -0
- package/dist/vfx.js +103 -0
- package/package.json +19 -11
package/dist/vfx.d.ts
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { type World } from '@aethervtt/shard-core';
|
|
2
|
+
export declare const Trail: import("@aethervtt/shard-core").ComponentDef<{
|
|
3
|
+
readonly playing: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
4
|
+
readonly paused: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
5
|
+
readonly opacity: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
6
|
+
readonly color: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Color, "f32">;
|
|
7
|
+
readonly texture: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").AssetRef<"Texture"> | null, "object">;
|
|
8
|
+
readonly blend: import("@aethervtt/shard-core").FieldType<"additive" | "alpha", "u8">;
|
|
9
|
+
readonly layers: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
10
|
+
readonly width: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
11
|
+
readonly endColor: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Color, "f32">;
|
|
12
|
+
readonly widthCurve: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").InferFields<{
|
|
13
|
+
at: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
14
|
+
value: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
15
|
+
}>[], "object">;
|
|
16
|
+
readonly repeat: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
17
|
+
readonly scroll: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
18
|
+
readonly offset: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Vec3, "f32">;
|
|
19
|
+
readonly lifetime: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
20
|
+
readonly capacity: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
21
|
+
readonly minDistance: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
22
|
+
readonly breakDistance: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
23
|
+
}>;
|
|
24
|
+
export declare const Beam: import("@aethervtt/shard-core").ComponentDef<{
|
|
25
|
+
readonly playing: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
26
|
+
readonly paused: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
27
|
+
readonly opacity: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
28
|
+
readonly color: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Color, "f32">;
|
|
29
|
+
readonly texture: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").AssetRef<"Texture"> | null, "object">;
|
|
30
|
+
readonly blend: import("@aethervtt/shard-core").FieldType<"additive" | "alpha", "u8">;
|
|
31
|
+
readonly layers: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
32
|
+
readonly width: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
33
|
+
readonly endColor: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Color, "f32">;
|
|
34
|
+
readonly widthCurve: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").InferFields<{
|
|
35
|
+
at: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
36
|
+
value: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
37
|
+
}>[], "object">;
|
|
38
|
+
readonly repeat: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
39
|
+
readonly scroll: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
40
|
+
readonly start: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Vec3, "f32">;
|
|
41
|
+
readonly end: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Vec3, "f32">;
|
|
42
|
+
readonly target: import("@aethervtt/shard-core").FieldType<number | null, "f64">;
|
|
43
|
+
readonly points: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Vec3[], "object">;
|
|
44
|
+
readonly segments: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
45
|
+
readonly noise: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
46
|
+
readonly seed: import("@aethervtt/shard-core").FieldType<number, "u32">;
|
|
47
|
+
}>;
|
|
48
|
+
export declare const Decal: import("@aethervtt/shard-core").ComponentDef<{
|
|
49
|
+
readonly playing: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
50
|
+
readonly paused: import("@aethervtt/shard-core").FieldType<boolean, "u8">;
|
|
51
|
+
readonly opacity: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
52
|
+
readonly color: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Color, "f32">;
|
|
53
|
+
readonly texture: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").AssetRef<"Texture"> | null, "object">;
|
|
54
|
+
readonly blend: import("@aethervtt/shard-core").FieldType<"additive" | "alpha", "u8">;
|
|
55
|
+
readonly layers: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
56
|
+
readonly size: import("@aethervtt/shard-core").FieldType<import("@aethervtt/shard-core").Vec3, "f32">;
|
|
57
|
+
readonly receiverMask: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
58
|
+
readonly maxAngle: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
59
|
+
readonly offset: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
60
|
+
readonly lifetime: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
61
|
+
readonly fadeOut: import("@aethervtt/shard-core").FieldType<number, "f32">;
|
|
62
|
+
readonly maxVertices: import("@aethervtt/shard-core").FieldType<number, "u32">;
|
|
63
|
+
}>;
|
|
64
|
+
export declare const DecalReceiver: import("@aethervtt/shard-core").ComponentDef<{
|
|
65
|
+
readonly mask: import("@aethervtt/shard-core").FieldType<number, "u16">;
|
|
66
|
+
}>;
|
|
67
|
+
export declare const RibbonsPath: import("@aethervtt/shard-core").ResourceDef<boolean>;
|
|
68
|
+
export declare const DecalsPath: import("@aethervtt/shard-core").ResourceDef<boolean>;
|
|
69
|
+
export declare function observeVfxWithoutPlugin(world: World): void;
|
package/dist/vfx.js
ADDED
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { defineComponent, defineResource, onAdd, t } from "@aethervtt/shard-core";
|
|
2
|
+
import { Transform } from "@aethervtt/shard-transform";
|
|
3
|
+
import { warnFeatureMissing } from "./features.js";
|
|
4
|
+
const presentation = {
|
|
5
|
+
playing: t.bool({ default: true }),
|
|
6
|
+
paused: t.bool(),
|
|
7
|
+
opacity: t.f32({ default: 1, min: 0, max: 1 }),
|
|
8
|
+
color: t.color({ default: [1, 1, 1, 1] }),
|
|
9
|
+
texture: t.handle("Texture"),
|
|
10
|
+
blend: t.enum(["alpha", "additive"]),
|
|
11
|
+
layers: t.u16({ default: 1 })
|
|
12
|
+
};
|
|
13
|
+
const ribbon = {
|
|
14
|
+
...presentation,
|
|
15
|
+
width: t.f32({ default: 0.1, min: 0, max: 1e3 }),
|
|
16
|
+
endColor: t.color({ default: [1, 1, 1, 0] }),
|
|
17
|
+
widthCurve: t.list(
|
|
18
|
+
t.struct({ at: t.f32({ min: 0, max: 1 }), value: t.f32({ min: 0, max: 16 }) })
|
|
19
|
+
),
|
|
20
|
+
repeat: t.f32({ default: 1, min: 1e-4, max: 1e4 }),
|
|
21
|
+
scroll: t.f32({ min: -1e4, max: 1e4 })
|
|
22
|
+
};
|
|
23
|
+
const Trail = defineComponent(
|
|
24
|
+
"render/Trail",
|
|
25
|
+
{
|
|
26
|
+
...ribbon,
|
|
27
|
+
offset: t.vec3(),
|
|
28
|
+
lifetime: t.f32({ default: 0.5, min: 1e-3, max: 3600 }),
|
|
29
|
+
capacity: t.u16({ default: 64, min: 2, max: 256 }),
|
|
30
|
+
minDistance: t.f32({ default: 0.01, min: 1e-5, max: 1e3 }),
|
|
31
|
+
breakDistance: t.f32({ default: 10, min: 1e-3, max: 1e6 })
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
requires: [Transform],
|
|
35
|
+
description: "World-space ribbon history of this entity/bone; stops emitting when playing is false and drains by lifetime (0082)."
|
|
36
|
+
}
|
|
37
|
+
);
|
|
38
|
+
const Beam = defineComponent(
|
|
39
|
+
"render/Beam",
|
|
40
|
+
{
|
|
41
|
+
...ribbon,
|
|
42
|
+
start: t.vec3(),
|
|
43
|
+
end: t.vec3({ default: [0, 0, -1] }),
|
|
44
|
+
target: t.entity(),
|
|
45
|
+
points: t.list(t.vec3()),
|
|
46
|
+
segments: t.u16({ default: 16, min: 1, max: 255 }),
|
|
47
|
+
noise: t.f32({ min: 0, max: 1e3 }),
|
|
48
|
+
seed: t.u32()
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
requires: [Transform],
|
|
52
|
+
description: "Camera-facing beam between transformed endpoints, or along local points; deterministic seeded displacement (0082)."
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
const Decal = defineComponent(
|
|
56
|
+
"render/Decal",
|
|
57
|
+
{
|
|
58
|
+
...presentation,
|
|
59
|
+
size: t.vec3({ default: [1, 1, 1] }),
|
|
60
|
+
receiverMask: t.u16({ default: 1 }),
|
|
61
|
+
maxAngle: t.f32({ default: 80, min: 0, max: 89.9 }),
|
|
62
|
+
offset: t.f32({ default: 2e-3, min: 0, max: 1 }),
|
|
63
|
+
lifetime: t.f32({ min: 0, max: 86400 }),
|
|
64
|
+
fadeOut: t.f32({ default: 1, min: 0, max: 86400 }),
|
|
65
|
+
maxVertices: t.u32({ default: 12288, min: 3, max: 65535 })
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
requires: [Transform],
|
|
69
|
+
description: "Box projection onto DecalReceiver rigid meshes: local XY is UV, projection along -Z. Zero lifetime persists (0083)."
|
|
70
|
+
}
|
|
71
|
+
);
|
|
72
|
+
const DecalReceiver = defineComponent(
|
|
73
|
+
"render/DecalReceiver",
|
|
74
|
+
{
|
|
75
|
+
mask: t.u16({ default: 1 })
|
|
76
|
+
},
|
|
77
|
+
{ description: "Eligible rigid Mesh3d surface for matching decal receiver masks (0083)." }
|
|
78
|
+
);
|
|
79
|
+
const RibbonsPath = defineResource("render/RibbonsPath", { init: () => true });
|
|
80
|
+
const DecalsPath = defineResource("render/DecalsPath", { init: () => true });
|
|
81
|
+
function observeVfxWithoutPlugin(world) {
|
|
82
|
+
world.observe(onAdd(Trail), ({ world: w }) => {
|
|
83
|
+
if (!w.hasResource(RibbonsPath))
|
|
84
|
+
warnFeatureMissing(w, "Trail", "ribbonsPlugin", "it draws no ribbon");
|
|
85
|
+
});
|
|
86
|
+
world.observe(onAdd(Beam), ({ world: w }) => {
|
|
87
|
+
if (!w.hasResource(RibbonsPath))
|
|
88
|
+
warnFeatureMissing(w, "Beam", "ribbonsPlugin", "it draws no ribbon");
|
|
89
|
+
});
|
|
90
|
+
world.observe(onAdd(Decal), ({ world: w }) => {
|
|
91
|
+
if (!w.hasResource(DecalsPath))
|
|
92
|
+
warnFeatureMissing(w, "Decal", "decalsPlugin", "it draws no decal");
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
export {
|
|
96
|
+
Beam,
|
|
97
|
+
Decal,
|
|
98
|
+
DecalReceiver,
|
|
99
|
+
DecalsPath,
|
|
100
|
+
RibbonsPath,
|
|
101
|
+
Trail,
|
|
102
|
+
observeVfxWithoutPlugin
|
|
103
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aethervtt/shard-render",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -9,6 +9,14 @@
|
|
|
9
9
|
"types": "./dist/index.d.ts",
|
|
10
10
|
"default": "./dist/index.js"
|
|
11
11
|
},
|
|
12
|
+
"./crowd": {
|
|
13
|
+
"types": "./dist/crowd.d.ts",
|
|
14
|
+
"default": "./dist/crowd.js"
|
|
15
|
+
},
|
|
16
|
+
"./post-scene": {
|
|
17
|
+
"types": "./dist/post-scene.d.ts",
|
|
18
|
+
"default": "./dist/post-scene.js"
|
|
19
|
+
},
|
|
12
20
|
"./testing": {
|
|
13
21
|
"types": "./dist/testing.d.ts",
|
|
14
22
|
"default": "./dist/testing.js"
|
|
@@ -28,15 +36,15 @@
|
|
|
28
36
|
"README.md"
|
|
29
37
|
],
|
|
30
38
|
"dependencies": {
|
|
31
|
-
"@aethervtt/shard-assets": "0.
|
|
32
|
-
"@aethervtt/shard-core": "0.
|
|
33
|
-
"@aethervtt/shard-gpu": "0.
|
|
34
|
-
"@aethervtt/shard-mesh": "0.
|
|
35
|
-
"@aethervtt/shard-noise": "0.
|
|
36
|
-
"@aethervtt/shard-runtime": "0.
|
|
37
|
-
"@aethervtt/shard-shader": "0.
|
|
38
|
-
"@aethervtt/shard-texture": "0.
|
|
39
|
-
"@aethervtt/shard-transform": "0.
|
|
39
|
+
"@aethervtt/shard-assets": "0.2.0",
|
|
40
|
+
"@aethervtt/shard-core": "0.2.0",
|
|
41
|
+
"@aethervtt/shard-gpu": "0.2.0",
|
|
42
|
+
"@aethervtt/shard-mesh": "0.2.0",
|
|
43
|
+
"@aethervtt/shard-noise": "0.2.0",
|
|
44
|
+
"@aethervtt/shard-runtime": "0.2.0",
|
|
45
|
+
"@aethervtt/shard-shader": "0.2.0",
|
|
46
|
+
"@aethervtt/shard-texture": "0.2.0",
|
|
47
|
+
"@aethervtt/shard-transform": "0.2.0"
|
|
40
48
|
},
|
|
41
49
|
"repository": {
|
|
42
50
|
"type": "git",
|
|
@@ -48,6 +56,6 @@
|
|
|
48
56
|
"provenance": true
|
|
49
57
|
},
|
|
50
58
|
"shard": {
|
|
51
|
-
"buildSha": "
|
|
59
|
+
"buildSha": "32c22a3944ed23f5d1baa90bf7cc9fae724f5fd8"
|
|
52
60
|
}
|
|
53
61
|
}
|