Guest User

displacement.vert

a guest
Nov 4th, 2016
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #version 120
  2.  
  3. uniform sampler2D displacementMap;
  4.  
  5. varying vec4 position;
  6. varying vec2 texCoordVarying;
  7.  
  8.  
  9. void main(){
  10. texCoordVarying = gl_MultiTexCoord0.xy;
  11.  
  12. vec4 position = gl_Vertex;
  13. position.z += texture2D(displacementMap,texCoordVarying).r * 100.0;
  14.  
  15. gl_Position = gl_ModelViewProjectionMatrix * position;
  16. }
Add Comment
Please, Sign In to add comment