big-moving.ru/api/soft/Ace/demo/kitchen-sink/docs/glsl.glsl

20 lines
512 B
Plaintext
Raw Normal View History

2022-06-24 15:29:23 +05:00
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);
}