Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <shader language="GLSL">
- <vertex><![CDATA[
- attribute vec4 aVertex;
- attribute vec2 aTexCoord;
- varying vec2 vTexCoord;
- void main() {
- gl_Position = vec4(aVertex.x, aVertex.y, 0.0, 1.0);
- vTexCoord = aTexCoord;
- }
- ]]></vertex>
- <fragment filter="nearest"><![CDATA[
- uniform sampler2D uImage0;
- varying vec2 vTexCoord;
- uniform vec2 uResolution;
- uniform vec2 uResolutionUs;
- vec2 ps = 1.0 / uResolutionUs; //pixelsize
- vec2 offset = (1.0 / (uResolution)) / 2.0;
- void main(void) {
- gl_FragColor = texture2D(uImage0, floor(vTexCoord / ps) * ps + offset);
- }
- ]]></fragment>
- </shader>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement