Created
December 9, 2020 17:46
-
-
Save smpnjn/c1dcf1aba4beb52a7ba59fdb1f6679f6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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