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

View File

@@ -314,6 +314,24 @@ Operators['time'] = {
return 'u_time';
}
};
Operators['zoom'] = {
getReturnType: function(args) {
return ValueTypes.NUMBER;
},
toGlsl: function(context, args) {
assertArgsCount(args, 0);
return 'u_zoom';
}
};
Operators['resolution'] = {
getReturnType: function(args) {
return ValueTypes.NUMBER;
},
toGlsl: function(context, args) {
assertArgsCount(args, 0);
return 'u_resolution';
}
};
Operators['*'] = {
getReturnType: function(args) {
return ValueTypes.NUMBER;