Add t variable to represent u_time (#85)

This commit is contained in:
Yuan Chuan 2022-05-13 22:10:15 +08:00 committed by GitHub
parent 228f44a2e9
commit 244b3e998a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,7 @@ function generate_shader(input, grid) {
float i = x + (y - 1.0) * y;
return vec3(x, y, i);
}
vec4 getColor(float x, float y, float i, float I, float X, float Y) {
vec4 getColor(float x, float y, float i, float I, float X, float Y, float t) {
vec4 color = vec4(0, 0, 0, 0);
${input}
return color;
@ -19,7 +19,7 @@ function generate_shader(input, grid) {
vec2 uv = gl_FragCoord.xy/u_resolution.xy;
vec2 grid = vec2(${grid.x}, ${grid.y});
vec3 p = mapping(uv, grid);
FragColor = getColor(p.x, p.y, p.z, grid.x * grid.y, grid.x, grid.y);
FragColor = getColor(p.x, p.y, p.z, grid.x * grid.y, grid.x, grid.y, u_time);
}
`;
}