Skip to content

Instantly share code, notes, and snippets.

@OmarShehata
Created February 3, 2018 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OmarShehata/66e08fb07fa33338e9c154fe6d3806a6 to your computer and use it in GitHub Desktop.
Save OmarShehata/66e08fb07fa33338e9c154fe6d3806a6 to your computer and use it in GitHub Desktop.
Answer to the water waves challenge
attribute vec3 aPosition;
uniform mat4 matrix_model;
uniform mat4 matrix_viewProjection;
uniform float uTime;
void main(void)
{
vec3 pos = aPosition;
pos.y += cos(pos.z * 5.0 + uTime) * 0.1 * sin(pos.x * 5.0 + uTime);
gl_Position = matrix_viewProjection * matrix_model * vec4(pos, 1.0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment