Skip to content

Commit

Permalink
fix-paths
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Oct 30, 2023
1 parent c8195de commit 2c708c1
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion src/sample/cameras/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
12 changes: 6 additions & 6 deletions src/sample/cubemap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/sample/imageBlur/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
16 changes: 8 additions & 8 deletions src/sample/normalMap/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion src/sample/particles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/sample/renderBundles/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand All @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion src/sample/texturedCube/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion src/sample/videoUploading/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/sample/videoUploadingWebCodecs/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 2c708c1

Please sign in to comment.