Guest User

displacement.vert

a guest
Nov 4th, 2016
76
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None
  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. }
RAW Paste Data Copied