react-native-wgpu 0.1.3 → 0.1.4

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 (46) hide show
  1. package/ios/SurfaceUtils.mm +0 -1
  2. package/lib/commonjs/index.js +1 -1
  3. package/lib/module/index.js +1 -1
  4. package/lib/typescript/lib/module/WebGPUViewNativeComponent.d.ts +0 -1
  5. package/lib/typescript/src/Canvas.d.ts +0 -2
  6. package/lib/typescript/src/Canvas.d.ts.map +1 -1
  7. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts +0 -1
  8. package/lib/typescript/src/WebGPUViewNativeComponent.d.ts.map +1 -1
  9. package/lib/typescript/src/utils.d.ts +0 -1
  10. package/lib/typescript/src/utils.d.ts.map +1 -1
  11. package/libs/android/arm64-v8a/libwebgpu_dawn.so +0 -0
  12. package/libs/android/armeabi-v7a/libwebgpu_dawn.so +0 -0
  13. package/libs/android/x86/libwebgpu_dawn.so +0 -0
  14. package/libs/android/x86_64/libwebgpu_dawn.so +0 -0
  15. package/libs/ios/arm64_iphoneos/libwebgpu_dawn.a +0 -0
  16. package/libs/ios/arm64_iphonesimulator/libwebgpu_dawn.a +0 -0
  17. package/libs/ios/arm64_xros/libwebgpu_dawn.a +0 -0
  18. package/libs/ios/arm64_xrsimulator/libwebgpu_dawn.a +0 -0
  19. package/libs/ios/libwebgpu_dawn.a +0 -0
  20. package/libs/ios/libwebgpu_dawn.xcframework/Info.plist +31 -0
  21. package/libs/ios/libwebgpu_dawn.xcframework/ios-arm64/libwebgpu_dawn.a +0 -0
  22. package/libs/ios/libwebgpu_dawn.xcframework/ios-arm64_x86_64-simulator/libwebgpu_dawn.a +0 -0
  23. package/libs/ios/libwebgpu_dawn.xcframework/xros-arm64/libwebgpu_dawn.a +0 -0
  24. package/libs/ios/libwebgpu_dawn.xcframework/xros-arm64_x86_64-simulator/libwebgpu_dawn_visionos.a +0 -0
  25. package/libs/ios/libwebgpu_dawn_visionos.a +0 -0
  26. package/libs/ios/x86_64_iphonesimulator/libwebgpu_dawn.a +0 -0
  27. package/libs/ios/x86_64_xrsimulator/libwebgpu_dawn.a +0 -0
  28. package/package.json +3 -20
  29. package/react-native-wgpu.podspec +1 -1
  30. package/src/index.tsx +1 -1
  31. package/lib/typescript/example/src/Triangle/triangle.d.ts +0 -3
  32. package/lib/typescript/example/src/Triangle/triangle.d.ts.map +0 -1
  33. package/lib/typescript/example/src/Wireframe/Shaders.d.ts +0 -3
  34. package/lib/typescript/example/src/Wireframe/Shaders.d.ts.map +0 -1
  35. package/lib/typescript/example/src/Wireframe/models.d.ts +0 -29
  36. package/lib/typescript/example/src/Wireframe/models.d.ts.map +0 -1
  37. package/lib/typescript/example/src/components/DrawingContext.d.ts +0 -13
  38. package/lib/typescript/example/src/components/DrawingContext.d.ts.map +0 -1
  39. package/lib/typescript/example/src/components/cube.d.ts +0 -7
  40. package/lib/typescript/example/src/components/cube.d.ts.map +0 -1
  41. package/lib/typescript/example/src/components/meshes/sphere.d.ts +0 -12
  42. package/lib/typescript/example/src/components/meshes/sphere.d.ts.map +0 -1
  43. package/lib/typescript/example/src/components/meshes/teapot.d.ts +0 -6
  44. package/lib/typescript/example/src/components/meshes/teapot.d.ts.map +0 -1
  45. package/lib/typescript/example/src/components/meshes/utils.d.ts +0 -10
  46. package/lib/typescript/example/src/components/meshes/utils.d.ts.map +0 -1
@@ -10,7 +10,6 @@
10
10
  size:(CGSize)size
11
11
  contextId:(int)contextId {
12
12
  std::shared_ptr<rnwgpu::RNWebGPUManager> manager = [WebGPUModule getManager];
13
- CGFloat scaleFactor = [UIScreen mainScreen].scale;
14
13
  void *nativeSurface = (__bridge void *)layer;
15
14
  manager->surfacesRegistry.addSurface(contextId, nativeSurface, size.width,
16
15
  size.height);
@@ -203,7 +203,7 @@ if (!navigator) {
203
203
  navigator.gpu = RNWebGPU.gpu;
204
204
 
205
205
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
206
- // @ts-expect-error
206
+ // @ts-ignore
207
207
  navigator.userAgent = "react-native";
208
208
  global.createImageBitmap = global.createImageBitmap ?? ((...params) => new Promise(resolve => resolve(RNWebGPU.createImageBitmap(...params))));
209
209
  //# sourceMappingURL=index.js.map
@@ -155,7 +155,7 @@ if (!navigator) {
155
155
  navigator.gpu = RNWebGPU.gpu;
156
156
 
157
157
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
158
- // @ts-expect-error
158
+ // @ts-ignore
159
159
  navigator.userAgent = "react-native";
160
160
  global.createImageBitmap = global.createImageBitmap ?? ((...params) => new Promise(resolve => resolve(RNWebGPU.createImageBitmap(...params))));
161
161
  //# sourceMappingURL=index.js.map
@@ -1,4 +1,3 @@
1
- /// <reference types="react-native/types/modules/Codegen" />
2
1
  declare const _default: import("react-native/Libraries/Utilities/codegenNativeComponent").NativeComponentType<object>;
3
2
  export default _default;
4
3
  //# sourceMappingURL=WebGPUViewNativeComponent.d.ts.map
@@ -1,5 +1,3 @@
1
- /// <reference types="@webgpu/types" />
2
- /// <reference types="node" />
3
1
  import type { ViewProps } from "react-native";
4
2
  declare global {
5
3
  var __WebGPUContextRegistry: Record<number, NativeCanvas>;
@@ -1 +1 @@
1
- {"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../../../src/Canvas.tsx"],"names":[],"mappings":";;AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAW9C,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAE1D,IAAI,QAAQ,EAAE;QACZ,GAAG,EAAE,GAAG,CAAC;QACT,uBAAuB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,aAAa,CAAC;QACvE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,GAAG,WAAW,KAAK,MAAM,CAAC;QACvE,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;KAC7C,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAKD,KAAK,aAAa,GAAG,gBAAgB,GAAG;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,YAAY,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,WAAW,EAAE,QAAQ,GAAG,aAAa,GAAG,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,MAAM,iGA6BjB,CAAC"}
1
+ {"version":3,"file":"Canvas.d.ts","sourceRoot":"","sources":["../../../src/Canvas.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAW9C,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,uBAAuB,EAAE,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;IAE1D,IAAI,QAAQ,EAAE;QACZ,GAAG,EAAE,GAAG,CAAC;QACT,uBAAuB,EAAE,CAAC,YAAY,EAAE,YAAY,KAAK,aAAa,CAAC;QACvE,YAAY,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,GAAG,WAAW,KAAK,MAAM,CAAC;QACvE,iBAAiB,EAAE,OAAO,iBAAiB,CAAC;KAC7C,CAAC;CACH;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,WAAW,EAAE,MAAM,CAAC;IACpB,YAAY,EAAE,MAAM,CAAC;CACtB;AAKD,KAAK,aAAa,GAAG,gBAAgB,GAAG;IACtC,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,gBAAgB,EAAE,MAAM,YAAY,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,SAAS;IACxB,UAAU,CAAC,WAAW,EAAE,QAAQ,GAAG,aAAa,GAAG,IAAI,CAAC;CACzD;AAED,eAAO,MAAM,MAAM,iGA6BjB,CAAC"}
@@ -1,4 +1,3 @@
1
- /// <reference types="react-native/types/modules/Codegen" />
2
1
  import type { ViewProps } from "react-native";
3
2
  import type { Int32 } from "react-native/Libraries/Types/CodegenTypes";
4
3
  interface NativeProps extends ViewProps {
@@ -1 +1 @@
1
- {"version":3,"file":"WebGPUViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/WebGPUViewNativeComponent.ts"],"names":[],"mappings":";AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAEvE,UAAU,WAAY,SAAQ,SAAS;IACrC,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB;;AAGD,wBAAiE"}
1
+ {"version":3,"file":"WebGPUViewNativeComponent.d.ts","sourceRoot":"","sources":["../../../src/WebGPUViewNativeComponent.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAEvE,UAAU,WAAY,SAAQ,SAAS;IACrC,SAAS,CAAC,EAAE,KAAK,CAAC;CACnB;;AAGD,wBAAiE"}
@@ -1,4 +1,3 @@
1
- /// <reference types="@webgpu/types" />
2
1
  import type { CanvasRef } from "./Canvas";
3
2
  type Unsubscribe = () => void;
4
3
  export declare const warnIfNotHardwareAccelerated: (adapter: GPUAdapter) => void;
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,4BAA4B,YAAa,UAAU,SAM/D,CAAC;AAEF,eAAO,MAAM,eAAe,WAClB,MAAM,IAAI,GAAG,WAAW,GAAG,QAAQ,IAAI,GAAG,WAAW,CAAC,yCAwB/D,CAAC"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,KAAK,WAAW,GAAG,MAAM,IAAI,CAAC;AAE9B,eAAO,MAAM,4BAA4B,YAAa,UAAU,SAM/D,CAAC;AAEF,eAAO,MAAM,eAAe,WAClB,MAAM,IAAI,GAAG,WAAW,GAAG,OAAO,CAAC,IAAI,GAAG,WAAW,CAAC,yCAwB/D,CAAC"}
Binary file
Binary file
@@ -21,6 +21,23 @@
21
21
  <key>SupportedPlatformVariant</key>
22
22
  <string>simulator</string>
23
23
  </dict>
24
+ <dict>
25
+ <key>BinaryPath</key>
26
+ <string>libwebgpu_dawn_visionos.a</string>
27
+ <key>LibraryIdentifier</key>
28
+ <string>xros-arm64_x86_64-simulator</string>
29
+ <key>LibraryPath</key>
30
+ <string>libwebgpu_dawn_visionos.a</string>
31
+ <key>SupportedArchitectures</key>
32
+ <array>
33
+ <string>arm64</string>
34
+ <string>x86_64</string>
35
+ </array>
36
+ <key>SupportedPlatform</key>
37
+ <string>xros</string>
38
+ <key>SupportedPlatformVariant</key>
39
+ <string>simulator</string>
40
+ </dict>
24
41
  <dict>
25
42
  <key>BinaryPath</key>
26
43
  <string>libwebgpu_dawn.a</string>
@@ -35,6 +52,20 @@
35
52
  <key>SupportedPlatform</key>
36
53
  <string>ios</string>
37
54
  </dict>
55
+ <dict>
56
+ <key>BinaryPath</key>
57
+ <string>libwebgpu_dawn.a</string>
58
+ <key>LibraryIdentifier</key>
59
+ <string>xros-arm64</string>
60
+ <key>LibraryPath</key>
61
+ <string>libwebgpu_dawn.a</string>
62
+ <key>SupportedArchitectures</key>
63
+ <array>
64
+ <string>arm64</string>
65
+ </array>
66
+ <key>SupportedPlatform</key>
67
+ <string>xros</string>
68
+ </dict>
38
69
  </array>
39
70
  <key>CFBundlePackageType</key>
40
71
  <string>XFWK</string>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-wgpu",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "React Native WebGPU",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -28,12 +28,10 @@
28
28
  "!**/.*"
29
29
  ],
30
30
  "scripts": {
31
- "example": "yarn workspace react-native-webgpu-example",
32
31
  "test": "jest -i",
33
32
  "test:ref": "REFERENCE=true yarn test -i",
34
33
  "tsc": "tsc --noEmit",
35
- "lint": "eslint \"**/*.{ts,tsx}\"",
36
- "clean": "del-cli android/build example/android/build example/android/app/build example/ios/build lib",
34
+ "lint": "eslint . --ext .ts,.tsx --max-warnings 0 --cache --fix",
37
35
  "prepare": "bob build",
38
36
  "build-dawn": "ts-node scripts/build/dawn.ts",
39
37
  "clean-dawn": "rimraf ./libs && rimraf ../externals/dawn/out",
@@ -64,7 +62,6 @@
64
62
  "registry": "https://registry.npmjs.org/"
65
63
  },
66
64
  "devDependencies": {
67
- "@react-native/eslint-config": "^0.74.84",
68
65
  "@types/jest": "^29.5.12",
69
66
  "@types/lodash": "^4.17.5",
70
67
  "@types/node": "^20.14.7",
@@ -73,14 +70,9 @@
73
70
  "@types/react": "^18.2.44",
74
71
  "@types/seedrandom": "^3.0.8",
75
72
  "@types/ws": "^8.5.10",
76
- "@typescript-eslint/eslint-plugin": "^7.13.1",
77
- "@webgpu/types": "^0.1.42",
73
+ "@webgpu/types": "^0.1.44",
78
74
  "clang-format": "^1.8.0",
79
75
  "del-cli": "^5.1.0",
80
- "eslint": "8",
81
- "eslint-config-react-native-wcandillon": "^3.10.2",
82
- "eslint-plugin-import": "^2.29.1",
83
- "eslint-plugin-prettier": "^5.1.3",
84
76
  "jest": "^29.7.0",
85
77
  "lodash": "^4.17.21",
86
78
  "pixelmatch": "5.3.0",
@@ -96,22 +88,13 @@
96
88
  "ts-morph": "^22.0.0",
97
89
  "ts-node": "^10.9.2",
98
90
  "turbo": "^1.10.7",
99
- "typescript": "^5.2.2",
100
91
  "wgpu-matrix": "^3.0.2",
101
92
  "ws": "^8.18.0"
102
93
  },
103
- "resolutions": {
104
- "@types/react": "^18.2.44",
105
- "@webgpu/types": "^0.1.42"
106
- },
107
94
  "peerDependencies": {
108
95
  "react": "*",
109
96
  "react-native": "*"
110
97
  },
111
- "workspaces": [
112
- "example"
113
- ],
114
- "packageManager": "yarn@3.6.1",
115
98
  "react-native-builder-bob": {
116
99
  "source": "src",
117
100
  "output": "lib",
@@ -11,7 +11,7 @@ Pod::Spec.new do |s|
11
11
  s.license = package["license"]
12
12
  s.authors = package["author"]
13
13
 
14
- s.platforms = { :ios => min_ios_version_supported }
14
+ s.platforms = { :ios => min_ios_version_supported, :visionos => "1.0" }
15
15
  s.source = { :git => "https://github.com/wcandillon/react-native-webgpu.git", :tag => "#{s.version}" }
16
16
 
17
17
  s.source_files = [
package/src/index.tsx CHANGED
@@ -187,7 +187,7 @@ if (!navigator) {
187
187
  navigator.gpu = RNWebGPU.gpu;
188
188
 
189
189
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
190
- // @ts-expect-error
190
+ // @ts-ignore
191
191
  navigator.userAgent = "react-native";
192
192
 
193
193
  global.createImageBitmap =
@@ -1,3 +0,0 @@
1
- export declare const triangleVertWGSL = "@vertex\nfn main(\n @builtin(vertex_index) VertexIndex : u32\n) -> @builtin(position) vec4f {\n var pos = array<vec2f, 3>(\n vec2(0.0, 0.5),\n vec2(-0.5, -0.5),\n vec2(0.5, -0.5)\n );\n\n return vec4f(pos[VertexIndex], 0.0, 1.0);\n}";
2
- export declare const redFragWGSL = "@fragment\nfn main() -> @location(0) vec4f {\n return vec4(1.0, 0.0, 0.0, 1.0);\n}";
3
- //# sourceMappingURL=triangle.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"triangle.d.ts","sourceRoot":"","sources":["../../../../../example/src/Triangle/triangle.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,gBAAgB,0PAW3B,CAAC;AAEH,eAAO,MAAM,WAAW,wFAGtB,CAAC"}
@@ -1,3 +0,0 @@
1
- export declare const solidColorLitWGSL = "struct Uniforms {\n worldViewProjectionMatrix: mat4x4f,\n worldMatrix: mat4x4f,\n color: vec4f,\n};\n\nstruct Vertex {\n @location(0) position: vec4f,\n @location(1) normal: vec3f,\n};\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n @location(0) normal: vec3f,\n};\n\n@group(0) @binding(0) var<uniform> uni: Uniforms;\n\n@vertex fn vs(vin: Vertex) -> VSOut {\n var vOut: VSOut;\n vOut.position = uni.worldViewProjectionMatrix * vin.position;\n vOut.normal = (uni.worldMatrix * vec4f(vin.normal, 0)).xyz;\n return vOut;\n}\n\n@fragment fn fs(vin: VSOut) -> @location(0) vec4f {\n let lightDirection = normalize(vec3f(4, 10, 6));\n let light = dot(normalize(vin.normal), lightDirection) * 0.5 + 0.5;\n return vec4f(uni.color.rgb * light, uni.color.a);\n}";
2
- export declare const wireframeWGSL = "struct Uniforms {\n worldViewProjectionMatrix: mat4x4f,\n worldMatrix: mat4x4f,\n color: vec4f,\n};\n\nstruct LineUniforms {\n stride: u32,\n thickness: f32,\n alphaThreshold: f32,\n};\n\nstruct VSOut {\n @builtin(position) position: vec4f,\n};\n\n@group(0) @binding(0) var<uniform> uni: Uniforms;\n@group(0) @binding(1) var<storage, read> positions: array<f32>;\n@group(0) @binding(2) var<storage, read> indices: array<u32>;\n@group(0) @binding(3) var<uniform> line: LineUniforms;\n\n@vertex fn vsIndexedU32(@builtin(vertex_index) vNdx: u32) -> VSOut {\n // indices make a triangle so for every 3 indices we need to output\n // 6 values\n let triNdx = vNdx / 6;\n // 0 1 0 1 0 1 0 1 0 1 0 1 vNdx % 2\n // 0 0 1 1 2 2 3 3 4 4 5 5 vNdx / 2\n // 0 1 1 2 2 3 3 4 4 5 5 6 vNdx % 2 + vNdx / 2\n // 0 1 1 2 2 0 0 1 1 2 2 0 (vNdx % 2 + vNdx / 2) % 3\n let vertNdx = (vNdx % 2 + vNdx / 2) % 3;\n let index = indices[triNdx * 3 + vertNdx];\n\n // note:\n //\n // * if your indices are U16 you could use this\n //\n // let indexNdx = triNdx * 3 + vertNdx;\n // let twoIndices = indices[indexNdx / 2]; // indices is u32 but we want u16\n // let index = (twoIndices >> ((indexNdx & 1) * 16)) & 0xFFFF;\n //\n // * if you're not using indices you could use this\n //\n // let index = triNdx * 3 + vertNdx;\n\n let pNdx = index * line.stride;\n let position = vec4f(positions[pNdx], positions[pNdx + 1], positions[pNdx + 2], 1);\n\n var vOut: VSOut;\n vOut.position = uni.worldViewProjectionMatrix * position;\n return vOut;\n}\n\n@fragment fn fs() -> @location(0) vec4f {\n return uni.color + vec4f(0.5);\n}\n\nstruct BarycentricCoordinateBasedVSOutput {\n @builtin(position) position: vec4f,\n @location(0) barycenticCoord: vec3f,\n};\n\n@vertex fn vsIndexedU32BarycentricCoordinateBasedLines(\n @builtin(vertex_index) vNdx: u32\n) -> BarycentricCoordinateBasedVSOutput {\n let vertNdx = vNdx % 3;\n let index = indices[vNdx];\n\n // note:\n //\n // * if your indices are U16 you could use this\n //\n // let twoIndices = indices[vNdx / 2]; // indices is u32 but we want u16\n // let index = (twoIndices >> ((vNdx & 1) * 16)) & 0xFFFF;\n //\n // * if you're not using indices you could use this\n //\n // let index = vNdx;\n\n let pNdx = index * line.stride;\n let position = vec4f(positions[pNdx], positions[pNdx + 1], positions[pNdx + 2], 1);\n\n var vsOut: BarycentricCoordinateBasedVSOutput;\n vsOut.position = uni.worldViewProjectionMatrix * position;\n\n // emit a barycentric coordinate\n vsOut.barycenticCoord = vec3f(0);\n vsOut.barycenticCoord[vertNdx] = 1.0;\n return vsOut;\n}\n\nfn edgeFactor(bary: vec3f) -> f32 {\n let d = fwidth(bary);\n let a3 = smoothstep(vec3f(0.0), d * line.thickness, bary);\n return min(min(a3.x, a3.y), a3.z);\n}\n\n@fragment fn fsBarycentricCoordinateBasedLines(\n v: BarycentricCoordinateBasedVSOutput\n) -> @location(0) vec4f {\n let a = 1.0 - edgeFactor(v.barycenticCoord);\n if (a < line.alphaThreshold) {\n discard;\n }\n\n return vec4((uni.color.rgb + 0.5) * a, a);\n}\n";
3
- //# sourceMappingURL=Shaders.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Shaders.d.ts","sourceRoot":"","sources":["../../../../../example/src/Wireframe/Shaders.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,iBAAiB,6wBA6B5B,CAAC;AAEH,eAAO,MAAM,aAAa,oiGA0GzB,CAAC"}
@@ -1,29 +0,0 @@
1
- type Mesh = {
2
- positions: [number, number, number][];
3
- triangles: [number, number, number][];
4
- normals: [number, number, number][];
5
- };
6
- export declare function convertMeshToTypedArrays(mesh: Mesh, scale: number, offset?: number[]): {
7
- vertices: Float32Array;
8
- indices: Uint32Array;
9
- };
10
- export declare const modelData: {
11
- teapot: {
12
- vertices: Float32Array;
13
- indices: Uint32Array;
14
- };
15
- sphere: {
16
- vertices: Float32Array;
17
- indices: Uint32Array;
18
- };
19
- jewel: {
20
- vertices: Float32Array;
21
- indices: Uint32Array;
22
- };
23
- rock: {
24
- vertices: Float32Array;
25
- indices: Uint32Array;
26
- };
27
- };
28
- export {};
29
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../example/src/Wireframe/models.ts"],"names":[],"mappings":"AAUA,KAAK,IAAI,GAAG;IACV,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACtC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;IACtC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CAAC;CACrC,CAAC;AAEF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,IAAI,EACV,KAAK,EAAE,MAAM,EACb,MAAM,WAAY;;;EAoBnB;AAoED,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;CAKrB,CAAC"}
@@ -1,13 +0,0 @@
1
- /// <reference types="@webgpu/types" />
2
- export interface DrawingContext {
3
- width: number;
4
- height: number;
5
- getCurrentTexture(): GPUTexture;
6
- getImageData(): Promise<{
7
- data: number[];
8
- width: number;
9
- height: number;
10
- format: string;
11
- }>;
12
- }
13
- //# sourceMappingURL=DrawingContext.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DrawingContext.d.ts","sourceRoot":"","sources":["../../../../../example/src/components/DrawingContext.ts"],"names":[],"mappings":";AAAA,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB,IAAI,UAAU,CAAC;IAChC,YAAY,IAAI,OAAO,CAAC;QACtB,IAAI,EAAE,MAAM,EAAE,CAAC;QACf,KAAK,EAAE,MAAM,CAAC;QACd,MAAM,EAAE,MAAM,CAAC;QACf,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC,CAAC;CACJ"}
@@ -1,7 +0,0 @@
1
- export declare const cubeVertexSize: number;
2
- export declare const cubePositionOffset = 0;
3
- export declare const cubeColorOffset: number;
4
- export declare const cubeUVOffset: number;
5
- export declare const cubeVertexCount = 36;
6
- export declare const cubeVertexArray: Float32Array;
7
- //# sourceMappingURL=cube.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cube.d.ts","sourceRoot":"","sources":["../../../../../example/src/components/cube.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,eAAe,QAAQ,CAAC;AACrC,eAAO,MAAM,YAAY,QAAQ,CAAC;AAClC,eAAO,MAAM,eAAe,KAAK,CAAC;AAGlC,eAAO,MAAM,eAAe,cA2C1B,CAAC"}
@@ -1,12 +0,0 @@
1
- export interface SphereMesh {
2
- vertices: Float32Array;
3
- indices: Uint16Array;
4
- }
5
- export declare const SphereLayout: {
6
- vertexStride: number;
7
- positionsOffset: number;
8
- normalOffset: number;
9
- uvOffset: number;
10
- };
11
- export declare function createSphereMesh(radius: number, widthSegments?: number, heightSegments?: number, randomness?: number): SphereMesh;
12
- //# sourceMappingURL=sphere.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"sphere.d.ts","sourceRoot":"","sources":["../../../../../../example/src/components/meshes/sphere.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,YAAY,CAAC;IACvB,OAAO,EAAE,WAAW,CAAC;CACtB;AAED,eAAO,MAAM,YAAY;;;;;CAKxB,CAAC;AAGF,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,aAAa,SAAK,EAClB,cAAc,SAAK,EACnB,UAAU,SAAI,GACb,UAAU,CAkFZ"}
@@ -1,6 +0,0 @@
1
- export declare const mesh: {
2
- positions: [number, number, number][];
3
- triangles: [number, number, number][];
4
- normals: [number, number, number][];
5
- };
6
- //# sourceMappingURL=teapot.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"teapot.d.ts","sourceRoot":"","sources":["../../../../../../example/src/components/meshes/teapot.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,IAAI;;;;CAIhB,CAAC"}
@@ -1,10 +0,0 @@
1
- export declare function computeSurfaceNormals(positions: [number, number, number][], triangles: [number, number, number][]): [number, number, number][];
2
- export declare function generateNormals(maxAngle: number, positions: [number, number, number][], triangles: [number, number, number][]): {
3
- positions: [number, number, number][];
4
- normals: [number, number, number][];
5
- triangles: [number, number, number][];
6
- };
7
- type ProjectedPlane = "xy" | "xz" | "yz";
8
- export declare function computeProjectedPlaneUVs(positions: [number, number, number][], projectedPlane?: ProjectedPlane): [number, number][];
9
- export {};
10
- //# sourceMappingURL=utils.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../../../example/src/components/meshes/utils.ts"],"names":[],"mappings":"AAGA,wBAAgB,qBAAqB,CACnC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GACpC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,CA4B5B;AAsBD,wBAAgB,eAAe,CAC7B,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE;;;;EA2ItC;AAED,KAAK,cAAc,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAQzC,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,EACrC,cAAc,GAAE,cAAqB,GACpC,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,CAuBpB"}