Spaces:
Running
Running
move over butter
Browse files- index.html +1 -7
- utility.js +5 -1
index.html
CHANGED
@@ -11,7 +11,7 @@
|
|
11 |
<canvas></canvas>
|
12 |
<script type="module">
|
13 |
import { mat4 } from 'https://webgpufundamentals.org/3rdparty/wgpu-matrix.module.js';
|
14 |
-
import
|
15 |
const glyphWidth = 32;
|
16 |
const glyphHeight = 40;
|
17 |
const glyphsAcrossTexture = 16;
|
@@ -47,12 +47,6 @@
|
|
47 |
format: presentationFormat,
|
48 |
});
|
49 |
|
50 |
-
// Fetch shader code from external file
|
51 |
-
async function fetchShaderCode(url) {
|
52 |
-
const response = await fetch(url);
|
53 |
-
return await response.text();
|
54 |
-
}
|
55 |
-
|
56 |
const shaderCode = await fetchShaderCode('shaders.wgsl');
|
57 |
const module = device.createShaderModule({
|
58 |
label: 'textured quad shaders',
|
|
|
11 |
<canvas></canvas>
|
12 |
<script type="module">
|
13 |
import { mat4 } from 'https://webgpufundamentals.org/3rdparty/wgpu-matrix.module.js';
|
14 |
+
import { fetchShaderCode } from './utility.js';
|
15 |
const glyphWidth = 32;
|
16 |
const glyphHeight = 40;
|
17 |
const glyphsAcrossTexture = 16;
|
|
|
47 |
format: presentationFormat,
|
48 |
});
|
49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
50 |
const shaderCode = await fetchShaderCode('shaders.wgsl');
|
51 |
const module = device.createShaderModule({
|
52 |
label: 'textured quad shaders',
|
utility.js
CHANGED
@@ -1,2 +1,6 @@
|
|
1 |
// utility.js
|
2 |
-
|
|
|
|
|
|
|
|
|
|
1 |
// utility.js
|
2 |
+
|
3 |
+
export async function fetchShaderCode(url) {
|
4 |
+
const response = await fetch(url);
|
5 |
+
return await response.text();
|
6 |
+
}
|