Webgl / added time and resolution as default uniforms

Also added the `zoom` and `resolution` style operators
This commit is contained in:
Olivier Guyot
2019-10-25 13:40:26 +02:00
parent e843b2cfc0
commit acf973751b
6 changed files with 49 additions and 1 deletions
+4
View File
@@ -274,6 +274,8 @@ uniform mat4 u_projectionMatrix;
uniform mat4 u_offsetScaleMatrix;
uniform mat4 u_offsetRotateMatrix;
uniform float u_time;
uniform float u_zoom;
uniform float u_resolution;
${this.uniforms.map(function(uniform) {
return 'uniform ' + uniform + ';';
}).join('\n')}
@@ -335,6 +337,8 @@ ${varyings.map(function(varying) {
return `precision mediump float;
uniform float u_time;
uniform float u_zoom;
uniform float u_resolution;
${this.uniforms.map(function(uniform) {
return 'uniform ' + uniform + ';';
}).join('\n')}