diff --git a/public/img/brickwall_diffuse.png b/assets/img/brickwall_diffuse.png similarity index 100% rename from public/img/brickwall_diffuse.png rename to assets/img/brickwall_diffuse.png diff --git a/public/img/brickwall_height.png b/assets/img/brickwall_height.png similarity index 100% rename from public/img/brickwall_height.png rename to assets/img/brickwall_height.png diff --git a/public/img/brickwall_normal.png b/assets/img/brickwall_normal.png similarity index 100% rename from public/img/brickwall_normal.png rename to assets/img/brickwall_normal.png diff --git a/public/img/spiral_height.png b/assets/img/spiral_height.png similarity index 100% rename from public/img/spiral_height.png rename to assets/img/spiral_height.png diff --git a/public/img/spiral_normal.png b/assets/img/spiral_normal.png similarity index 100% rename from public/img/spiral_normal.png rename to assets/img/spiral_normal.png diff --git a/public/img/toybox_height.png b/assets/img/toybox_height.png similarity index 100% rename from public/img/toybox_height.png rename to assets/img/toybox_height.png diff --git a/public/img/toybox_normal.png b/assets/img/toybox_normal.png similarity index 100% rename from public/img/toybox_normal.png rename to assets/img/toybox_normal.png diff --git a/public/img/wood_diffuse.png b/assets/img/wood_diffuse.png similarity index 100% rename from public/img/wood_diffuse.png rename to assets/img/wood_diffuse.png diff --git a/next.config.js b/next.config.js index 34df58c0..decb4461 100644 --- a/next.config.js +++ b/next.config.js @@ -8,6 +8,9 @@ module.exports = { basePath: BASE_PATH, compress: true, reactStrictMode: true, + eslint: { + ignoreDuringBuilds: true, + }, webpack: (config, { buildId, dev, isServer, defaultLoaders, webpack }) => { config.module.rules.push({ test: /\.(png|jpe?g|gif|webm)$/i, diff --git a/src/sample/normalMap/main.ts b/src/sample/normalMap/main.ts index 624f3a15..52ca0e81 100644 --- a/src/sample/normalMap/main.ts +++ b/src/sample/normalMap/main.ts @@ -4,10 +4,10 @@ import normalMapWGSL from './normalMap.wgsl'; import { createMeshRenderable } from '../../meshes/mesh'; import { createBoxMeshWithTangents } from '../../meshes/box'; import { - PBRDescriptor, - createPBRDescriptor, createBindGroupDescriptor, create3DRenderPipeline, + createPBRDescriptor, + PBRDescriptor, } from './utils'; const MAT4X4_BYTES = 64; diff --git a/src/sample/normalMap/utils.ts b/src/sample/normalMap/utils.ts index f0742be9..9f29d6fc 100644 --- a/src/sample/normalMap/utils.ts +++ b/src/sample/normalMap/utils.ts @@ -221,7 +221,7 @@ export const createPBRDescriptor = async ( device: GPUDevice, urls: string[] ): Promise => { - const imgAssetPrepend = '/img/'; + const imgAssetPrepend = '../../../assets/img/'; const loads = urls.map((url) => { const splits = url.split('_'); const ttype = splits[splits.length - 1].split('.')[0]; @@ -234,11 +234,11 @@ export const createPBRDescriptor = async ( console.log(loads); const pbr: PBRDescriptor = {}; for (let i = 0; i < loads.length; i++) { - console.log(loads[i].url); - console.log(import.meta.url); let texture: GPUTexture; { - const response = await fetch(loads[i].url); + const url = new URL(loads[i].url, import.meta.url).toString(); + console.log(url); + const response = await fetch(url); const imageBitmap = await createImageBitmap(await response.blob()); texture = createTextureFromImage(device, imageBitmap); } diff --git a/src/sample/texturedCube/main.ts b/src/sample/texturedCube/main.ts index 2d82d1ee..b3e1827d 100644 --- a/src/sample/texturedCube/main.ts +++ b/src/sample/texturedCube/main.ts @@ -110,6 +110,11 @@ const init: SampleInit = async ({ canvas, pageState }) => { // Fetch the image and upload it into a GPUTexture. let cubeTexture: GPUTexture; { + const url = new URL( + '../../../assets/img/Di-3d.png', + import.meta.url + ).toString(); + console.log(url); const response = await fetch( new URL('../../../assets/img/Di-3d.png', import.meta.url).toString() );