Advertisement
Guest User

Untitled

a guest
Sep 3rd, 2017
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //vertex
  2. #version 120
  3.  
  4. varying vec4 position;
  5. varying vec2 texCoordVarying;
  6.  
  7. float pixelate(float width, float value){
  8. return float(floor(value * (1.0 / width))) / (1.0 / width);
  9. }
  10.  
  11. void main(){
  12. texCoordVarying = gl_MultiTexCoord0.xy;
  13.  
  14. vec4 position = gl_Vertex;
  15.  
  16. position.z = pixelate(0.1, texCoordVarying.y) * 500.0;
  17.  
  18. gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix *position;
  19. }
  20.  
  21.  
  22. //fragment
  23.  
  24. #version 120
  25.  
  26. uniform sampler2D tex0;
  27. varying vec2 texCoordVarying;
  28.  
  29. void main()
  30. {
  31. gl_FragColor = texture2D(tex0,texCoordVarying);
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement