Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //vertex
- #version 120
- varying vec4 position;
- varying vec2 texCoordVarying;
- float pixelate(float width, float value){
- return float(floor(value * (1.0 / width))) / (1.0 / width);
- }
- void main(){
- texCoordVarying = gl_MultiTexCoord0.xy;
- vec4 position = gl_Vertex;
- position.z = pixelate(0.1, texCoordVarying.y) * 500.0;
- gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix *position;
- }
- //fragment
- #version 120
- uniform sampler2D tex0;
- varying vec2 texCoordVarying;
- void main()
- {
- gl_FragColor = texture2D(tex0,texCoordVarying);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement