🚚 Rename shader files

This commit is contained in:
Simon Schneegans
2022-05-27 21:21:05 +02:00
parent c90f3a1c97
commit 6a65d59144
13 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ Just remember to replace `simple-fade` with your custom name!
### 2. Creating the Effect Class
You will have to create a new GLSL file called `resources/shaders/simple-fade.glsl` and a new JavaScript source file called `src/SimpleFade.js`.
You will have to create a new GLSL file called `resources/shaders/simple-fade.frag` and a new JavaScript source file called `src/SimpleFade.js`.
Simply paste the following source code to the respective file.
Please study this code carefully, all of it is explained with inline comments.
+1 -1
View File
@@ -106,7 +106,7 @@ var Shader = GObject.registerClass(
// Shell.GLSLEffect requires the declarations and the main source code as separate
// strings. As it's more convenient to store the in one GLSL file, we use a regex
// here to split the source code in two parts.
const code = this._loadShaderResource(`/shaders/${this._nick}.glsl`);
const code = this._loadShaderResource(`/shaders/${this._nick}.frag`);
// Match anything between the curly brackets of "void main() {...}".
const regex = RegExp('void main *\\(\\) *\\{([\\S\\s]+)\\}');