File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed
Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,8 @@ WebGL Forward+ and Clustered Deferred Shading
33
44** University of Pennsylvania, CIS 565: GPU Programming and Architecture, Project 4**
55
6- * (TODO) YOUR NAME HERE
7- * Tested on: (TODO) ** Google Chrome 222.2** on
8- Windows 22, i7-2222 @ 2.22GHz 22GB, GTX 222 222MB (Moore 2222 Lab)
6+ * Harry Guan
7+ * Tested on: ** Google Chrome 141.0.07** on Macbook Air M2 2022
98
109### Live Demo
1110
Original file line number Diff line number Diff line change @@ -41,7 +41,12 @@ export const constants = {
4141// =================================
4242
4343function evalShaderRaw ( raw : string ) {
44- return eval ( '`' + raw . replaceAll ( '${' , '${constants.' ) + '`' ) ;
44+ let processed = raw ;
45+ for ( const [ key , value ] of Object . entries ( constants ) ) {
46+ const regex = new RegExp ( `\\$\\{${ key } \\}` , 'g' ) ;
47+ processed = processed . replace ( regex , String ( value ) ) ;
48+ }
49+ return processed ;
4550}
4651
4752const commonSrc : string = evalShaderRaw ( commonRaw ) ;
You can’t perform that action at this time.
0 commit comments