Skip to content

Commit d2cb309

Browse files
author
Parsa Azari
committed
fix: update all asset paths for GitHub Pages deployment
1 parent c91dd49 commit d2cb309

File tree

5 files changed

+23
-23
lines changed

5 files changed

+23
-23
lines changed
39.6 KB
Binary file not shown.
39.6 KB
Binary file not shown.

src/core/rendering/environments/SeveranceEnvironment.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
433433
// Use material system to load vertex shader instead of inline definition
434434
// This ensures we're following the project organization guidelines
435435
vertexShader: await this.materialSystem._loadShaderFile(
436-
getAssetPath("./src/shaders/common/vertex.txt")
436+
getAssetPath("/shaders/common/vertex.txt")
437437
),
438438
fragmentShader: await this.materialSystem._loadShaderFile(
439-
getAssetPath("./src/shaders/wall.txt")
439+
getAssetPath("/shaders/wall.txt")
440440
),
441441
side: THREE.DoubleSide,
442442
});
@@ -484,10 +484,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
484484
},
485485
// Use material system to load vertex shader instead of inline definition
486486
vertexShader: await this.materialSystem._loadShaderFile(
487-
getAssetPath("./src/shaders/common/vertex.txt")
487+
getAssetPath("/shaders/common/vertex.txt")
488488
),
489489
fragmentShader: await this.materialSystem._loadShaderFile(
490-
getAssetPath("./src/shaders/corridor.txt")
490+
getAssetPath("/shaders/corridor.txt")
491491
),
492492
transparent: true,
493493
blending: THREE.AdditiveBlending,
@@ -3695,10 +3695,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
36953695
// Use material system to load vertex shader instead of inline definition
36963696
// This ensures we're following the project organization guidelines
36973697
vertexShader: await this.materialSystem._loadShaderFile(
3698-
getAssetPath("./src/shaders/common/vertex.txt")
3698+
getAssetPath("/shaders/common/vertex.txt")
36993699
),
37003700
fragmentShader: await this.materialSystem._loadShaderFile(
3701-
getAssetPath("./src/shaders/wall.txt")
3701+
getAssetPath("/shaders/wall.txt")
37023702
),
37033703
side: THREE.DoubleSide,
37043704
});
@@ -3746,10 +3746,10 @@ export class SeveranceEnvironment extends BaseEnvironment {
37463746
},
37473747
// Use material system to load vertex shader instead of inline definition
37483748
vertexShader: await this.materialSystem._loadShaderFile(
3749-
getAssetPath("./src/shaders/common/vertex.txt")
3749+
getAssetPath("/shaders/common/vertex.txt")
37503750
),
37513751
fragmentShader: await this.materialSystem._loadShaderFile(
3752-
getAssetPath("./src/shaders/corridor.txt")
3752+
getAssetPath("/shaders/corridor.txt")
37533753
),
37543754
transparent: true,
37553755
blending: THREE.AdditiveBlending,

src/core/rendering/materials/SeveranceMaterials.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -163,12 +163,12 @@ export class SeveranceMaterials {
163163
async _loadTextures() {
164164
const textureLoader = new THREE.TextureLoader();
165165
const texturePaths = {
166-
wall: getAssetPath("/assets/textures/wall.jpg"),
167-
floor: getAssetPath("/assets/textures/floor.jpg"),
168-
ceiling: getAssetPath("/assets/textures/ceiling.jpg"),
169-
trim: getAssetPath("/assets/textures/trim.jpg"),
170-
door: getAssetPath("/assets/textures/door.jpg"),
171-
outsideGround: getAssetPath("/assets/textures/wall.jpg"),
166+
wall: getAssetPath("/textures/wall.jpg"),
167+
floor: getAssetPath("/textures/floor.jpg"),
168+
ceiling: getAssetPath("/textures/ceiling.jpg"),
169+
trim: getAssetPath("/textures/trim.jpg"),
170+
door: getAssetPath("/textures/door.jpg"),
171+
outsideGround: getAssetPath("/textures/wall.jpg"),
172172
};
173173

174174
const loadTexture = (path) => {
@@ -254,7 +254,7 @@ export class SeveranceMaterials {
254254
"Attempting to load vertex shader from src/shaders/common/vertex.glsl"
255255
);
256256
commonVertexShader = await this._loadShaderFile(
257-
getAssetPath("./src/shaders/common/vertex.glsl")
257+
getAssetPath("/shaders/common/vertex.glsl")
258258
);
259259
console.log("Successfully loaded vertex shader");
260260
} catch (e) {
@@ -272,7 +272,7 @@ export class SeveranceMaterials {
272272
"Attempting to load wall shader from src/shaders/wall.glsl"
273273
);
274274
wallFragmentShader = await this._loadShaderFile(
275-
getAssetPath("./src/shaders/wall.glsl")
275+
getAssetPath("/shaders/wall.glsl")
276276
);
277277
console.log("Successfully loaded wall shader");
278278
console.log(
@@ -288,7 +288,7 @@ export class SeveranceMaterials {
288288
"Attempting to load wall shader from public/src/shaders/wall.glsl"
289289
);
290290
wallFragmentShader = await this._loadShaderFile(
291-
getAssetPath("./public/src/shaders/wall.glsl")
291+
getAssetPath("/shaders/wall.glsl")
292292
);
293293
console.log("Successfully loaded wall shader from public path");
294294
} catch (e2) {
@@ -304,7 +304,7 @@ export class SeveranceMaterials {
304304
"Attempting to load corridor shader from src/shaders/corridor.glsl"
305305
);
306306
corridorFragmentShader = await this._loadShaderFile(
307-
getAssetPath("./src/shaders/corridor.glsl")
307+
getAssetPath("/shaders/corridor.glsl")
308308
);
309309
console.log("Successfully loaded corridor shader");
310310
} catch (e) {

src/systems/environment/AssetLoader.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ export class AssetLoader extends EventEmitter {
8989
*/
9090
_loadTextures() {
9191
const texturesToLoad = {
92-
wall: getAssetPath("/assets/textures/wall.jpg"),
93-
floor: getAssetPath("/assets/textures/floor.jpg"),
94-
ceiling: getAssetPath("/assets/textures/ceiling.jpg"),
95-
door: getAssetPath("/assets/textures/door.jpg"),
96-
trim: getAssetPath("/assets/textures/trim.jpg"),
92+
wall: getAssetPath("/textures/wall.jpg"),
93+
floor: getAssetPath("/textures/floor.jpg"),
94+
ceiling: getAssetPath("/textures/ceiling.jpg"),
95+
door: getAssetPath("/textures/door.jpg"),
96+
trim: getAssetPath("/textures/trim.jpg"),
9797
};
9898

9999
return Object.entries(texturesToLoad).map(([name, path]) => {

0 commit comments

Comments
 (0)