Skip to content

Commit fe4b0f0

Browse files
committed
feat: updated readme
1 parent f8fccaf commit fe4b0f0

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff 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

src/shaders/shaders.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,12 @@ export const constants = {
4141
// =================================
4242

4343
function 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

4752
const commonSrc: string = evalShaderRaw(commonRaw);

0 commit comments

Comments
 (0)