Skip to content

armgit / 67.js

Public Imported from GitHub
0

3D engine that AI agents drive

Merge remote-tracking branch 'origin/main' into HEAD

Nguyen Xuan Anbc5b49c45973
diff --cc CHANGELOG.md
index 1dbb2fae,6dfc32fb..8d2373d0
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -2,7 -2,8 +2,9 @@@
## Unreleased
+- Add ten cutting and repair edits: `fill_holes`, `dissolve_faces`, `dissolve_edges`, `dissolve_verts`, `dissolve_limited`, `bisect_plane` (with `fill`, `clearInner`, `clearOuter`), `bridge_edge_loops` (with `segments`), `subdivide_edges`, `grid_fill` and `knife_project`. Each tags what it makes, and the edge rule `{ "open": true }` picks boundary edges. The lint message for an open boundary now suggests `fill_holes`. 18 new cases match Blender in counts, face sizes, area, volume and positions; the knife is compared only with a straight plane cut and differs where a face runs along the projection direction
+ - Export textures, skeletons and clips to GLB: `exportGlb(parts, { nodes, clips, maxTextureSize })` now writes `map`, `normalMap`, `metallicRoughnessMap`, `occlusionMap` and `emissiveMap` as embedded PNG (limit 2048 px by default, with an error that names the option), skins with joint nodes and inverse bind matrices, and animation clips (translation, rotation and scale tracks; SMOOTH becomes cubic with zero tangents). Pattern materials export their baked textures with box projected UVs, so the picture matches without `uv_unwrap`. It previously threw on skins and on every texture channel. The `entry:core` size budget goes from 67,100 to 70,500 bytes gzip (+3,400)
+ - Make the first frame and the SwiftShader frame cost less, with the same pixels. The main fragment shader now compiles only the features that a scene uses (maps, splat layers, moss, alpha and the special material tags), and a part that needs another feature later recompiles it. All programs, with the environment prefilter, now start together and use `KHR_parallel_shader_compile`. On an RTX 3060 the first frame went from 3.7 to 4.4 seconds down to 0.5 to 1.0 seconds, and a SwiftShader frame costs 0.4 to 0.5 times what it did. `bench/runtime/PROFILE.md` has the profile
- Add `subdivide` as a mesh edit and stack node: Catmull-Clark subdivision to 4 levels with semi-sharp creases picked by an edge rule, sharp boundaries, kept corners, n-gon support, and tags, UVs and edge attributes carried through each level. The size is checked before it allocates. Counts, area and positions match Blender at levels 1 to 3; the `pebble` task joins the agent modeling suite
- Remove `67js/addons/film` from the npm package. It held the 187-second trailer demo with its baked physics recording, 75 KB gzip of the archive. Nothing else in the package used it. To keep using it, copy `src/film.js`, `src/film-rig.js`, `src/film-character.js`, `src/film-physics-definition.js` and `src/film-physics-clip.json` from the repository, or read the trailer on the site at `/film.html`. The archive goes from 901,314 to 829,085 bytes
- Remove three.js from modeling and the agent scene: `lathe`, `extrude` and `tube` no longer import it, and `scene:agent-scene` drops from 185,681 to 117,290 bytes gzip. `lathe` and `tube` output is identical to before, vertex for vertex. `extrude` walls, bevels, UVs, normals and bounds are identical, and volume matches within 1e-4. Extrusion caps use a new ear-clipping triangulation, so a cap can split along other diagonals, and a cap with collinear points can add or drop a seam vertex. A clockwise hole under a clockwise contour is now flipped to face outward, where it used to keep inward walls
diff --cc bench/size/baseline.json
index 3d451328,554bc034..ca31621c
--- a/bench/size/baseline.json
+++ b/bench/size/baseline.json
@@@ -54,24 -54,24 +54,24 @@@
"brotli": 2184
},
"entry:surface": {
- "min": 314055,
- "gzip": 72974,
- "brotli": 60264
+ "min": 29893,
+ "gzip": 9838,
+ "brotli": 7937
},
"entry:mesh-query": {
- "min": 344039,
- "gzip": 85555,
- "brotli": 71174
+ "min": 45212,
+ "gzip": 15535,
+ "brotli": 12998
},
"entry:mesh": {
- "min": 95797,
- "gzip": 32819,
- "brotli": 29011
- "min": 102839,
- "gzip": 34854,
- "brotli": 30681
++ "min": 130796,
++ "gzip": 43755,
++ "brotli": 38368
},
"entry:shrinkwrap": {
- "min": 348855,
- "gzip": 86779,
- "brotli": 72407
+ "min": 56188,
+ "gzip": 17860,
+ "brotli": 14972
},
"entry:surface-attachment": {
"min": 36920,
@@@ -129,14 -129,14 +129,14 @@@
"brotli": 762
},
"entry:agent-scene": {
- "min": 292317,
- "gzip": 93166,
- "brotli": 80011
- "min": 300204,
- "gzip": 95674,
- "brotli": 82113
++ "min": 328160,
++ "gzip": 104607,
++ "brotli": 89453
},
"entry:agent-asset": {
- "min": 318835,
- "gzip": 100520,
- "brotli": 85995
- "min": 326722,
- "gzip": 103016,
- "brotli": 88262
++ "min": 354678,
++ "gzip": 111950,
++ "brotli": 95555
},
"entry:hdri": {
"min": 8075,
@@@ -144,19 -144,19 +144,19 @@@
"brotli": 2801
},
"scene:lit-box": {
- "min": 178412,
- "gzip": 48762,
- "brotli": 41832
+ "min": 181287,
+ "gzip": 49762,
+ "brotli": 42779
},
"scene:gltf-box": {
- "min": 235553,
- "gzip": 67467,
- "brotli": 58083
+ "min": 238435,
+ "gzip": 68451,
+ "brotli": 59082
},
"scene:agent-scene": {
- "min": 384588,
- "gzip": 117290,
- "brotli": 100238
- "min": 394513,
- "gzip": 120389,
- "brotli": 102907
++ "min": 422469,
++ "gzip": 129348,
++ "brotli": 110393
}
}
}
diff --cc bench/size/budgets.json
index aad187fe,7adf6073..4a003581
--- a/bench/size/budgets.json
+++ b/bench/size/budgets.json
@@@ -10,13 -10,13 +10,13 @@@
"entry:nature": 13200,
"entry:motion": 13600,
"entry:canvas2d": 9400,
- "entry:gltf": 44100,
+ "entry:gltf": 44500,
"entry:modeling": 6600,
"entry:sculpt": 2500,
- "entry:surface": 74500,
- "entry:mesh-query": 87300,
- "entry:mesh": 43800,
- "entry:shrinkwrap": 88600,
+ "entry:surface": 10100,
+ "entry:mesh-query": 15900,
- "entry:mesh": 35600,
++ "entry:mesh": 44700,
+ "entry:shrinkwrap": 18300,
"entry:surface-attachment": 11800,
"entry:physics": 16500,
"entry:spume": 9000,
@@@ -28,11 -28,11 +28,11 @@@
"entry:grass": 4400,
"entry:clutter": 5300,
"entry:texture-set": 900,
- "entry:agent-scene": 104200,
- "entry:agent-asset": 111600,
- "entry:agent-scene": 97600,
- "entry:agent-asset": 105100,
++ "entry:agent-scene": 106700,
++ "entry:agent-asset": 114200,
"entry:hdri": 3300,
- "scene:lit-box": 49800,
- "scene:gltf-box": 68900,
- "scene:agent-scene": 128300
+ "scene:lit-box": 50800,
+ "scene:gltf-box": 69900,
- "scene:agent-scene": 122800
++ "scene:agent-scene": 132000
}
}