Skip to content

Instantly share code, notes, and snippets.

@smpnjn
Created December 9, 2020 17:46
Show Gist options
  • Save smpnjn/c1dcf1aba4beb52a7ba59fdb1f6679f6 to your computer and use it in GitHub Desktop.
Save smpnjn/c1dcf1aba4beb52a7ba59fdb1f6679f6 to your computer and use it in GitHub Desktop.
varying vec2 vUv;
uniform sampler2D getTexture1;
void main() {
vUv = uv;
vec4 bumpData = texture2D( getTexture1, uv );
float displacement = 20.0 * bumpData.r * bumpData.a;
vec3 newPosition = position + normal * 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