@hozo/three 0.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.
Files changed (91) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +389 -0
  3. package/conformance.md +335 -0
  4. package/dist/accessible-controls.d.ts +55 -0
  5. package/dist/accessible-controls.d.ts.map +1 -0
  6. package/dist/accessible-controls.js +82 -0
  7. package/dist/accessible-controls.js.map +1 -0
  8. package/dist/conformance-scenes.d.ts +39 -0
  9. package/dist/conformance-scenes.d.ts.map +1 -0
  10. package/dist/conformance-scenes.js +443 -0
  11. package/dist/conformance-scenes.js.map +1 -0
  12. package/dist/index.d.ts +4 -0
  13. package/dist/index.d.ts.map +1 -0
  14. package/dist/index.js +3 -0
  15. package/dist/index.js.map +1 -0
  16. package/dist/line-gradient.d.ts +13 -0
  17. package/dist/line-gradient.d.ts.map +1 -0
  18. package/dist/line-gradient.js +104 -0
  19. package/dist/line-gradient.js.map +1 -0
  20. package/dist/project.d.ts +23 -0
  21. package/dist/project.d.ts.map +1 -0
  22. package/dist/project.js +2298 -0
  23. package/dist/project.js.map +1 -0
  24. package/dist/r3f-accessibility.d.ts +30 -0
  25. package/dist/r3f-accessibility.d.ts.map +1 -0
  26. package/dist/r3f-accessibility.js +4 -0
  27. package/dist/r3f-accessibility.js.map +1 -0
  28. package/dist/r3f-native-unavailable.d.ts +5 -0
  29. package/dist/r3f-native-unavailable.d.ts.map +1 -0
  30. package/dist/r3f-native-unavailable.js +5 -0
  31. package/dist/r3f-native-unavailable.js.map +1 -0
  32. package/dist/r3f-native.d.ts +23 -0
  33. package/dist/r3f-native.d.ts.map +1 -0
  34. package/dist/r3f-native.js +66 -0
  35. package/dist/r3f-native.js.map +1 -0
  36. package/dist/r3f-react-native.d.ts +5 -0
  37. package/dist/r3f-react-native.d.ts.map +1 -0
  38. package/dist/r3f-react-native.js +5 -0
  39. package/dist/r3f-react-native.js.map +1 -0
  40. package/dist/r3f.d.ts +39 -0
  41. package/dist/r3f.d.ts.map +1 -0
  42. package/dist/r3f.js +41 -0
  43. package/dist/r3f.js.map +1 -0
  44. package/dist/surface.d.ts +81 -0
  45. package/dist/surface.d.ts.map +1 -0
  46. package/dist/surface.js +79 -0
  47. package/dist/surface.js.map +1 -0
  48. package/dist/three-canvas.d.ts +42 -0
  49. package/dist/three-canvas.d.ts.map +1 -0
  50. package/dist/three-canvas.js +91 -0
  51. package/dist/three-canvas.js.map +1 -0
  52. package/dist/web-surface.d.ts +55 -0
  53. package/dist/web-surface.d.ts.map +1 -0
  54. package/dist/web-surface.js +285 -0
  55. package/dist/web-surface.js.map +1 -0
  56. package/dist/webgl-react-native.d.ts +5 -0
  57. package/dist/webgl-react-native.d.ts.map +1 -0
  58. package/dist/webgl-react-native.js +5 -0
  59. package/dist/webgl-react-native.js.map +1 -0
  60. package/dist/webgl-renderer.d.ts +14 -0
  61. package/dist/webgl-renderer.d.ts.map +1 -0
  62. package/dist/webgl-renderer.js +13 -0
  63. package/dist/webgl-renderer.js.map +1 -0
  64. package/dist/webgpu-react-native.d.ts +5 -0
  65. package/dist/webgpu-react-native.d.ts.map +1 -0
  66. package/dist/webgpu-react-native.js +5 -0
  67. package/dist/webgpu-react-native.js.map +1 -0
  68. package/dist/webgpu.d.ts +18 -0
  69. package/dist/webgpu.d.ts.map +1 -0
  70. package/dist/webgpu.js +29 -0
  71. package/dist/webgpu.js.map +1 -0
  72. package/package.json +122 -0
  73. package/scene-conformance.json +244 -0
  74. package/scene-conformance.md +31 -0
  75. package/src/accessible-controls.ts +84 -0
  76. package/src/conformance-scenes.ts +529 -0
  77. package/src/index.ts +24 -0
  78. package/src/line-gradient.ts +134 -0
  79. package/src/project.ts +2742 -0
  80. package/src/r3f-accessibility.ts +37 -0
  81. package/src/r3f-native-unavailable.tsx +15 -0
  82. package/src/r3f-native.tsx +187 -0
  83. package/src/r3f-react-native.tsx +17 -0
  84. package/src/r3f.tsx +159 -0
  85. package/src/surface.ts +178 -0
  86. package/src/three-canvas.tsx +215 -0
  87. package/src/web-surface.tsx +475 -0
  88. package/src/webgl-react-native.tsx +17 -0
  89. package/src/webgl-renderer.tsx +56 -0
  90. package/src/webgpu-react-native.tsx +17 -0
  91. package/src/webgpu.tsx +71 -0
package/conformance.md ADDED
@@ -0,0 +1,335 @@
1
+ # Three.js coverage
2
+
3
+ Generated against Three.js r180. Run `pnpm --filter @hozo/three report` to update this file and add `--check` to verify it without writing.
4
+
5
+ This report keeps three different questions separate:
6
+
7
+ 1. **Portable capability coverage** asks which atomic behaviours can be implemented faithfully or approximately without a GPU.
8
+ 2. **Three.js surface classification** asks what happens when an upstream class or public surface reaches the portable backend.
9
+ 3. **Real-scene coverage** executes representative, version-pinned applications and assets in its own report and environment workflows.
10
+
11
+ Neither table below is a claim that an arbitrary Three.js scene works. In particular, class-level surface rows and atomic capability rows have different denominators and must not be added together.
12
+
13
+ ## Portable capability coverage
14
+
15
+ Capability status has stricter semantics than the class-level surface table:
16
+
17
+ - **Exact** reproduces the named atomic behaviour within its stated contract.
18
+ - **Approximate** is implemented and useful, with a documented rendering difference.
19
+ - **Deferred** appears feasible for the portable CPU/Canvas path but is not implemented yet.
20
+ - **Diagnostic** requires a GPU pipeline or is deliberately outside the portable contract and is safely rejected.
21
+ - **Silent** accepts the input while losing its semantics without a diagnostic. The target is zero.
22
+
23
+ ### Summary
24
+
25
+ Every category in the current portable surface inventory now has an independently owned capability inventory. Cross-cutting colour, texture, transparency, and normal-shading behaviour belongs to material; geometry owns shape traversal, deformation, transforms, and clipping; objects own discovery, selection, routing, and source identity; cameras own view/projection and multi-viewport composition; scene owns traversal policy, composition, backgrounds, ordering, and fog; topology owns primitive assembly; interaction owns invalidation, frames, hit testing, and semantic controls. This prevents the overall denominator from counting the same behaviour twice.
26
+
27
+ | Scope | Exact | Approximate | Deferred | Feasible | Implemented feasible | Diagnostic | Silent |
28
+ | --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: |
29
+ | **Material** | **21** | **9** | **0** | **30** | **30/30 (100.0%)** | **6** | **0** |
30
+ | **Geometry** | **26** | **0** | **0** | **26** | **26/26 (100.0%)** | **0** | **0** |
31
+ | **Object** | **22** | **0** | **0** | **22** | **22/22 (100.0%)** | **0** | **0** |
32
+ | **Camera** | **7** | **0** | **0** | **7** | **7/7 (100.0%)** | **3** | **0** |
33
+ | **Scene** | **14** | **2** | **0** | **16** | **16/16 (100.0%)** | **3** | **0** |
34
+ | **Topology** | **5** | **0** | **0** | **5** | **5/5 (100.0%)** | **0** | **0** |
35
+ | **Interaction** | **10** | **0** | **0** | **10** | **10/10 (100.0%)** | **0** | **0** |
36
+ | **Overall portable capability** | **105** | **11** | **0** | **116** | **116/116 (100.0%)** | **12** | **0** |
37
+
38
+ Overall exact capability coverage is **105/116 (90.5%)**. Including documented approximations, implemented feasible coverage is **116/116 (100.0%)**. This is a portable capability ceiling, not a real-scene success rate; GPU-required diagnostics remain visible and the separate version-pinned scene corpus reports application-shaped evidence independently.
39
+
40
+ ### Material capability details
41
+
42
+ | Owner | Capability | Status | Behaviour | Test |
43
+ | --- | --- | --- | --- | --- |
44
+ | Material | visibility | exact | Invisible materials omit their primitive without a diagnostic. | [test](src/project.test.ts) `an invisible material emits neither geometry nor a diagnostic` |
45
+ | Material | normal alpha transparency | exact | Uniform opacity and normal transparency are preserved across supported primitives. | [test](src/project.test.ts) `normal transparent materials project opacity across portable primitives` |
46
+ | Material | uniform alpha test | exact | A uniform primitive is discarded when its opacity is below alphaTest. | [test](src/project.test.ts) `uniform alphaTest omits every supported primitive only below its threshold` |
47
+ | MeshBasicMaterial | uniform colour | exact | A flat material colour is preserved on projected triangles. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
48
+ | MeshBasicMaterial | face side selection | exact | FrontSide, BackSide, and DoubleSide follow Three.js winding semantics. | [test](src/project.test.ts) `face side is respected after the viewport y-axis is flipped` |
49
+ | MeshBasicMaterial | solid wireframe | exact | Triangle edges become independent portable lines. | [test](src/project.test.ts) `wireframe MeshBasicMaterial becomes three Canvas lines per triangle` |
50
+ | LineBasicMaterial | uniform colour | exact | Line colour is preserved. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
51
+ | LineBasicMaterial | line width | exact | The requested portable stroke width is preserved. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
52
+ | LineDashedMaterial | dash and gap intervals | exact | Finite line-distance intervals are split into equivalent solid segments. | [test](src/project.test.ts) `LineDashedMaterial projects line-distance dash and gap intervals` |
53
+ | PointsMaterial | uniform colour | exact | Point colour is preserved. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
54
+ | PointsMaterial | point size | exact | The requested material size becomes the point diameter. | [test](src/project.test.ts) `PointsMaterial can keep a fixed screen-space size` |
55
+ | PointsMaterial | size attenuation modes | exact | Perspective and fixed screen-space sizing both follow the material flag. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation`<br>[test](src/project.test.ts) `PointsMaterial can keep a fixed screen-space size` |
56
+ | SpriteMaterial | rotation | exact | Billboard rotation is preserved. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
57
+ | SpriteMaterial | size attenuation mode | exact | Perspective and fixed screen-space sizing follow the material flag. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
58
+ | MeshBasicMaterial | RGB vertex interpolation | approximate | Vertex colours are interpolated in the portable 2D backend; GPU perspective-correct interpolation is not promised. | [test](src/project.test.ts) `mesh vertex colours become a portable interpolated triangle` |
59
+ | Vertex-coloured materials | RGBA vertex alpha interpolation | approximate | Transparent vertex alpha is preserved through the portable colour interpolation path. | [test](src/project.test.ts) `transparent RGBA vertex attributes preserve alpha across portable primitives` |
60
+ | MeshBasicMaterial | wireframe vertex-colour interpolation | approximate | Opaque RGB edges refine linear working colour and perspective depth into at most 32 host gradient stops. Short edges have smaller budgets; transparency, fog, and explicit endpoints mode retain two-stop approximation. | [test](src/project.test.ts) `wireframe MeshBasicMaterial preserves RGB vertex colours as edge gradients` |
61
+ | LineBasicMaterial | vertex-colour interpolation | approximate | Opaque RGB segments refine linear working colour and perspective depth into at most 32 host gradient stops, after near/material clipping. This remains a bounded approximation; transparency and fog retain two stops. | [test](src/project.test.ts) `LineBasicMaterial projects clipped RGB vertex colours as a portable gradient` |
62
+ | PointsMaterial | per-point colour | exact | Each point multiplies its RGB attribute by the material colour. | [test](src/project.test.ts) `PointsMaterial multiplies per-point RGB colours` |
63
+ | MeshBasicMaterial | affine colour-map projection | approximate | Supported sRGB maps preserve transformed UVs, but projection is affine rather than perspective-correct. | [test](src/project.test.ts) `MeshBasicMaterial map and UVs become a portable textured triangle` |
64
+ | Texture-backed materials | clamp, repeat, and mirrored wrapping | exact | Clamp, repeat, and mirror modes are preserved independently on each texture axis, including negative UVs. | [test](src/project.test.ts) `mixed clamp and repeat wrapping stays portable per texture axis`<br>[test](src/project.test.ts) `mirrored wrapping preserves negative and transformed UVs on either axis` |
65
+ | PointsMaterial | point-sprite colour map | approximate | A supported map becomes a portable textured quad without the full GPU sampling pipeline. | [test](src/project.test.ts) `PointsMaterial map becomes a portable point-sprite texture` |
66
+ | Texture-backed materials | linear material-colour modulation | exact | Mesh, point, and sprite maps multiply decoded linear RGB by the material colour before encoding; alpha is preserved. Affine/filtering approximation is classified separately. | [test](src/project.test.ts) `texture maps preserve linear material tint for meshes, points, and sprites` |
67
+ | SpriteMaterial | affine colour map | approximate | A supported map follows clipped billboard UVs without perspective sampling. | [test](src/project.test.ts) `SpriteMaterial map preserves billboard UVs through clipping` |
68
+ | MeshNormalMaterial | smooth view-space normal shading | approximate | Vertex normals become portable colours; per-fragment normal interpolation is not reproduced. | [test](src/project.test.ts) `MeshNormalMaterial projects smooth and flat view-space normals` |
69
+ | MeshNormalMaterial | flat view-space normal shading | exact | A face normal is evaluated once for each projected triangle. | [test](src/project.test.ts) `MeshNormalMaterial projects smooth and flat view-space normals` |
70
+ | MeshNormalMaterial | wireframe normal shading | approximate | Normal-derived endpoint colours become portable linear edge gradients; GPU perspective-correct interpolation is not promised. | [test](src/project.test.ts) `MeshNormalMaterial wireframe projects normal-coloured clipped edges` |
71
+ | MeshNormalMaterial | instanced normal shading | exact | Each instance uses its own view-space normal matrix; the separately inventoried smooth-shading interpolation boundary is unchanged. | [test](src/project.test.ts) `InstancedMesh projects each normal matrix for filled and wireframe normal materials` |
72
+ | MeshNormalMaterial | skinned normal shading | exact | Morphed positions and normals use the same weighted bone and bind-matrix transforms as the upstream normal-material vertex path. | [test](src/project.test.ts) `MeshNormalMaterial skins morphed positions and normals in bone space` |
73
+ | MeshNormalMaterial | morphed normal shading | exact | Absolute and relative position and normal targets are blended before normal-material projection; the separately inventoried smooth-shading interpolation boundary is unchanged. | [test](src/project.test.ts) `MeshNormalMaterial projects position and normal morph targets` |
74
+ | Texture-backed materials | general GPU texture sampling | diagnostic | Unsupported colour spaces, transforms, and GPU sampling state are rejected. | [test](src/project.test.ts) `non-portable texture sampling is refused with an actionable diagnostic` |
75
+ | Lit mesh materials | lighting models | diagnostic | Lambert, Phong, Standard, Physical, Toon, and Matcap shading require a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
76
+ | Depth and shadow materials | depth, distance, and shadow output | diagnostic | Depth, distance, and shadow materials depend on GPU passes unavailable to the portable projector. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
77
+ | ShaderMaterial | custom shaders | diagnostic | ShaderMaterial and RawShaderMaterial require a programmable GPU pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
78
+ | MeshNormalMaterial | normal, bump, and displacement maps | diagnostic | Per-fragment and displacement texture evaluation requires a GPU material pipeline. | [test](src/project.test.ts) `non-portable MeshNormalMaterial features stay diagnostic` |
79
+ | Material | custom depth, stencil, blending, and sampling state | diagnostic | Non-default GPU pipeline state is rejected instead of being silently approximated. | [test](src/project.test.ts) `non-default depth, stencil, write, offset, blending, and sampling state emit diagnostics` |
80
+
81
+ ### Geometry capability details
82
+
83
+ | Owner | Capability | Status | Behaviour | Test |
84
+ | --- | --- | --- | --- | --- |
85
+ | BufferGeometry | non-indexed triangle traversal | exact | Position triples are traversed directly as triangles. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
86
+ | BufferGeometry | indexed triangle traversal | exact | Triangle vertex lookup follows the geometry index. | [test](src/project.test.ts) `indexed geometry emits each triangle` |
87
+ | BufferGeometry | indexed line traversal | exact | Line vertex lookup follows the geometry index. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
88
+ | BufferGeometry | indexed point traversal | exact | Point vertex lookup follows the geometry index. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
89
+ | BufferGeometry | mesh draw range | exact | The requested draw range intersects mesh topology and material groups. | [test](src/project.test.ts) `material groups intersect the geometry draw range` |
90
+ | BufferGeometry | wireframe draw range | exact | Triangle draw ranges are converted to the equivalent wireframe edge range. | [test](src/project.test.ts) `wireframe projection applies the same doubled draw range as Three.js` |
91
+ | BufferGeometry | line draw range | exact | Indexed line traversal is restricted to the requested draw range. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
92
+ | BufferGeometry | point draw range | exact | Indexed point traversal is restricted to the requested draw range. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
93
+ | BufferGeometry | material groups | exact | Group ranges select the matching entry from a material array. | [test](src/project.test.ts) `material arrays preserve BufferGeometry group colours` |
94
+ | Object3D transforms | nested world transforms | exact | Ancestor and local matrices are composed before projection. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path` |
95
+ | Object3D transforms | mirrored winding | exact | A negative world determinant preserves Three.js front-face semantics. | [test](src/project.test.ts) `mirrored mesh transforms preserve Three.js front-face semantics` |
96
+ | Projection | triangle frustum clipping | exact | Triangles are clipped in homogeneous coordinates against all six planes. | [test](src/project.test.ts) `the homogeneous clip volume cuts a near-plane crossing instead of exploding it` |
97
+ | Projection | line frustum clipping | exact | Line segments crossing the clip volume become finite projected segments. | [test](src/project.test.ts) `a line crossing the near plane is clipped to finite viewport coordinates` |
98
+ | Projection | point frustum rejection | exact | Points outside the homogeneous clip volume are omitted. | [test](src/project.test.ts) `points outside the homogeneous clip volume are omitted` |
99
+ | Clipped attributes | texture-coordinate interpolation | exact | New clip-edge vertices receive the corresponding affine texture coordinates. | [test](src/project.test.ts) `mesh clipping interpolates texture coordinates at generated edges` |
100
+ | Clipped attributes | vertex-colour interpolation | exact | New clip-edge vertices receive the corresponding colour and alpha values. | [test](src/project.test.ts) `mesh clipping interpolates vertex colours at generated edges` |
101
+ | Morph targets | absolute mesh positions | exact | Absolute position targets are blended before projection. | [test](src/project.test.ts) `absolute and relative mesh morph targets deform projected triangles` |
102
+ | Morph targets | relative mesh positions | exact | Relative position deltas are blended before projection. | [test](src/project.test.ts) `absolute and relative mesh morph targets deform projected triangles` |
103
+ | Morph targets | point positions | exact | Point position targets move projected points. | [test](src/project.test.ts) `point morph targets move projected points` |
104
+ | Morph targets | line positions | exact | Line position targets deform projected segments. | [test](src/project.test.ts) `line morph targets deform projected segments` |
105
+ | SkinnedMesh | CPU skinned positions | exact | Morph targets, bind matrices, weights, and the current skeleton pose produce final positions. | [test](src/project.test.ts) `SkinnedMesh evaluates morph targets before public CPU bone transforms` |
106
+ | InstancedMesh | instance transforms | exact | Each active instance matrix is applied independently. | [test](src/project.test.ts) `InstancedMesh applies each instance transform and preserves object identity` |
107
+ | InstancedMesh | per-instance morph weights | exact | Each instance evaluates its own position morph weights. | [test](src/project.test.ts) `InstancedMesh applies per-instance colours and morph weights` |
108
+ | BatchedMesh | geometry and instance ranges | exact | Sparse instance IDs select their geometry range, visibility, and transform. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
109
+ | Material clipping | intersection half-spaces | exact | World-space clipping planes cut meshes and lines and discard rejected points. | [test](src/project.test.ts) `material clipping planes cut meshes and lines and discard points in world space` |
110
+ | Material clipping | union half-spaces | exact | clipIntersection retains the disjoint union of accepted half-spaces. | [test](src/project.test.ts) `clipIntersection retains the disjoint union of material half-spaces` |
111
+
112
+ ### Object capability details
113
+
114
+ | Owner | Capability | Status | Behaviour | Test |
115
+ | --- | --- | --- | --- | --- |
116
+ | Object3D | individual visibility | exact | An invisible renderable object is omitted. | [test](src/project.test.ts) `object visibility prunes objects and hidden subtrees` |
117
+ | Group | descendant traversal | exact | Renderable descendants are discovered through nested groups. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path` |
118
+ | Group | hidden-subtree pruning | exact | An invisible ancestor removes its complete subtree. | [test](src/project.test.ts) `object visibility prunes objects and hidden subtrees` |
119
+ | Mesh | triangle-pipeline routing | exact | A Mesh is routed to the portable triangle pipeline. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
120
+ | Line | line-strip routing | exact | A Line is routed to the portable connected-line pipeline. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
121
+ | LineLoop | closed-line routing | exact | A LineLoop selects the closed portable line topology. | [test](src/project.test.ts) `LineLoop closes its final vertex back to its first` |
122
+ | LineSegments | independent-segment routing | exact | LineSegments selects independent portable line pairs. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
123
+ | Points | point-pipeline routing | exact | Points is routed to the portable point pipeline. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
124
+ | Sprite | camera-facing quad | exact | A Sprite becomes a camera-facing quad at its projected centre. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
125
+ | Sprite | centre anchor | exact | The public centre shifts the billboard anchor. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
126
+ | Sprite | object scale | exact | World scale controls the billboard dimensions. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
127
+ | Sprite | draw count visibility | exact | A zero draw count omits the sprite. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
128
+ | InstancedMesh | active instance count | exact | Only instances below the public count are projected. | [test](src/project.test.ts) `InstancedMesh applies each instance transform and preserves object identity` |
129
+ | InstancedMesh | source object identity | exact | Every projected instance retains the InstancedMesh as its source object. | [test](src/project.test.ts) `InstancedMesh applies each instance transform and preserves object identity` |
130
+ | InstancedMesh | per-instance colour | exact | Each instance colour modulates the supported base material colour. | [test](src/project.test.ts) `InstancedMesh applies per-instance colours and morph weights` |
131
+ | BatchedMesh | sparse instance selection | exact | Deleted sparse instance IDs are skipped without shifting active IDs. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
132
+ | BatchedMesh | per-instance visibility | exact | The public visibility flag independently hides a batch instance. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
133
+ | BatchedMesh | per-instance colour | exact | A batch instance colour modulates the supported base material colour. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
134
+ | BatchedMesh | source object identity | exact | Every projected batch instance retains the BatchedMesh as its source object. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
135
+ | LOD | camera-distance selection | exact | Automatic LOD selects the level for the current camera distance. | [test](src/project.test.ts) `LOD selects the camera-distance level and honours manual visibility` |
136
+ | LOD | manual level visibility | exact | Disabling automatic updates preserves application-controlled level visibility. | [test](src/project.test.ts) `LOD selects the camera-distance level and honours manual visibility` |
137
+ | SkinnedMesh | source object identity | exact | Projected skinned primitives retain their SkinnedMesh source object. | [test](src/project.test.ts) `SkinnedMesh evaluates morph targets before public CPU bone transforms` |
138
+
139
+ ### Camera capability details
140
+
141
+ | Owner | Capability | Status | Behaviour | Test |
142
+ | --- | --- | --- | --- | --- |
143
+ | PerspectiveCamera | projection matrix | exact | The public perspective projection matrix maps clip coordinates. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
144
+ | PerspectiveCamera | world-to-view transform | exact | The public camera world matrix is inverted before projection. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
145
+ | OrthographicCamera | projection matrix | exact | The public orthographic projection matrix maps clip coordinates. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path` |
146
+ | OrthographicCamera | world-to-view transform | exact | The public camera world matrix is inverted before orthographic projection. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path` |
147
+ | ArrayCamera | declared sub-camera order | exact | Sub-cameras project in their declared order. | [test](src/project.test.ts) `ArrayCamera projects each sub-camera into its bottom-left viewport` |
148
+ | ArrayCamera | bottom-left viewport mapping | exact | Three.js bottom-left viewport coordinates map to portable top-left groups. | [test](src/project.test.ts) `ArrayCamera projects each sub-camera into its bottom-left viewport` |
149
+ | ArrayCamera | single scene decoration pass | exact | Scene background decoration is emitted once around all sub-camera groups. | [test](src/project.test.ts) `ArrayCamera projects each sub-camera into its bottom-left viewport` |
150
+ | ArrayCamera | missing viewport refusal | diagnostic | A sub-camera without an explicit viewport is rejected. | [test](src/project.test.ts) `ArrayCamera diagnoses sub-cameras without a viewport` |
151
+ | Camera | base camera projection | diagnostic | A base Camera has no usable projection matrix contract and is rejected. | [test](src/project.test.ts) `unsupported inputs are omitted with actionable diagnostics` |
152
+ | CubeCamera | environment capture | diagnostic | Cube environment capture requires a GPU renderer and render target. | [test](src/project.test.ts) `GPU capture cameras remain diagnostic` |
153
+
154
+ ### Scene capability details
155
+
156
+ | Owner | Capability | Status | Behaviour | Test |
157
+ | --- | --- | --- | --- | --- |
158
+ | Render list | opaque and transparent partition | exact | Transparent primitives paint after opaque primitives. | [test](src/project.test.ts) `transparent primitives paint after opaque primitives` |
159
+ | Render list | primitive painter ordering | approximate | Non-intersecting primitives sort far-to-near, but there is no per-pixel depth buffer. | [test](src/project.test.ts) `far triangles are painted before near triangles` |
160
+ | Object3D.renderOrder | explicit object ordering | exact | An explicit object render order overrides portable painter depth. | [test](src/project.test.ts) `renderOrder overrides painter depth while preserving stable object order` |
161
+ | Object3D.renderOrder | stable equal-order traversal | exact | Objects with the same render order and depth retain stable traversal order. | [test](src/project.test.ts) `renderOrder overrides painter depth while preserving stable object order` |
162
+ | Group.renderOrder | descendant ordering group | exact | A group render order is inherited by its projected descendants. | [test](src/project.test.ts) `Group renderOrder applies to its projected descendants` |
163
+ | Layers | camera-object mask filtering | exact | Layer masks filter each renderable without pruning matching descendants. | [test](src/project.test.ts) `camera layers filter objects without hiding matching descendants` |
164
+ | Scene.overrideMaterial | eligible material replacement | exact | The override replaces supported materials after render-list visibility is resolved. | [test](src/project.test.ts) `Scene.overrideMaterial preserves render-list visibility and allowOverride` |
165
+ | Scene.overrideMaterial | allowOverride opt-out | exact | Materials with allowOverride disabled retain their original appearance. | [test](src/project.test.ts) `Scene.overrideMaterial preserves render-list visibility and allowOverride` |
166
+ | Scene.background | solid colour decoration | exact | A colour fills the viewport without becoming an interactive object. | [test](src/project.test.ts) `solid scene backgrounds become non-interactive Canvas rectangles` |
167
+ | Scene.background | 2D texture placement | exact | A supported 2D colour texture covers the viewport as non-interactive decoration. | [test](src/project.test.ts) `a 2D texture background becomes a viewport-sized portable mesh` |
168
+ | Scene.background | background intensity | exact | Supported 2D backgrounds multiply sampled RGB while preserving texture alpha. | [test](src/project.test.ts) `scene background intensity modulates texture RGB` |
169
+ | Scene.background | 2D texture blur semantics | exact | backgroundBlurriness remains a no-op for ordinary 2D textures, matching Three.js; environment maps are classified separately. | [test](src/project.test.ts) `scene background blurriness is a no-op for 2D textures` |
170
+ | Scene.background | environment-map sampling | diagnostic | Cube and equirectangular environment projection requires a GPU sampling pipeline. | [test](src/project.test.ts) `environment backgrounds are diagnosed while portable geometry remains visible` |
171
+ | Fog | material opt-out | exact | Materials with fog disabled retain their unfogged colour. | [test](src/project.test.ts) `linear fog blends mesh vertices and honours material fog opt-out` |
172
+ | Fog | constant-depth linear fog | exact | A constant-depth primitive receives the matching linear fog colour. | [test](src/project.test.ts) `fog follows lines, points, sprites, and exponential density` |
173
+ | FogExp2 | constant-depth exponential fog | exact | A constant-depth primitive receives the matching exponential fog colour. | [test](src/project.test.ts) `fog follows lines, points, sprites, and exponential density` |
174
+ | Fog | varying-depth vertex fog | approximate | Fog is evaluated at portable vertices and endpoints rather than per fragment. | [test](src/project.test.ts) `fog is evaluated at vertices created by homogeneous clipping`<br>[test](src/project.test.ts) `fog follows lines, points, sprites, and exponential density` |
175
+ | Fog | invalid range refusal | diagnostic | Invalid or non-finite fog parameters are rejected instead of producing invalid colours. | [test](src/project.test.ts) `invalid fog ranges are diagnosed instead of producing non-finite colours` |
176
+ | Depth buffer | per-pixel depth and stencil | diagnostic | Exact intersecting-surface depth and stencil evaluation requires a raster pipeline. | [test](src/project.test.ts) `non-default depth, stencil, write, offset, blending, and sampling state emit diagnostics` |
177
+
178
+ ### Topology capability details
179
+
180
+ | Owner | Capability | Status | Behaviour | Test |
181
+ | --- | --- | --- | --- | --- |
182
+ | Triangles | triangle-list assembly | exact | Every complete vertex triple becomes one triangle primitive. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates`<br>[test](src/project.test.ts) `indexed geometry emits each triangle` |
183
+ | Line | line-strip adjacency | exact | Each adjacent vertex pair becomes a connected segment. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
184
+ | LineLoop | loop closure | exact | The final vertex connects back to the first vertex. | [test](src/project.test.ts) `LineLoop closes its final vertex back to its first` |
185
+ | LineSegments | independent pairs | exact | Each disjoint vertex pair becomes one segment. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
186
+ | Points | independent point primitives | exact | Each selected vertex becomes one point primitive. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
187
+
188
+ ### Interaction capability details
189
+
190
+ | Owner | Capability | Status | Behaviour | Test |
191
+ | --- | --- | --- | --- | --- |
192
+ | Demand rendering | imperative invalidation | exact | The public handle re-projects mutations made to stable scene objects. | [test](src/three-canvas.test.tsx) `ThreeCanvas draws a projected Three scene and invalidates imperative mutations` |
193
+ | Demand rendering | revision invalidation | exact | Changing the application-owned revision re-projects stable scene objects. | [test](src/three-canvas.test.tsx) `revision re-projects imperative scene mutations` |
194
+ | Continuous rendering | onFrame before projection | exact | The frame callback mutates the scene before that frame is projected. | [test](src/three-canvas.test.tsx) `the continuous loop updates before projecting and stops on unmount` |
195
+ | Continuous rendering | unmount cancellation | exact | Unmounting cancels the outstanding animation frame. | [test](src/three-canvas.test.tsx) `the continuous loop updates before projecting and stops on unmount` |
196
+ | Raycast activation | source object | exact | Activation reports the original Three.js object. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
197
+ | Raycast activation | Three.js intersection | exact | Activation carries the matching Three.js raycast intersection. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
198
+ | Active object | pointer entry | exact | Pointer movement reports the intersected object and intersection. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
199
+ | Active object | pointer leave | exact | Leaving the surface clears the active object. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
200
+ | Semantic controls | one control per source object | exact | Multiple projected primitives from one object share one semantic control. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
201
+ | Semantic controls | object-name label | exact | The source object name labels its semantic control. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
202
+
203
+ ## Three.js surface classification
204
+
205
+ This measures the version-audited upstream surface presented to the portable Hozo Canvas backend. It deliberately separates compatibility from safe refusal:
206
+
207
+ - **Exact** counts rows implemented without a named restriction.
208
+ - **Usable** adds partial implementations with documented restrictions.
209
+ - **Safe** adds unsupported inputs that produce a diagnostic instead of misleading output.
210
+ - **Silent** is a known semantic loss with no diagnostic. These are the highest-priority gaps.
211
+ - **Out of scope** is excluded from every percentage.
212
+
213
+ The rows are an unweighted API surface. The overall Three.js surface figure excludes Hozo's additional interaction contract, which remains visible as its own category. A later corpus report should weight the upstream rows by real scene usage; ordinary glTF scenes rely heavily on `MeshStandardMaterial`, so this table must not be read as a real-model success rate.
214
+
215
+ ### Summary
216
+
217
+ | Category | Exact | Usable | Safe | Silent | Out of scope |
218
+ | --- | ---: | ---: | ---: | ---: | ---: |
219
+ | topology | 5/5 (100.0%) | 5/5 (100.0%) | 5/5 (100.0%) | 0 | 0 |
220
+ | object | 11/11 (100.0%) | 11/11 (100.0%) | 11/11 (100.0%) | 0 | 2 |
221
+ | camera | 3/4 (75.0%) | 3/4 (75.0%) | 4/4 (100.0%) | 0 | 2 |
222
+ | material | 0/17 (0.0%) | 6/17 (35.3%) | 17/17 (100.0%) | 0 | 1 |
223
+ | geometry | 10/13 (76.9%) | 13/13 (100.0%) | 13/13 (100.0%) | 0 | 0 |
224
+ | scene | 3/8 (37.5%) | 7/8 (87.5%) | 8/8 (100.0%) | 0 | 1 |
225
+ | interaction | 4/4 (100.0%) | 4/4 (100.0%) | 4/4 (100.0%) | 0 | 0 |
226
+ | **Class-level surface** | **32/58 (55.2%)** | **45/58 (77.6%)** | **58/58 (100.0%)** | **0** | **6** |
227
+
228
+ ### Detailed surface
229
+
230
+ #### topology
231
+
232
+ | Feature | Status | Behaviour | Test |
233
+ | --- | --- | --- | --- |
234
+ | triangles | full | Indexed and non-indexed triangles become clipped paths. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates`<br>[test](src/project.test.ts) `indexed geometry emits each triangle` |
235
+ | line strip | full | Adjacent vertices become connected Canvas lines. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
236
+ | line loop | full | The final vertex is connected back to the first. | [test](src/project.test.ts) `LineLoop closes its final vertex back to its first` |
237
+ | line segments | full | Each vertex pair becomes an independent line. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
238
+ | points | full | Points become circles or textured point-sprite quads with optional perspective attenuation. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
239
+
240
+ #### object
241
+
242
+ | Feature | Status | Behaviour | Test |
243
+ | --- | --- | --- | --- |
244
+ | BatchedMesh | full | Sparse instance IDs, geometry ranges, visibility, transforms, and colours are projected. | [test](src/project.test.ts) `BatchedMesh projects sparse visible instances with transforms and colours` |
245
+ | Bone | out-of-scope | A Bone has no independent render primitive. | — |
246
+ | Group | full | Visibility and nested world transforms are traversed. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path`<br>[test](src/project.test.ts) `object visibility prunes objects and hidden subtrees` |
247
+ | InstancedMesh | full | Instance transforms, colours, and morph weights project independently. | [test](src/project.test.ts) `InstancedMesh applies each instance transform and preserves object identity`<br>[test](src/project.test.ts) `InstancedMesh applies per-instance colours and morph weights` |
248
+ | Line | full | Line strips project through the portable line pipeline. | [test](src/project.test.ts) `Line connects adjacent vertices and honours indexed draw ranges` |
249
+ | LineLoop | full | Closed line strips project through the line pipeline. | [test](src/project.test.ts) `LineLoop closes its final vertex back to its first` |
250
+ | LineSegments | full | Independent line pairs project through the line pipeline. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width` |
251
+ | LOD | full | The camera-distance level is selected automatically, or manual visibility is preserved. | [test](src/project.test.ts) `LOD selects the camera-distance level and honours manual visibility` |
252
+ | Mesh | full | Triangle meshes use the supported material subset. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
253
+ | Points | full | Point vertices project through the portable point pipeline. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation` |
254
+ | Skeleton | out-of-scope | A Skeleton is data consumed by SkinnedMesh. | — |
255
+ | SkinnedMesh | full | Public CPU morph and bone transforms are evaluated. | [test](src/project.test.ts) `SkinnedMesh evaluates morph targets before public CPU bone transforms` |
256
+ | Sprite | full | Camera-facing quads preserve centre, rotation, scale, and size attenuation. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation` |
257
+
258
+ #### camera
259
+
260
+ | Feature | Status | Behaviour | Test |
261
+ | --- | --- | --- | --- |
262
+ | ArrayCamera | full | Each child camera projects into its bottom-left viewport in declared order. | [test](src/project.test.ts) `ArrayCamera projects each sub-camera into its bottom-left viewport`<br>[test](src/project.test.ts) `ArrayCamera diagnoses sub-cameras without a viewport` |
263
+ | Camera | diagnostic | A base camera has no usable projection and is rejected. | [test](src/project.test.ts) `unsupported inputs are omitted with actionable diagnostics` |
264
+ | CubeCamera | out-of-scope | Environment capture needs a GPU renderer. | [test](src/project.test.ts) `GPU capture cameras remain diagnostic` |
265
+ | OrthographicCamera | full | Its public projection matrix is honoured. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path` |
266
+ | PerspectiveCamera | full | Its public projection matrix is honoured. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
267
+ | StereoCamera | out-of-scope | StereoCamera is a two-camera helper, not a direct render camera. | — |
268
+
269
+ #### material
270
+
271
+ | Feature | Status | Behaviour | Test |
272
+ | --- | --- | --- | --- |
273
+ | LineBasicMaterial | partial | Colour, width, RGB vertex gradients, fog, and normal alpha transparency work; advanced base material state does not. | [test](src/project.test.ts) `LineSegments become independent Canvas lines with material colour and width`<br>[test](src/project.test.ts) `LineBasicMaterial projects clipped RGB vertex colours as a portable gradient`<br>[test](src/project.test.ts) `normal transparent materials project opacity across portable primitives` |
274
+ | LineDashedMaterial | partial | Finite dash and gap intervals split into portable solid segments before projection. | [test](src/project.test.ts) `LineDashedMaterial projects line-distance dash and gap intervals`<br>[test](src/project.test.ts) `invalid or excessive dashed line intervals emit diagnostics` |
275
+ | Material | out-of-scope | The abstract material base has no renderable appearance. | — |
276
+ | MeshBasicMaterial | partial | Flat and RGB vertex colours, including wireframe edge gradients, a constrained affine colour map, fog, normal alpha transparency, sides, groups, and wireframe work. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates`<br>[test](src/project.test.ts) `MeshBasicMaterial map and UVs become a portable textured triangle`<br>[test](src/project.test.ts) `groups can mix solid and wireframe MeshBasicMaterial`<br>[test](src/project.test.ts) `wireframe MeshBasicMaterial preserves RGB vertex colours as edge gradients`<br>[test](src/project.test.ts) `normal transparent materials project opacity across portable primitives` |
277
+ | MeshDepthMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
278
+ | MeshDistanceMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
279
+ | MeshLambertMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
280
+ | MeshMatcapMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
281
+ | MeshPhongMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
282
+ | MeshPhysicalMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
283
+ | MeshStandardMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
284
+ | MeshToonMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
285
+ | RawShaderMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
286
+ | ShaderMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
287
+ | ShadowMaterial | diagnostic | Rejected because correct output needs a GPU material pipeline. | [test](src/project.test.ts) `unsupported mesh material classes emit diagnostics` |
288
+ | MeshNormalMaterial | partial | Smooth and flat view-space normals become portable vertex colours for ordinary, instanced, morphed, and skinned meshes, including wireframes; normal/bump/displacement maps stay diagnostic. | [test](src/project.test.ts) `MeshNormalMaterial projects smooth and flat view-space normals`<br>[test](src/project.test.ts) `MeshNormalMaterial wireframe projects normal-coloured clipped edges`<br>[test](src/project.test.ts) `InstancedMesh projects each normal matrix for filled and wireframe normal materials`<br>[test](src/project.test.ts) `MeshNormalMaterial projects position and normal morph targets`<br>[test](src/project.test.ts) `MeshNormalMaterial skins morphed positions and normals in bone space`<br>[test](src/project.test.ts) `non-portable MeshNormalMaterial features stay diagnostic` |
289
+ | PointsMaterial | partial | Colour, normal alpha transparency, per-point RGB, fog, size, attenuation, and the constrained point-sprite colour-map subset work. | [test](src/project.test.ts) `Points become Canvas circles with indexed draw ranges and perspective attenuation`<br>[test](src/project.test.ts) `PointsMaterial multiplies per-point RGB colours`<br>[test](src/project.test.ts) `normal transparent materials project opacity across portable primitives`<br>[test](src/project.test.ts) `PointsMaterial map becomes a portable point-sprite texture` |
290
+ | SpriteMaterial | partial | Solid colour, fog, normal alpha transparency, and the constrained affine colour-map subset work. | [test](src/project.test.ts) `Sprite projects its billboard centre, rotation, and perspective attenuation`<br>[test](src/project.test.ts) `SpriteMaterial map preserves billboard UVs through clipping`<br>[test](src/project.test.ts) `normal transparent materials project opacity across portable primitives`<br>[test](src/project.test.ts) `unsupported SpriteMaterial features are omitted with diagnostics` |
291
+
292
+ #### geometry
293
+
294
+ | Feature | Status | Behaviour | Test |
295
+ | --- | --- | --- | --- |
296
+ | non-indexed BufferGeometry | full | Position triples render directly. | [test](src/project.test.ts) `a Three.js triangle becomes a Canvas path in viewport coordinates` |
297
+ | indexed BufferGeometry | full | Index buffers drive triangle, line, and point lookup. | [test](src/project.test.ts) `indexed geometry emits each triangle` |
298
+ | drawRange | full | Ranges intersect topology and material groups. | [test](src/project.test.ts) `material groups intersect the geometry draw range` |
299
+ | geometry groups | full | Material arrays preserve group ranges and colours. | [test](src/project.test.ts) `material arrays preserve BufferGeometry group colours` |
300
+ | world transforms | full | Nested object matrices are applied before projection. | [test](src/project.test.ts) `world transforms under groups are baked into the projected path`<br>[test](src/project.test.ts) `mirrored mesh transforms preserve Three.js front-face semantics` |
301
+ | homogeneous frustum clipping | full | Triangles and lines clip against all six planes. | [test](src/project.test.ts) `the homogeneous clip volume cuts a near-plane crossing instead of exploding it`<br>[test](src/project.test.ts) `a line crossing the near plane is clipped to finite viewport coordinates` |
302
+ | front, back, and double side | full | Face winding and material side are honoured. | [test](src/project.test.ts) `face side is respected after the viewport y-axis is flipped` |
303
+ | mesh and point morph targets | full | Absolute and relative position morphs are evaluated before projection. | [test](src/project.test.ts) `absolute and relative mesh morph targets deform projected triangles`<br>[test](src/project.test.ts) `point morph targets move projected points` |
304
+ | line morph targets | full | Position morphs deform line vertices. | [test](src/project.test.ts) `line morph targets deform projected segments` |
305
+ | vertex colours | partial | Mesh, wireframe, line, and point RGB attributes work through portable interpolation, including clipped vertices. Transparent RGBA attributes also preserve vertex alpha; opaque RGBA and alpha-tested gradients stay diagnostic. Filled mesh interpolation is screen-space rather than perspective-correct. | [test](src/project.test.ts) `mesh vertex colours become a portable interpolated triangle`<br>[test](src/project.test.ts) `mesh clipping interpolates vertex colours at generated edges`<br>[test](src/project.test.ts) `wireframe MeshBasicMaterial preserves RGB vertex colours as edge gradients`<br>[test](src/project.test.ts) `PointsMaterial multiplies per-point RGB colours`<br>[test](src/project.test.ts) `LineBasicMaterial projects clipped RGB vertex colours as a portable gradient`<br>[test](src/project.test.ts) `transparent RGBA vertex attributes preserve alpha across portable primitives`<br>[test](src/project.test.ts) `opaque RGBA vertex attributes diagnose instead of changing blend semantics` |
306
+ | textures and UV sampling | partial | Clamped, independently repeated, or mirrored sRGB mesh, sprite, point-sprite, and 2D background colour maps use affine Canvas sampling. Mesh, point, and sprite material colours multiply linear RGB; vertex-colour/fog modulation, mipmaps, and other texture roles stay diagnostic. | [test](src/project.test.ts) `MeshBasicMaterial map and UVs become a portable textured triangle`<br>[test](src/project.test.ts) `RepeatWrapping preserves out-of-range UVs for portable tiling`<br>[test](src/project.test.ts) `mixed clamp and repeat wrapping stays portable per texture axis`<br>[test](src/project.test.ts) `mirrored wrapping preserves negative and transformed UVs on either axis`<br>[test](src/project.test.ts) `texture maps preserve linear material tint for meshes, points, and sprites`<br>[test](src/project.test.ts) `mesh clipping interpolates texture coordinates at generated edges`<br>[test](src/project.test.ts) `SpriteMaterial map preserves billboard UVs through clipping`<br>[test](src/project.test.ts) `unsupported MeshBasicMaterial features emit diagnostics`<br>[test](src/project.test.ts) `PointsMaterial map becomes a portable point-sprite texture` |
307
+ | transparency and blending | partial | Normal alpha transparency maps to Canvas opacity after opaque primitives, and uniform alphaTest discards whole primitives. Per-fragment alpha hash, MSAA alpha-to-coverage, dithering, and custom blending are diagnosed. | [test](src/project.test.ts) `normal transparent materials project opacity across portable primitives`<br>[test](src/project.test.ts) `uniform alphaTest omits every supported primitive only below its threshold`<br>[test](src/project.test.ts) `transparent primitives paint after opaque primitives`<br>[test](src/project.test.ts) `non-default depth, stencil, write, offset, blending, and sampling state emit diagnostics` |
308
+ | material clipping planes | full | World-space intersection and union clipping cut meshes, lines, and billboards, and discard points. | [test](src/project.test.ts) `material clipping planes cut meshes and lines and discard points in world space`<br>[test](src/project.test.ts) `clipIntersection retains the disjoint union of material half-spaces`<br>[test](src/project.test.ts) `Sprite clipping planes cut billboards and preserve disjoint union regions` |
309
+
310
+ #### scene
311
+
312
+ | Feature | Status | Behaviour | Test |
313
+ | --- | --- | --- | --- |
314
+ | object and material visibility | full | Invisible objects and draw calls remain absent. | [test](src/project.test.ts) `an invisible material emits neither geometry nor a diagnostic` |
315
+ | depth ordering | partial | Primitives use painter ordering, not a per-pixel depth buffer. | [test](src/project.test.ts) `far triangles are painted before near triangles` |
316
+ | Object3D.renderOrder | full | Explicit object render order groups override the portable painter depth order. | [test](src/project.test.ts) `renderOrder overrides painter depth while preserving stable object order`<br>[test](src/project.test.ts) `Group renderOrder applies to its projected descendants` |
317
+ | camera layers | full | Camera and object layer masks filter renderable objects without pruning descendants. | [test](src/project.test.ts) `camera layers filter objects without hiding matching descendants` |
318
+ | Scene.overrideMaterial | partial | Supported overrides replace eligible render-list materials while preserving visibility and allowOverride. | [test](src/project.test.ts) `Scene.overrideMaterial preserves render-list visibility and allowOverride` |
319
+ | Scene.background | partial | Solid colours and constrained 2D colour textures, including background intensity and the upstream 2D blur no-op, become non-interactive viewport decoration; environment sampling is diagnosed. | [test](src/project.test.ts) `solid scene backgrounds become non-interactive Canvas rectangles`<br>[test](src/project.test.ts) `a 2D texture background becomes a viewport-sized portable mesh`<br>[test](src/three-canvas.test.tsx) `ThreeCanvas paints scene backgrounds without creating an object control`<br>[test](src/project.test.ts) `environment backgrounds are diagnosed while portable geometry remains visible`<br>[test](src/project.test.ts) `scene background intensity modulates texture RGB`<br>[test](src/project.test.ts) `scene background blurriness is a no-op for 2D textures` |
320
+ | scene fog | partial | Fog and FogExp2 blend meshes, wireframes, lines, points, and sprites. Point and constant-depth output is exact; varying-depth gradients approximate the fragment shader at portable vertices and endpoints. | [test](src/project.test.ts) `linear fog blends mesh vertices and honours material fog opt-out`<br>[test](src/project.test.ts) `fog is evaluated at vertices created by homogeneous clipping`<br>[test](src/project.test.ts) `fog follows lines, points, sprites, and exponential density`<br>[test](src/project.test.ts) `invalid fog ranges are diagnosed instead of producing non-finite colours` |
321
+ | renderer tone mapping | out-of-scope | The portable Canvas contract fixes NoToneMapping and has no renderer tone-mapping option. | — |
322
+ | depth and stencil material state | diagnostic | Non-default depth, stencil, colour-write, polygon-offset, and blending state is rejected. | [test](src/project.test.ts) `non-default depth, stencil, write, offset, blending, and sampling state emit diagnostics` |
323
+
324
+ #### interaction
325
+
326
+ | Feature | Status | Behaviour | Test |
327
+ | --- | --- | --- | --- |
328
+ | demand invalidation | full | Revision and imperative invalidation re-project mutations. | [test](src/three-canvas.test.tsx) `ThreeCanvas draws a projected Three scene and invalidates imperative mutations`<br>[test](src/three-canvas.test.tsx) `revision re-projects imperative scene mutations` |
329
+ | continuous frame loop | full | onFrame runs before each projection and cancels on unmount. | [test](src/three-canvas.test.tsx) `the continuous loop updates before projecting and stops on unmount` |
330
+ | object raycast activation | full | Canvas activation carries the source object and intersection. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
331
+ | object semantic controls | full | Many projected shapes share one labelled control per object. | [test](src/three-canvas.test.tsx) `projected triangles raycast as one named Three object` |
332
+
333
+ ## Interpretation
334
+
335
+ Topology surface coverage can be complete while general Three.js compatibility remains low. The portable backend handles every core primitive topology and a deliberately constrained affine colour map, but general GPU materials, texture sampling, lighting, and per-pixel depth remain separate work. The capability inventory makes approximation and feasible-but-deferred work explicit; the surface table records safe rejection of upstream classes. The silent count stays visible in both models so that raising a percentage cannot hide accepted input whose semantics are lost.
@@ -0,0 +1,55 @@
1
+ import type { CSSProperties, FocusEvent } from 'react';
2
+ /**
3
+ * The two states of the control strip that stands in for a canvas.
4
+ *
5
+ * A canvas has no accessible children, so both Web surfaces build one real DOM
6
+ * control per registered object and park them off-screen. That half was right
7
+ * and is what a screen reader reads. What was missing is the other half: those
8
+ * controls are in the tab order, so a **sighted** keyboard user lands on them,
9
+ * and `clip: rect(0, 0, 0, 0)` means there is nothing to see when they do.
10
+ *
11
+ * Measured before it was fixed (#689), with `check-appearance.mjs`'s harness:
12
+ * the host is 1 by 1 with the clip above, and the button inside it is 136 by 24
13
+ * and carries Chrome's own focus ring -- `outline-style: auto` -- which is
14
+ * clipped away with everything else. So the ring existed and could not be seen,
15
+ * which is WCAG 2.4.7 rather than a missing style.
16
+ *
17
+ * Hidden-until-focused is the established answer, and it is what a skip link
18
+ * does. The strip stays clipped at rest and is revealed while focus is inside
19
+ * it.
20
+ */
21
+ export declare const accessibleOnlyStyle: CSSProperties;
22
+ /**
23
+ * The same strip, visible, over the canvas's leading corner.
24
+ *
25
+ * System colours rather than a palette, which is not a shortcut: this package
26
+ * ships no CSS and has no theme to read, and `Canvas`/`CanvasText` are the two
27
+ * colours a user agent guarantees contrast between -- including in forced-colors
28
+ * mode, where a hard-coded pair would be overridden anyway. An application that
29
+ * wants its own look passes `controlClassName`.
30
+ *
31
+ * Over the scene rather than beside it, because the alternative is a strip that
32
+ * reflows the page the moment focus enters it: a control that moves what is
33
+ * under the pointer as it appears is worse than one that covers a corner of a
34
+ * picture.
35
+ */
36
+ export declare const revealedControlsStyle: CSSProperties;
37
+ /**
38
+ * Whether focus has left the strip entirely, rather than moved within it.
39
+ *
40
+ * `blur` fires on every hop between two controls in the same strip, so hiding on
41
+ * any blur makes the strip flicker away under the second Tab -- and a strip that
42
+ * disappears while you are still inside it is worse than one that never showed.
43
+ * `relatedTarget` is where focus is going; if the strip still contains it,
44
+ * nothing has left.
45
+ *
46
+ * `relatedTarget` is `null` when focus leaves the document, which is a real
47
+ * departure and hides it correctly.
48
+ *
49
+ * Duck-typed rather than `instanceof Node`, which reads better and needs a DOM
50
+ * global: this function then throws `ReferenceError: Node is not defined` the
51
+ * moment anything outside a browser calls it, which its own test did first. A
52
+ * `nodeType` is what `contains` needs and is the thing being asked about.
53
+ */
54
+ export declare function focusLeft(event: FocusEvent<HTMLElement>): boolean;
55
+ //# sourceMappingURL=accessible-controls.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessible-controls.d.ts","sourceRoot":"","sources":["../src/accessible-controls.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;AAEtD;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,mBAAmB,EAAE,aAUjC,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,qBAAqB,EAAE,aAanC,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,SAAS,CAAC,KAAK,EAAE,UAAU,CAAC,WAAW,CAAC,GAAG,OAAO,CAIjE"}
@@ -0,0 +1,82 @@
1
+ /**
2
+ * The two states of the control strip that stands in for a canvas.
3
+ *
4
+ * A canvas has no accessible children, so both Web surfaces build one real DOM
5
+ * control per registered object and park them off-screen. That half was right
6
+ * and is what a screen reader reads. What was missing is the other half: those
7
+ * controls are in the tab order, so a **sighted** keyboard user lands on them,
8
+ * and `clip: rect(0, 0, 0, 0)` means there is nothing to see when they do.
9
+ *
10
+ * Measured before it was fixed (#689), with `check-appearance.mjs`'s harness:
11
+ * the host is 1 by 1 with the clip above, and the button inside it is 136 by 24
12
+ * and carries Chrome's own focus ring -- `outline-style: auto` -- which is
13
+ * clipped away with everything else. So the ring existed and could not be seen,
14
+ * which is WCAG 2.4.7 rather than a missing style.
15
+ *
16
+ * Hidden-until-focused is the established answer, and it is what a skip link
17
+ * does. The strip stays clipped at rest and is revealed while focus is inside
18
+ * it.
19
+ */
20
+ export const accessibleOnlyStyle = {
21
+ position: 'absolute',
22
+ width: 1,
23
+ height: 1,
24
+ padding: 0,
25
+ margin: -1,
26
+ overflow: 'hidden',
27
+ clip: 'rect(0, 0, 0, 0)',
28
+ whiteSpace: 'nowrap',
29
+ border: 0,
30
+ };
31
+ /**
32
+ * The same strip, visible, over the canvas's leading corner.
33
+ *
34
+ * System colours rather than a palette, which is not a shortcut: this package
35
+ * ships no CSS and has no theme to read, and `Canvas`/`CanvasText` are the two
36
+ * colours a user agent guarantees contrast between -- including in forced-colors
37
+ * mode, where a hard-coded pair would be overridden anyway. An application that
38
+ * wants its own look passes `controlClassName`.
39
+ *
40
+ * Over the scene rather than beside it, because the alternative is a strip that
41
+ * reflows the page the moment focus enters it: a control that moves what is
42
+ * under the pointer as it appears is worse than one that covers a corner of a
43
+ * picture.
44
+ */
45
+ export const revealedControlsStyle = {
46
+ position: 'absolute',
47
+ insetInlineStart: 0,
48
+ insetBlockStart: 0,
49
+ zIndex: 1,
50
+ display: 'flex',
51
+ flexDirection: 'row',
52
+ flexWrap: 'wrap',
53
+ gap: 4,
54
+ padding: 4,
55
+ maxWidth: '100%',
56
+ background: 'Canvas',
57
+ color: 'CanvasText',
58
+ };
59
+ /**
60
+ * Whether focus has left the strip entirely, rather than moved within it.
61
+ *
62
+ * `blur` fires on every hop between two controls in the same strip, so hiding on
63
+ * any blur makes the strip flicker away under the second Tab -- and a strip that
64
+ * disappears while you are still inside it is worse than one that never showed.
65
+ * `relatedTarget` is where focus is going; if the strip still contains it,
66
+ * nothing has left.
67
+ *
68
+ * `relatedTarget` is `null` when focus leaves the document, which is a real
69
+ * departure and hides it correctly.
70
+ *
71
+ * Duck-typed rather than `instanceof Node`, which reads better and needs a DOM
72
+ * global: this function then throws `ReferenceError: Node is not defined` the
73
+ * moment anything outside a browser calls it, which its own test did first. A
74
+ * `nodeType` is what `contains` needs and is the thing being asked about.
75
+ */
76
+ export function focusLeft(event) {
77
+ const next = event.relatedTarget;
78
+ if (!next || typeof next.nodeType !== 'number')
79
+ return true;
80
+ return !event.currentTarget.contains(next);
81
+ }
82
+ //# sourceMappingURL=accessible-controls.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"accessible-controls.js","sourceRoot":"","sources":["../src/accessible-controls.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAkB;IAChD,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,CAAC;IACR,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,CAAC;IACV,MAAM,EAAE,CAAC,CAAC;IACV,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,kBAAkB;IACxB,UAAU,EAAE,QAAQ;IACpB,MAAM,EAAE,CAAC;CACV,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAkB;IAClD,QAAQ,EAAE,UAAU;IACpB,gBAAgB,EAAE,CAAC;IACnB,eAAe,EAAE,CAAC;IAClB,MAAM,EAAE,CAAC;IACT,OAAO,EAAE,MAAM;IACf,aAAa,EAAE,KAAK;IACpB,QAAQ,EAAE,MAAM;IAChB,GAAG,EAAE,CAAC;IACN,OAAO,EAAE,CAAC;IACV,QAAQ,EAAE,MAAM;IAChB,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE,YAAY;CACpB,CAAA;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,SAAS,CAAC,KAA8B;IACtD,MAAM,IAAI,GAAG,KAAK,CAAC,aAA4B,CAAA;IAC/C,IAAI,CAAC,IAAI,IAAI,OAAO,IAAI,CAAC,QAAQ,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAA;IAC3D,OAAO,CAAC,KAAK,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAA;AAC5C,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { type Object3D, OrthographicCamera, PerspectiveCamera, Scene, TextureLoader } from 'three';
2
+ export interface SceneCorpusScene {
3
+ animation?: {
4
+ object: Object3D;
5
+ update: (delta: number) => void;
6
+ };
7
+ camera: OrthographicCamera | PerspectiveCamera;
8
+ scene: Scene;
9
+ textureImage?: {
10
+ decoding: 'fixture' | 'host';
11
+ width: number;
12
+ height: number;
13
+ };
14
+ }
15
+ export interface SceneCorpusHostOptions {
16
+ /** GPU hosts supply their image loader; Node's deterministic report uses pinned pixels. */
17
+ textureLoader?: TextureLoader;
18
+ }
19
+ export interface SceneCorpusSceneDefinition {
20
+ create: (loadGltfSource: () => Promise<string>, options?: SceneCorpusHostOptions) => Promise<SceneCorpusScene>;
21
+ id: string;
22
+ }
23
+ /**
24
+ * The tiny pinned glTF asset used by every conformance host.
25
+ *
26
+ * Keeping the source beside the scene builders lets browser, Node and React
27
+ * Native execute the same asset without teaching Metro how to import `.gltf`
28
+ * files. `fixtures/minimal-pbr.gltf` remains the human-readable copy used by
29
+ * the report and is checked against this value by the corpus test.
30
+ */
31
+ export declare const MINIMAL_PBR_GLTF_SOURCE: string;
32
+ /**
33
+ * A self-contained product-viewer asset with a node hierarchy, UVs, two PBR
34
+ * materials, a punctual light, and a rotation animation. Its small embedded
35
+ * buffer makes the same glTF loadable by the browser and Hermes probes.
36
+ */
37
+ export declare const PRODUCT_VIEWER_GLTF_SOURCE: string;
38
+ export declare const SCENE_CORPUS_SCENES: readonly SceneCorpusSceneDefinition[];
39
+ //# sourceMappingURL=conformance-scenes.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"conformance-scenes.d.ts","sourceRoot":"","sources":["../src/conformance-scenes.ts"],"names":[],"mappings":"AAAA,OAAO,EAkBL,KAAK,QAAQ,EACb,kBAAkB,EAClB,iBAAiB,EAIjB,KAAK,EAKL,aAAa,EAEd,MAAM,OAAO,CAAA;AAGd,MAAM,WAAW,gBAAgB;IAC/B,SAAS,CAAC,EAAE;QAAE,MAAM,EAAE,QAAQ,CAAC;QAAC,MAAM,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAA;KAAE,CAAA;IACjE,MAAM,EAAE,kBAAkB,GAAG,iBAAiB,CAAA;IAC9C,KAAK,EAAE,KAAK,CAAA;IACZ,YAAY,CAAC,EAAE;QAAE,QAAQ,EAAE,SAAS,GAAG,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAA;CAC/E;AAED,MAAM,WAAW,sBAAsB;IACrC,2FAA2F;IAC3F,aAAa,CAAC,EAAE,aAAa,CAAA;CAC9B;AAED,MAAM,WAAW,0BAA0B;IACzC,MAAM,EAAE,CACN,cAAc,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,EACrC,OAAO,CAAC,EAAE,sBAAsB,KAC7B,OAAO,CAAC,gBAAgB,CAAC,CAAA;IAC9B,EAAE,EAAE,MAAM,CAAA;CACX;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB,QAiClC,CAAA;AAEF;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,QA0GrC,CAAA;AAyTF,eAAO,MAAM,mBAAmB,EAAE,SAAS,0BAA0B,EAOpE,CAAA"}