You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
512 B
Plaintext
20 lines
512 B
Plaintext
10 years ago
|
uniform float amplitude;
|
||
|
attribute float displacement;
|
||
|
varying vec3 vNormal;
|
||
|
|
||
|
void main() {
|
||
|
|
||
|
vNormal = normal;
|
||
|
|
||
|
// multiply our displacement by the
|
||
|
// amplitude. The amp will get animated
|
||
|
// so we'll have animated displacement
|
||
|
vec3 newPosition = position +
|
||
|
normal *
|
||
|
vec3(displacement *
|
||
|
amplitude);
|
||
|
|
||
|
gl_Position = projectionMatrix *
|
||
|
modelViewMatrix *
|
||
|
vec4(newPosition,1.0);
|
||
|
}
|