Skip to content

Instantly share code, notes, and snippets.

@sortofsleepy
Created June 20, 2012 15:04
Show Gist options
  • Save sortofsleepy/2960339 to your computer and use it in GitHub Desktop.
Save sortofsleepy/2960339 to your computer and use it in GitHub Desktop.
uniform float amplitude;
attribute float displacement;
varying vec3 vNormal;
varying vec2 vUv;
void main() {
vNormal = normal;
vUv = ( 0.5 + amplitude ) * uv + vec2( amplitude );
vec3 newPosition = position + amplitude * normal * vec3( displacement );
gl_Position = projectionMatrix * modelViewMatrix * vec4( newPosition, 1.0 );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment