glsl.glsl 512 B

1234567891011121314151617181920
  1. uniform float amplitude;
  2. attribute float displacement;
  3. varying vec3 vNormal;
  4. void main() {
  5. vNormal = normal;
  6. // multiply our displacement by the
  7. // amplitude. The amp will get animated
  8. // so we'll have animated displacement
  9. vec3 newPosition = position +
  10. normal *
  11. vec3(displacement *
  12. amplitude);
  13. gl_Position = projectionMatrix *
  14. modelViewMatrix *
  15. vec4(newPosition,1.0);
  16. }