@flighthq/scene3d-wgpu 0.5.1-next.3260.9e8325c → 0.5.1-next.3302.76ece6b
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 +2 -2
- package/dist/wgpuPbrPrelude.js +7 -4
- package/dist/wgpuPbrPrelude.js.map +1 -1
- package/package.json +19 -19
- package/src/explainWgpuScene3DCoverage.test.ts +1 -1
- package/src/prepareWgpuScene3DForwardLights.test.ts +1 -1
- package/src/renderWgpuScene3D.test.ts +1 -1
- package/src/wgpuBlinnPhongMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuCustomShaderMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuDepthMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuEmissiveMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuEnvironmentCube.test.ts +2 -2
- package/src/wgpuLambertMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuMatcapMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuMeshPipeline.test.ts +3 -3
- package/src/wgpuMeshUpload.test.ts +4 -3
- package/src/wgpuNormalMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuPhongMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuShadowMap.test.ts +1 -1
- package/src/wgpuSpecularGlossinessPbrMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuStandardPbrMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuToonMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuUnlitMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuVertexColorMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuWireframeMeshMaterialRenderer.test.ts +1 -1
- package/src/wgpuWireframeUpload.test.ts +1 -1
package/README.md
CHANGED
|
@@ -13,5 +13,5 @@ Import the supported application-facing API from `@flighthq/scene3d-wgpu`. The `
|
|
|
13
13
|
This package is part of the locked-version Flight SDK graph. Applications may instead install and import `@flighthq/sdk` when package-level tree shaking is sufficient.
|
|
14
14
|
|
|
15
15
|
- [Flight project](https://github.com/flighthq/flight)
|
|
16
|
-
- [Source for @flighthq/scene3d-wgpu@0.5.1-next.
|
|
17
|
-
- [License](https://github.com/flighthq/flight/blob/
|
|
16
|
+
- [Source for @flighthq/scene3d-wgpu@0.5.1-next.3302.76ece6b](https://github.com/flighthq/flight/tree/76ece6bee38e3d07816f341b7f017bfcec3e8e29/packages/scene3d-wgpu)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/76ece6bee38e3d07816f341b7f017bfcec3e8e29/LICENSE.md)
|
package/dist/wgpuPbrPrelude.js
CHANGED
|
@@ -121,7 +121,7 @@ struct Draw {
|
|
|
121
121
|
world : mat4x4f,
|
|
122
122
|
normalMatrix : mat3x3f,
|
|
123
123
|
uvTransform : mat3x3f, // KHR_texture_transform of the base-color map (identity when unused)
|
|
124
|
-
params : vec4f, // x = resolved object alpha
|
|
124
|
+
params : vec4f, // x = resolved object alpha, y = alpha-is-coverage flag
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
// The 48-float MaterialBlock: the base StandardPbr block (vec4 0..3) plus one vec4 slot per extension
|
|
@@ -212,13 +212,16 @@ struct VertexOutput {
|
|
|
212
212
|
// is a no-op there and the family needs no second pipeline variant. Without it an InstancedMesh drawn
|
|
213
213
|
// with a PBR material renders every instance stacked at the node origin — the geometry is placed by the
|
|
214
214
|
// vertex stage, so a shader that ignores these attributes ignores the whole batch's placement.
|
|
215
|
+
var localPosition = vec4f(position, 1.0);
|
|
216
|
+
var localNormal = normal;
|
|
217
|
+
var localTangent = tangent.xyz;
|
|
215
218
|
let instanceModel = mat4x4f(instanceModel0, instanceModel1, instanceModel2, instanceModel3);
|
|
216
219
|
// The instance rotation/scale also carries the normal and tangent, or a rotated instance would light as
|
|
217
220
|
// though it were still in the batch's bind orientation.
|
|
218
221
|
let instanceBasis = mat3x3f(instanceModel[0].xyz, instanceModel[1].xyz, instanceModel[2].xyz);
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
+
localPosition = instanceModel * localPosition;
|
|
223
|
+
localNormal = instanceBasis * localNormal;
|
|
224
|
+
localTangent = instanceBasis * localTangent;
|
|
222
225
|
let world = draw.world * localPosition;
|
|
223
226
|
out.worldPosition = world.xyz;
|
|
224
227
|
out.clipPosition = frame.viewProjection * world;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wgpuPbrPrelude.js","sourceRoot":"","sources":["../src/wgpuPbrPrelude.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,gCAAgC,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AACvG,sGAAsG;AACtG,uGAAuG;AACvG,uGAAuG;AACvG,0FAA0F;AAC1F,gGAAgG;AAChG,oGAAoG;AACpG,qGAAqG;AACrG,sGAAsG;AACtG,mGAAmG;AACnG,yDAAyD;AACzD,EAAE;AACF,oGAAoG;AACpG,qGAAqG;AACrG,iGAAiG;AACjG,uGAAuG;AACvG,6FAA6F;AAC7F,4BAA4B;AAC5B,EAAE;AACF,8FAA8F;AAC9F,mGAAmG;AACnG,iGAAiG;AACjG,qGAAqG;AACrG,2FAA2F;AAC3F,EAAE;AACF,gEAAgE;AAChE,+FAA+F;AAC/F,kFAAkF;AAClF,oGAAoG;AACpG,sGAAsG;AACtG,yEAAyE;AACzE,yGAAyG;AACzG,4FAA4F;AAC5F,sGAAsG;AACtG,iGAAiG;AACjG,sGAAsG;AACtG,oGAAoG;AACpG,0FAA0F;AAC1F,MAAM,UAAU,qBAAqB,CAAC,GAA+B;IACnE,OAAO,CACL,GAAG,GAAG,CAAC,gBAAgB,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE;QACrC,GAAG,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE;QAChC,GAAG,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqX7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@flighthq/scene3d-wgpu",
|
|
3
|
-
"version": "0.5.1-next.
|
|
3
|
+
"version": "0.5.1-next.3302.76ece6b",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,29 +38,29 @@
|
|
|
38
38
|
"clean:dist": "tsx ../../scripts/clean-package-dist.ts"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@flighthq/camera": "0.5.1-next.
|
|
42
|
-
"@flighthq/color": "0.5.1-next.
|
|
43
|
-
"@flighthq/entity": "0.5.1-next.
|
|
44
|
-
"@flighthq/geometry": "0.5.1-next.
|
|
45
|
-
"@flighthq/image": "0.5.1-next.
|
|
46
|
-
"@flighthq/lighting": "0.5.1-next.
|
|
47
|
-
"@flighthq/log": "0.5.1-next.
|
|
48
|
-
"@flighthq/materials": "0.5.1-next.
|
|
49
|
-
"@flighthq/node": "0.5.1-next.
|
|
50
|
-
"@flighthq/registry": "0.5.1-next.
|
|
51
|
-
"@flighthq/render": "0.5.1-next.
|
|
52
|
-
"@flighthq/render-wgpu": "0.5.1-next.
|
|
53
|
-
"@flighthq/scene2d-wgpu": "0.5.1-next.
|
|
54
|
-
"@flighthq/scene3d": "0.5.1-next.
|
|
55
|
-
"@flighthq/shading": "0.5.1-next.
|
|
56
|
-
"@flighthq/texture": "0.5.1-next.
|
|
57
|
-
"@flighthq/types": "0.5.1-next.
|
|
41
|
+
"@flighthq/camera": "0.5.1-next.3302.76ece6b",
|
|
42
|
+
"@flighthq/color": "0.5.1-next.3302.76ece6b",
|
|
43
|
+
"@flighthq/entity": "0.5.1-next.3302.76ece6b",
|
|
44
|
+
"@flighthq/geometry": "0.5.1-next.3302.76ece6b",
|
|
45
|
+
"@flighthq/image": "0.5.1-next.3302.76ece6b",
|
|
46
|
+
"@flighthq/lighting": "0.5.1-next.3302.76ece6b",
|
|
47
|
+
"@flighthq/log": "0.5.1-next.3302.76ece6b",
|
|
48
|
+
"@flighthq/materials": "0.5.1-next.3302.76ece6b",
|
|
49
|
+
"@flighthq/node": "0.5.1-next.3302.76ece6b",
|
|
50
|
+
"@flighthq/registry": "0.5.1-next.3302.76ece6b",
|
|
51
|
+
"@flighthq/render": "0.5.1-next.3302.76ece6b",
|
|
52
|
+
"@flighthq/render-wgpu": "0.5.1-next.3302.76ece6b",
|
|
53
|
+
"@flighthq/scene2d-wgpu": "0.5.1-next.3302.76ece6b",
|
|
54
|
+
"@flighthq/scene3d": "0.5.1-next.3302.76ece6b",
|
|
55
|
+
"@flighthq/shading": "0.5.1-next.3302.76ece6b",
|
|
56
|
+
"@flighthq/texture": "0.5.1-next.3302.76ece6b",
|
|
57
|
+
"@flighthq/types": "0.5.1-next.3302.76ece6b"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@webgpu/types": "^0.1.70"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
|
-
"@flighthq/
|
|
63
|
+
"@flighthq/meshgeometry": "*",
|
|
64
64
|
"@flighthq/particleemitter": "*",
|
|
65
65
|
"@flighthq/video": "*",
|
|
66
66
|
"@webgpu/types": "*",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
1
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
2
2
|
import { addNodeChild } from '@flighthq/node/contract';
|
|
3
3
|
import { createMesh, createScene3D, createScene3DKindUsage, getScene3DKindUsage } from '@flighthq/scene3d/contract';
|
|
4
4
|
import { createRimModifier, createShadedMaterial } from '@flighthq/shading/contract';
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
setCamera3DViewMatrix4FromLookAt,
|
|
5
5
|
} from '@flighthq/camera/contract';
|
|
6
6
|
import { createPointLight, createSpotLight } from '@flighthq/lighting/contract';
|
|
7
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
7
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
8
8
|
import { addNodeChild } from '@flighthq/node/contract';
|
|
9
9
|
import { prepareScene3DRender } from '@flighthq/render/contract';
|
|
10
10
|
import { createMesh, createNode3D, Node3DKind } from '@flighthq/scene3d/contract';
|
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
CANONICAL_SKINNED_MESH_GEOMETRY_LAYOUT,
|
|
12
12
|
createBoxMeshGeometry,
|
|
13
13
|
createMeshGeometry,
|
|
14
|
-
} from '@flighthq/
|
|
14
|
+
} from '@flighthq/meshgeometry/contract';
|
|
15
15
|
import { addNodeChild, invalidateNodeLocalTransform } from '@flighthq/node/contract';
|
|
16
16
|
import { createParticleEmitter3D, reserveParticleEmitter3D } from '@flighthq/particleemitter/contract';
|
|
17
17
|
import { createWgpuOffscreenRenderState, getWgpuRenderStateRuntime } from '@flighthq/render-wgpu/contract';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createBlinnPhongMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Matrix3, Matrix4, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { BlinnPhongMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createCustomShaderMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import { getWgpuRenderStateRuntime, registerWgpuImageTextureResolver } from '@flighthq/render-wgpu/contract';
|
|
6
6
|
import { createTexture } from '@flighthq/texture/contract';
|
|
7
7
|
import type { Camera3D, ImageResource, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createDepthMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { DepthMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createEmissiveMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { EmissiveMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -30,7 +30,7 @@ function completeEnvironment(): Environment {
|
|
|
30
30
|
|
|
31
31
|
function dataFace(): Bitmap {
|
|
32
32
|
return {
|
|
33
|
-
data: new
|
|
33
|
+
data: new Uint8Array(4 * 4 * 4),
|
|
34
34
|
height: 4,
|
|
35
35
|
kind: BitmapTextureSourceKind,
|
|
36
36
|
width: 4,
|
|
@@ -74,7 +74,7 @@ describe('ensureWgpuEnvironmentSourceCube', () => {
|
|
|
74
74
|
expect(fake.calls.filter((c) => c.name === 'copyExternalImageToTexture').length).toBe(0);
|
|
75
75
|
// rgba8 data face: tightly-packed rows of width*4 bytes.
|
|
76
76
|
expect((writes[0].args[2] as { bytesPerRow: number }).bytesPerRow).toBe(16);
|
|
77
|
-
expect(writes[0].args[1]).toBeInstanceOf(
|
|
77
|
+
expect(writes[0].args[1]).toBeInstanceOf(Uint8Array);
|
|
78
78
|
});
|
|
79
79
|
|
|
80
80
|
it('uses a linear GPU format for a linear source cube', () => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createLambertMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Matrix3, Matrix4, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { LambertMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createMatcapMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { MatcapMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createOrthographicProjection, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createStandardPbrMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry, createMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry, createMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import { getWgpuRenderStateDeviceResources, getWgpuRenderStateRuntime } from '@flighthq/render-wgpu/contract';
|
|
6
6
|
import { createTexture, setTextureUvOffset, setTextureUvScale } from '@flighthq/texture/contract';
|
|
7
7
|
import type {
|
|
@@ -918,7 +918,7 @@ describe('isWgpuTextureReady', () => {
|
|
|
918
918
|
isWgpuTextureReady({
|
|
919
919
|
dimension: '2d',
|
|
920
920
|
source: {
|
|
921
|
-
data: new
|
|
921
|
+
data: new Uint8Array(4),
|
|
922
922
|
height: 1,
|
|
923
923
|
kind: BitmapTextureSourceKind,
|
|
924
924
|
version: 0,
|
|
@@ -1118,7 +1118,7 @@ describe('writeWgpuDrawUniform', () => {
|
|
|
1118
1118
|
it('packs a full color matrix into the existing 256-byte draw slot', () => {
|
|
1119
1119
|
const { state } = makeWgpuScene3DState();
|
|
1120
1120
|
const proxy = makeProxy();
|
|
1121
|
-
proxy.colorMatrix = [1, 0.5, 0, 0, 0.1, 0, 1, 0, 0, 0.2, 0, 0, 1, 0, 0.3, 0, 0, 0, 1, 0.4];
|
|
1121
|
+
proxy.colorMatrix = new Float32Array([1, 0.5, 0, 0, 0.1, 0, 1, 0, 0, 0.2, 0, 0, 1, 0, 0.3, 0, 0, 0, 1, 0.4]);
|
|
1122
1122
|
writeWgpuDrawUniform(state, proxy);
|
|
1123
1123
|
const u = getWgpuRenderStateRuntime(state).uniformData;
|
|
1124
1124
|
expect(Array.from(u.slice(44, 48))).toEqual([1, 0.5, 0, 0]);
|
|
@@ -4,9 +4,8 @@ import {
|
|
|
4
4
|
createMeshGeometry,
|
|
5
5
|
invalidateMeshGeometry,
|
|
6
6
|
setMeshGeometrySkinBindPose,
|
|
7
|
-
|
|
8
|
-
} from '@flighthq/
|
|
9
|
-
import { createMesh } from '@flighthq/scene3d/contract';
|
|
7
|
+
} from '@flighthq/meshgeometry/contract';
|
|
8
|
+
import { createMesh, updateMeshMorph } from '@flighthq/scene3d/contract';
|
|
10
9
|
import type { MeshGeometryRuntime, MeshMorph, VertexAttributeLayout } from '@flighthq/types/contract';
|
|
11
10
|
import { EntityRuntimeKey } from '@flighthq/types/contract';
|
|
12
11
|
|
|
@@ -98,6 +97,7 @@ describe('ensureWgpuMeshUpload', () => {
|
|
|
98
97
|
});
|
|
99
98
|
setMeshGeometrySkinBindPose(geometry, {
|
|
100
99
|
joints: new Float32Array([0, 0, 0, 0]),
|
|
100
|
+
lastSkinVersion: -1,
|
|
101
101
|
normals: new Float32Array([0, 1, 0]),
|
|
102
102
|
positions: new Float32Array([1, 2, 3]),
|
|
103
103
|
skinnedNormals: new Float32Array(3),
|
|
@@ -155,6 +155,7 @@ describe('ensureWgpuMeshUpload', () => {
|
|
|
155
155
|
geometry.vertices[0] = 1;
|
|
156
156
|
setMeshGeometrySkinBindPose(geometry, {
|
|
157
157
|
joints: new Float32Array([0, 0, 0, 0]),
|
|
158
|
+
lastSkinVersion: -1,
|
|
158
159
|
normals: new Float32Array([0, 1, 0]),
|
|
159
160
|
positions: new Float32Array([1, 0, 0]),
|
|
160
161
|
skinnedNormals: new Float32Array(3),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createNormalMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { NormalMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createPhongMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Matrix3, Matrix4, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { PhongMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
CANONICAL_SKINNED_MESH_GEOMETRY_LAYOUT,
|
|
13
13
|
createBoxMeshGeometry,
|
|
14
14
|
createMeshGeometry,
|
|
15
|
-
} from '@flighthq/
|
|
15
|
+
} from '@flighthq/meshgeometry/contract';
|
|
16
16
|
import { addNodeChild } from '@flighthq/node/contract';
|
|
17
17
|
import { getWgpuRenderStateRuntime } from '@flighthq/render-wgpu/contract';
|
|
18
18
|
import {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createSpecularGlossinessPbrMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Matrix3, Matrix4, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { SpecularGlossinessPbrMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createStandardPbrMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type {
|
|
6
6
|
Camera3D,
|
|
7
7
|
Matrix3,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createToonMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Matrix3, Matrix4, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { ToonMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createUnlitMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import { registerWgpuImageTextureResolver } from '@flighthq/render-wgpu/contract';
|
|
6
6
|
import { advanceVideoTexture, createVideoTexture } from '@flighthq/texture/contract';
|
|
7
7
|
import type { Camera3D, HostVideoCapability, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createVertexColorMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
6
6
|
import { VertexColorMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createCamera3D, createPerspectiveProjection } from '@flighthq/camera/contract';
|
|
2
2
|
import { createMatrix3, createMatrix4 } from '@flighthq/geometry/contract';
|
|
3
3
|
import { createWireframeMaterial } from '@flighthq/materials/contract';
|
|
4
|
-
import { createBoxMeshGeometry } from '@flighthq/
|
|
4
|
+
import { createBoxMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
5
5
|
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy, WgpuSkinningAdapter } from '@flighthq/types/contract';
|
|
6
6
|
import { WireframeMaterialKind } from '@flighthq/types/contract';
|
|
7
7
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createBoxMeshGeometry, createMeshGeometry } from '@flighthq/
|
|
1
|
+
import { createBoxMeshGeometry, createMeshGeometry } from '@flighthq/meshgeometry/contract';
|
|
2
2
|
import type { WgpuSkinningAdapter } from '@flighthq/types/contract';
|
|
3
3
|
|
|
4
4
|
import { getWgpuScene3DRuntime } from './wgpuScene3DRuntime.ts';
|