phoria2 1.0.0-rc.8 → 1.1.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 +25 -6
- package/dist/bloom.js +4 -4
- package/dist/bloom.js.map +1 -1
- package/dist/charts.js +402 -402
- package/dist/charts.js.map +1 -1
- package/dist/core.js +1672 -1322
- package/dist/core.js.map +1 -1
- package/dist/edit.js +53 -53
- package/dist/edit.js.map +1 -1
- package/dist/explain.js +1 -1
- package/dist/gltf.js +187 -136
- package/dist/gltf.js.map +1 -1
- package/dist/motion.js +28 -28
- package/dist/motion.js.map +1 -1
- package/dist/particles.js +45 -45
- package/dist/particles.js.map +1 -1
- package/dist/passes.js +211 -109
- package/dist/passes.js.map +1 -1
- package/dist/phoria2.js +1 -1
- package/dist/picking.js +23 -28
- package/dist/picking.js.map +1 -1
- package/dist/snapshot.js +1 -1
- package/dist/tooltip.js +1 -1
- package/dist/types/OrbitControl.d.ts +0 -10
- package/dist/types/Raycaster.d.ts +0 -16
- package/dist/types/View.d.ts +5 -8
- package/dist/types/charts/Chart.d.ts +0 -2
- package/dist/types/charts/scales.d.ts +0 -5
- package/dist/types/clip.d.ts +0 -6
- package/dist/types/fog.d.ts +0 -6
- package/dist/types/frame.d.ts +0 -2
- package/dist/types/geometry/Geometry.d.ts +6 -4
- package/dist/types/gltf/Animation.d.ts +0 -4
- package/dist/types/gltf/load.d.ts +6 -0
- package/dist/types/index.d.ts +1 -2
- package/dist/types/material/Material.d.ts +125 -18
- package/dist/types/material/Texture.d.ts +37 -11
- package/dist/types/particles/Emitter.d.ts +0 -4
- package/dist/types/registry.d.ts +0 -2
- package/dist/types/scene/Node.d.ts +13 -40
- package/dist/types/scene/Scene.d.ts +0 -4
- package/dist/types/scene/cameras.d.ts +0 -12
- package/dist/types/scene/drawables.d.ts +0 -42
- package/dist/types/scene/lights.d.ts +0 -38
- package/dist/types/value/Color.d.ts +0 -2
- package/dist/types/value/Euler.d.ts +0 -2
- package/dist/types/value/Quat.d.ts +0 -4
- package/dist/types/value/Vec3.d.ts +0 -7
- package/dist/types/webgl/WebGLRenderer.d.ts +6 -19
- package/dist/types/webgl/passes.d.ts +37 -13
- package/dist/types/webgl/resources.d.ts +24 -2
- package/dist/types/webgl/shaders.d.ts +4 -2
- package/llms-full.txt +155 -9
- package/llms.txt +1 -1
- package/package.json +1 -1
- package/schema/chart.schema.json +1 -1
- package/schema/scene.schema.json +128 -1
- package/src/Raycaster.js +2 -2
- package/src/View.js +6 -4
- package/src/charts/Chart.js +1 -1
- package/src/clip.js +1 -1
- package/src/fog.js +1 -1
- package/src/frame.js +1 -1
- package/src/geometry/Geometry.js +10 -3
- package/src/gltf/Animation.js +1 -1
- package/src/gltf/load.js +59 -6
- package/src/index.js +1 -2
- package/src/material/Material.js +108 -23
- package/src/material/Texture.js +118 -13
- package/src/particles/Emitter.js +2 -2
- package/src/scene/Node.js +20 -5
- package/src/scene/Scene.js +2 -2
- package/src/scene/cameras.js +6 -6
- package/src/scene/drawables.js +14 -12
- package/src/scene/lights.js +19 -19
- package/src/value/Color.js +1 -1
- package/src/value/Euler.js +1 -1
- package/src/value/Quat.js +2 -2
- package/src/value/Vec3.js +1 -1
- package/src/watch.js +19 -0
- package/src/webgl/WebGLRenderer.js +53 -14
- package/src/webgl/passes.js +190 -32
- package/src/webgl/picking.js +0 -1
- package/src/webgl/resources.js +89 -8
- package/src/webgl/shaders.js +350 -48
package/README.md
CHANGED
|
@@ -56,12 +56,12 @@ own). Pin the version so a new release can't change your page:
|
|
|
56
56
|
<script type="importmap">
|
|
57
57
|
{
|
|
58
58
|
"imports": {
|
|
59
|
-
"phoria2": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
60
|
-
"phoria2/charts": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
61
|
-
"phoria2/particles": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
62
|
-
"phoria2/gltf": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
63
|
-
"phoria2/motion": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
64
|
-
"phoria2/edit": "https://cdn.jsdelivr.net/npm/phoria2@1.
|
|
59
|
+
"phoria2": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/phoria2.js",
|
|
60
|
+
"phoria2/charts": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/charts.js",
|
|
61
|
+
"phoria2/particles": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/particles.js",
|
|
62
|
+
"phoria2/gltf": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/gltf.js",
|
|
63
|
+
"phoria2/motion": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/motion.js",
|
|
64
|
+
"phoria2/edit": "https://cdn.jsdelivr.net/npm/phoria2@1.1.0/dist/edit.js"
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
</script>
|
|
@@ -164,6 +164,25 @@ A full example, with a chart that follows its data, is in
|
|
|
164
164
|
| `phoria2/edit` | `TransformHandle` - a move and turn handle with grid and angle snapping - and `History` for undo, for planners and layout editors |
|
|
165
165
|
| `phoria2/schema.json`, `phoria2/charts/schema.json` | JSON Schemas for scene descriptions (`create()`) and chart specs |
|
|
166
166
|
|
|
167
|
+
## Versioning
|
|
168
|
+
|
|
169
|
+
phoria2 follows [semver](https://semver.org) from 1.0: no 1.x release breaks code written against
|
|
170
|
+
what is documented.
|
|
171
|
+
|
|
172
|
+
- **Covered:** what the entry points above export, as the [reference](https://kevs3d.co.uk/phoria2/llms-full.txt) and the
|
|
173
|
+
published types describe it - names, options and their defaults, and what they do. The formats
|
|
174
|
+
`create()` reads and `toJSON()` writes, and chart specs, as their JSON Schemas describe them. The
|
|
175
|
+
conventions: +Y up, metres, radians, sRGB colour in, and light intensities - a scene keeps its
|
|
176
|
+
colours and its brightness from one 1.x release to the next.
|
|
177
|
+
- **Not covered:** exact pixels, since drawing can get better (smoother edges, softer shadows); the
|
|
178
|
+
wording of errors and warnings (catch `PhoriaError`, not its message); modules imported from
|
|
179
|
+
`phoria2/src/...` directly, members left out of the types, and the shape of
|
|
180
|
+
`NullRenderer.lastFrame`; the demos.
|
|
181
|
+
- **Minor releases add:** options, methods, node types, chart marks. A new option's default keeps
|
|
182
|
+
what happened before.
|
|
183
|
+
- **Nothing is removed or renamed in 1.x.** What 2.0 will drop is deprecated first: a 1.x release
|
|
184
|
+
keeps it working and warns once in the console, saying exactly what to write instead.
|
|
185
|
+
|
|
167
186
|
## Browsers
|
|
168
187
|
|
|
169
188
|
Any browser with WebGL 2: current Chrome, Edge, Firefox and Safari (desktop and iOS 15+).
|
package/dist/bloom.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { A as e, M as t } from "./core.js";
|
|
2
2
|
// src/webgl/bloom.js
|
|
3
3
|
var n = `precision highp float;
|
|
4
4
|
in vec2 vUv;
|
|
@@ -6,7 +6,7 @@ uniform sampler2D uSource;
|
|
|
6
6
|
uniform vec2 uTexel;
|
|
7
7
|
uniform float uThreshold;
|
|
8
8
|
out vec4 fragColor;
|
|
9
|
-
${
|
|
9
|
+
${e}
|
|
10
10
|
vec3 tap(vec2 uv) {
|
|
11
11
|
vec3 c = texture(uSource, uv).rgb;
|
|
12
12
|
return uThreshold < 0.0 ? c : srgbToLinear(c);
|
|
@@ -29,7 +29,7 @@ uniform sampler2D uScene;
|
|
|
29
29
|
uniform sampler2D uBloom;
|
|
30
30
|
uniform float uStrength;
|
|
31
31
|
out vec4 fragColor;
|
|
32
|
-
${
|
|
32
|
+
${e}
|
|
33
33
|
void main() {
|
|
34
34
|
vec4 scene = texture(uScene, vUv);
|
|
35
35
|
vec3 glow = texture(uBloom, vUv).rgb * uStrength;
|
|
@@ -37,7 +37,7 @@ vec3 c = srgbToLinear(scene.rgb) + glow;
|
|
|
37
37
|
float a = clamp(scene.a + max(glow.r, max(glow.g, glow.b)), 0.0, 1.0);
|
|
38
38
|
fragColor = vec4(linearToSrgb(c), a);
|
|
39
39
|
}
|
|
40
|
-
`, a = [
|
|
40
|
+
`, a = [t, n], o = [t, r], s = [t, i], c = 6, l = class {
|
|
41
41
|
#e = null;
|
|
42
42
|
#t = !1;
|
|
43
43
|
constructor(e, t) {
|
package/dist/bloom.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bloom.js","names":["
|
|
1
|
+
{"version":3,"file":"bloom.js","names":["COMMON","FULLSCREEN_VERTEX","DOWN_FRAGMENT","UP_FRAGMENT","COMPOSITE_FRAGMENT","DOWN","UP","COMPOSITE","LEVELS","Bloom","gl","programs","#target","#float","#free","target","#targetFor","width","height","down","source","sw","sh","level","i","settings","up","weight","levels","from","to","composite","samples","multisampled","color","depth","texture","t","format","w","h","framebuffer","picture","b"],"sources":[],"mappings":""}
|