From 2c708c144d17dfd9b767bbaac93e4fd67978ce53 Mon Sep 17 00:00:00 2001 From: Gregg Tavares Date: Tue, 31 Oct 2023 08:14:07 +0900 Subject: [PATCH] fix-paths --- src/sample/cameras/main.ts | 2 +- src/sample/cubemap/main.ts | 12 ++++++------ src/sample/imageBlur/main.ts | 2 +- src/sample/normalMap/main.ts | 16 ++++++++-------- src/sample/particles/main.ts | 2 +- src/sample/renderBundles/main.ts | 4 ++-- src/sample/texturedCube/main.ts | 2 +- src/sample/videoUploading/main.ts | 2 +- src/sample/videoUploadingWebCodecs/main.ts | 2 +- 9 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/sample/cameras/main.ts b/src/sample/cameras/main.ts index fabd4797..a349c2a9 100644 --- a/src/sample/cameras/main.ts +++ b/src/sample/cameras/main.ts @@ -128,7 +128,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { // Fetch the image and upload it into a GPUTexture. let cubeTexture: GPUTexture; { - const response = await fetch('/assets/img/Di-3d.png'); + const response = await fetch('../assets/img/Di-3d.png'); const imageBitmap = await createImageBitmap(await response.blob()); cubeTexture = device.createTexture({ diff --git a/src/sample/cubemap/main.ts b/src/sample/cubemap/main.ts index ba97f210..d6513c54 100644 --- a/src/sample/cubemap/main.ts +++ b/src/sample/cubemap/main.ts @@ -107,12 +107,12 @@ const init: SampleInit = async ({ canvas, pageState }) => { { // The order of the array layers is [+X, -X, +Y, -Y, +Z, -Z] const imgSrcs = [ - '/assets/img/cubemap/posx.jpg', - '/assets/img/cubemap/negx.jpg', - '/assets/img/cubemap/posy.jpg', - '/assets/img/cubemap/negy.jpg', - '/assets/img/cubemap/posz.jpg', - '/assets/img/cubemap/negz.jpg', + '../assets/img/cubemap/posx.jpg', + '../assets/img/cubemap/negx.jpg', + '../assets/img/cubemap/posy.jpg', + '../assets/img/cubemap/negy.jpg', + '../assets/img/cubemap/posz.jpg', + '../assets/img/cubemap/negz.jpg', ]; const promises = imgSrcs.map(async (src) => { const response = await fetch(src); diff --git a/src/sample/imageBlur/main.ts b/src/sample/imageBlur/main.ts index 0f426d63..4331e717 100644 --- a/src/sample/imageBlur/main.ts +++ b/src/sample/imageBlur/main.ts @@ -64,7 +64,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { minFilter: 'linear', }); - const response = await fetch('/assets/img/Di-3d.png'); + const response = await fetch('../assets/img/Di-3d.png'); const imageBitmap = await createImageBitmap(await response.blob()); const [srcWidth, srcHeight] = [imageBitmap.width, imageBitmap.height]; diff --git a/src/sample/normalMap/main.ts b/src/sample/normalMap/main.ts index 047a1d57..cbc2c0a8 100644 --- a/src/sample/normalMap/main.ts +++ b/src/sample/normalMap/main.ts @@ -91,56 +91,56 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { // Fetch the image and upload it into a GPUTexture. let woodDiffuseTexture: GPUTexture; { - const response = await fetch('/assets/img/wood_diffuse.png'); + const response = await fetch('../assets/img/wood_diffuse.png'); const imageBitmap = await createImageBitmap(await response.blob()); woodDiffuseTexture = createTextureFromImage(device, imageBitmap); } let spiralNormalTexture: GPUTexture; { - const response = await fetch('/assets/img/spiral_normal.png'); + const response = await fetch('../assets/img/spiral_normal.png'); const imageBitmap = await createImageBitmap(await response.blob()); spiralNormalTexture = createTextureFromImage(device, imageBitmap); } let spiralHeightTexture: GPUTexture; { - const response = await fetch('/assets/img/spiral_height.png'); + const response = await fetch('../assets/img/spiral_height.png'); const imageBitmap = await createImageBitmap(await response.blob()); spiralHeightTexture = createTextureFromImage(device, imageBitmap); } let toyboxNormalTexture: GPUTexture; { - const response = await fetch('/assets/img/toybox_normal.png'); + const response = await fetch('../assets/img/toybox_normal.png'); const imageBitmap = await createImageBitmap(await response.blob()); toyboxNormalTexture = createTextureFromImage(device, imageBitmap); } let toyboxHeightTexture: GPUTexture; { - const response = await fetch('/assets/img/toybox_height.png'); + const response = await fetch('../assets/img/toybox_height.png'); const imageBitmap = await createImageBitmap(await response.blob()); toyboxHeightTexture = createTextureFromImage(device, imageBitmap); } let brickwallDiffuseTexture: GPUTexture; { - const response = await fetch('/assets/img/brickwall_diffuse.png'); + const response = await fetch('../assets/img/brickwall_diffuse.png'); const imageBitmap = await createImageBitmap(await response.blob()); brickwallDiffuseTexture = createTextureFromImage(device, imageBitmap); } let brickwallNormalTexture: GPUTexture; { - const response = await fetch('/assets/img/brickwall_normal.png'); + const response = await fetch('../assets/img/brickwall_normal.png'); const imageBitmap = await createImageBitmap(await response.blob()); brickwallNormalTexture = createTextureFromImage(device, imageBitmap); } let brickwallHeightTexture: GPUTexture; { - const response = await fetch('/assets/img/brickwall_height.png'); + const response = await fetch('../assets/img/brickwall_height.png'); const imageBitmap = await createImageBitmap(await response.blob()); brickwallHeightTexture = createTextureFromImage(device, imageBitmap); } diff --git a/src/sample/particles/main.ts b/src/sample/particles/main.ts index d9d1069c..8ca9d7fb 100644 --- a/src/sample/particles/main.ts +++ b/src/sample/particles/main.ts @@ -185,7 +185,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { let textureHeight = 1; let numMipLevels = 1; { - const response = await fetch('/assets/img/webgpu.png'); + const response = await fetch('../assets/img/webgpu.png'); const imageBitmap = await createImageBitmap(await response.blob()); // Calculate number of mip levels required to generate the probability map diff --git a/src/sample/renderBundles/main.ts b/src/sample/renderBundles/main.ts index 8eae15ae..bbe243d2 100644 --- a/src/sample/renderBundles/main.ts +++ b/src/sample/renderBundles/main.ts @@ -118,7 +118,7 @@ const init: SampleInit = async ({ canvas, pageState, gui, stats }) => { // Fetch the images and upload them into a GPUTexture. let planetTexture: GPUTexture; { - const response = await fetch('/assets/img/saturn.jpg'); + const response = await fetch('../assets/img/saturn.jpg'); const imageBitmap = await createImageBitmap(await response.blob()); planetTexture = device.createTexture({ @@ -138,7 +138,7 @@ const init: SampleInit = async ({ canvas, pageState, gui, stats }) => { let moonTexture: GPUTexture; { - const response = await fetch('/assets/img/moon.jpg'); + const response = await fetch('../assets/img/moon.jpg'); const imageBitmap = await createImageBitmap(await response.blob()); moonTexture = device.createTexture({ diff --git a/src/sample/texturedCube/main.ts b/src/sample/texturedCube/main.ts index d052dd2a..60c213f8 100644 --- a/src/sample/texturedCube/main.ts +++ b/src/sample/texturedCube/main.ts @@ -110,7 +110,7 @@ const init: SampleInit = async ({ canvas, pageState }) => { // Fetch the image and upload it into a GPUTexture. let cubeTexture: GPUTexture; { - const response = await fetch('/assets/img/Di-3d.png'); + const response = await fetch('../assets/img/Di-3d.png'); const imageBitmap = await createImageBitmap(await response.blob()); cubeTexture = device.createTexture({ diff --git a/src/sample/videoUploading/main.ts b/src/sample/videoUploading/main.ts index 4aed67df..1cfa5d9c 100644 --- a/src/sample/videoUploading/main.ts +++ b/src/sample/videoUploading/main.ts @@ -9,7 +9,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { video.loop = true; video.autoplay = true; video.muted = true; - video.src = '/assets/video/pano.webm'; + video.src = '../assets/video/pano.webm'; await video.play(); const adapter = await navigator.gpu.requestAdapter(); diff --git a/src/sample/videoUploadingWebCodecs/main.ts b/src/sample/videoUploadingWebCodecs/main.ts index 867f183b..3fe34500 100644 --- a/src/sample/videoUploadingWebCodecs/main.ts +++ b/src/sample/videoUploadingWebCodecs/main.ts @@ -9,7 +9,7 @@ const init: SampleInit = async ({ canvas, pageState, gui }) => { video.loop = true; video.autoplay = true; video.muted = true; - video.src = '/assets/video/pano.webm'; + video.src = '../assets/video/pano.webm'; await video.play(); const adapter = await navigator.gpu.requestAdapter();