♻️ Use a single GLSL files for each effect

This commit is contained in:
Simon Schneegans
2022-05-13 09:17:26 +02:00
parent 84d5ad9caf
commit 7b8d6e18b2
34 changed files with 1006 additions and 915 deletions
+3 -1
View File
@@ -106,7 +106,9 @@ function loadGLSLResource(path) {
// This regex matches either #include "..." or #include <...>. The part between the
// brackets is captured in the named "file" capture group.
code = code.replaceAll(/#include ["<](?<file>.+)[">]/g, (m, p1, p2, str, groups) => {
const regex = RegExp('#include ["<](?<file>.+)[">]', 'g');
code = code.replaceAll(regex, (m, p1, p2, str, groups) => {
return loadStringResource('/shaders/' + groups.file);
});