File tree Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Expand file tree Collapse file tree 3 files changed +36
-1
lines changed Original file line number Diff line number Diff line change
1
+ // Update shader loading paths
2
+ const loadShader = async ( shaderPath ) => {
3
+ try {
4
+ // Use absolute path for GitHub Pages
5
+ const response = await fetch ( `${ import . meta. env . BASE_URL } ${ shaderPath } ` ) ;
6
+ if ( ! response . ok ) throw new Error ( `Shader load failed: ${ response . status } ` ) ;
7
+ return await response . text ( ) ;
8
+ } catch ( error ) {
9
+ console . error ( `Error loading shader: ${ shaderPath } ` , error ) ;
10
+ throw error ;
11
+ }
12
+ } ;
Original file line number Diff line number Diff line change
1
+ const wallVertexShader = ( ) => `${ import . meta. env . BASE_URL } src/shaders/wall.vert.glsl` ;
2
+ const wallFragmentShader = ( ) => `${ import . meta. env . BASE_URL } src/shaders/wall.frag.glsl` ;
Original file line number Diff line number Diff line change
1
+ import { defineConfig } from 'vite' ;
2
+ import react from '@vitejs/plugin-react' ;
3
+ import path from 'path' ;
4
+
1
5
export default defineConfig ( {
2
6
base : '/3D-Portfolio/' ,
3
7
plugins : [ react ( ) ] ,
4
- } )
8
+ build : {
9
+ assetsInclude : [ '**/*.glsl' ] ,
10
+ rollupOptions : {
11
+ input : {
12
+ main : path . resolve ( __dirname , 'index.html' ) ,
13
+ } ,
14
+ output : {
15
+ assetFileNames : 'assets/[name][extname]' ,
16
+ entryFileNames : 'js/[name].js' ,
17
+ }
18
+ }
19
+ } ,
20
+ server : {
21
+ fs : {
22
+ strict : false ,
23
+ }
24
+ }
25
+ } ) ;
You can’t perform that action at this time.
0 commit comments