@flighthq/scene3d-wgpu 0.5.1-next.1295.2b6bfa3 → 0.5.1-next.1345.0995dc5
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
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.1345.0995dc5](https://github.com/flighthq/flight/tree/0995dc5f840e6b57c3e85ecd2123aa798cf60b29/packages/scene3d-wgpu)
|
|
17
|
+
- [License](https://github.com/flighthq/flight/blob/0995dc5f840e6b57c3e85ecd2123aa798cf60b29/LICENSE.md)
|
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.1345.0995dc5",
|
|
4
4
|
"author": "Joshua Granick and other contributors",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -38,23 +38,23 @@
|
|
|
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.1345.0995dc5",
|
|
42
|
+
"@flighthq/color": "0.5.1-next.1345.0995dc5",
|
|
43
|
+
"@flighthq/entity": "0.5.1-next.1345.0995dc5",
|
|
44
|
+
"@flighthq/geometry": "0.5.1-next.1345.0995dc5",
|
|
45
|
+
"@flighthq/image": "0.5.1-next.1345.0995dc5",
|
|
46
|
+
"@flighthq/lighting": "0.5.1-next.1345.0995dc5",
|
|
47
|
+
"@flighthq/log": "0.5.1-next.1345.0995dc5",
|
|
48
|
+
"@flighthq/materials": "0.5.1-next.1345.0995dc5",
|
|
49
|
+
"@flighthq/node": "0.5.1-next.1345.0995dc5",
|
|
50
|
+
"@flighthq/registry": "0.5.1-next.1345.0995dc5",
|
|
51
|
+
"@flighthq/render": "0.5.1-next.1345.0995dc5",
|
|
52
|
+
"@flighthq/render-wgpu": "0.5.1-next.1345.0995dc5",
|
|
53
|
+
"@flighthq/scene2d-wgpu": "0.5.1-next.1345.0995dc5",
|
|
54
|
+
"@flighthq/scene3d": "0.5.1-next.1345.0995dc5",
|
|
55
|
+
"@flighthq/shading": "0.5.1-next.1345.0995dc5",
|
|
56
|
+
"@flighthq/texture": "0.5.1-next.1345.0995dc5",
|
|
57
|
+
"@flighthq/types": "0.5.1-next.1345.0995dc5"
|
|
58
58
|
},
|
|
59
59
|
"peerDependencies": {
|
|
60
60
|
"@webgpu/types": "^0.1.70"
|
|
@@ -4,7 +4,7 @@ import { createUnlitMaterial } from '@flighthq/materials/contract';
|
|
|
4
4
|
import { createBoxMeshGeometry } from '@flighthq/mesh/contract';
|
|
5
5
|
import { registerWgpuImageTextureResolver } from '@flighthq/render-wgpu/contract';
|
|
6
6
|
import { advanceVideoTexture, createVideoTexture } from '@flighthq/texture/contract';
|
|
7
|
-
import type { Camera3D, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
7
|
+
import type { Camera3D, HostVideoProvider, Scene3DLightBlock, Scene3DRenderProxy } from '@flighthq/types/contract';
|
|
8
8
|
import { UnlitMaterialKind } from '@flighthq/types/contract';
|
|
9
9
|
import { createVideoResource } from '@flighthq/video/contract';
|
|
10
10
|
|
|
@@ -30,6 +30,13 @@ const NO_LIGHTS: Scene3DLightBlock = {
|
|
|
30
30
|
version: 1,
|
|
31
31
|
};
|
|
32
32
|
|
|
33
|
+
const testVideoHost = {
|
|
34
|
+
canPlayType: () => true,
|
|
35
|
+
getHeight: (source) => (source as HTMLVideoElement).videoHeight,
|
|
36
|
+
getWidth: (source) => (source as HTMLVideoElement).videoWidth,
|
|
37
|
+
isReady: (source) => (source as HTMLVideoElement).readyState >= 2,
|
|
38
|
+
} satisfies HostVideoProvider;
|
|
39
|
+
|
|
33
40
|
function makeProxy(): Scene3DRenderProxy {
|
|
34
41
|
const geometry = createBoxMeshGeometry();
|
|
35
42
|
return {
|
|
@@ -66,8 +73,8 @@ describe('unlitWgpuMeshMaterialRenderer', () => {
|
|
|
66
73
|
videoHeight: { value: 120 },
|
|
67
74
|
videoWidth: { value: 160 },
|
|
68
75
|
});
|
|
69
|
-
material.baseColorMap = createVideoTexture(createVideoResource(element));
|
|
70
|
-
advanceVideoTexture(material.baseColorMap);
|
|
76
|
+
material.baseColorMap = createVideoTexture(testVideoHost, createVideoResource(element));
|
|
77
|
+
advanceVideoTexture(testVideoHost, material.baseColorMap);
|
|
71
78
|
registerWgpuImageTextureResolver(state);
|
|
72
79
|
unlitWgpuMeshMaterialRenderer.bind(state, material, NO_LIGHTS, makeCamera());
|
|
73
80
|
expect(fake.calls.some((c) => c.name === 'copyExternalImageToTexture')).toBe(true);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { registerWgpuImageTextureResolver } from '@flighthq/render-wgpu/contract';
|
|
2
2
|
import { advanceVideoTexture, createVideoTexture } from '@flighthq/texture/contract';
|
|
3
|
-
import type { LinearColor, WgpuUnlitDefineKey } from '@flighthq/types/contract';
|
|
3
|
+
import type { HostVideoProvider, LinearColor, WgpuUnlitDefineKey } from '@flighthq/types/contract';
|
|
4
4
|
import { createVideoResource } from '@flighthq/video/contract';
|
|
5
5
|
|
|
6
6
|
import { getWgpuScene3DRuntime } from './wgpuScene3DRuntime';
|
|
@@ -16,6 +16,12 @@ import {
|
|
|
16
16
|
|
|
17
17
|
const FLAT: WgpuUnlitDefineKey = { alphaMaskEnabled: false, doubleSided: false, hasColorMap: false };
|
|
18
18
|
const COLOR: LinearColor = [0.5, 0.25, 0.1, 1];
|
|
19
|
+
const testVideoHost = {
|
|
20
|
+
canPlayType: () => true,
|
|
21
|
+
getHeight: (source) => (source as HTMLVideoElement).videoHeight,
|
|
22
|
+
getWidth: (source) => (source as HTMLVideoElement).videoWidth,
|
|
23
|
+
isReady: (source) => (source as HTMLVideoElement).readyState >= 2,
|
|
24
|
+
} satisfies HostVideoProvider;
|
|
19
25
|
|
|
20
26
|
describe('bindWgpuUnlitSurface', () => {
|
|
21
27
|
it('creates a material bind group once per key and writes its uniform', () => {
|
|
@@ -40,8 +46,8 @@ describe('bindWgpuUnlitVideoSurface', () => {
|
|
|
40
46
|
videoHeight: { value: 120 },
|
|
41
47
|
videoWidth: { value: 160 },
|
|
42
48
|
});
|
|
43
|
-
const video = createVideoTexture(createVideoResource(element));
|
|
44
|
-
advanceVideoTexture(video);
|
|
49
|
+
const video = createVideoTexture(testVideoHost, createVideoResource(element));
|
|
50
|
+
advanceVideoTexture(testVideoHost, video);
|
|
45
51
|
registerWgpuImageTextureResolver(state);
|
|
46
52
|
bindWgpuUnlitVideoSurface(state, pipeline, {}, COLOR, 1, 0.5, video);
|
|
47
53
|
expect(fake.calls.some((c) => c.name === 'copyExternalImageToTexture')).toBe(true);
|