Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- varying vec2 v_texCoord;
- uniform vec2 rubyTextureSize;
- uniform vec2 rubyInputSize;
- uniform vec2 rubyOutputSize;
- #if defined(VERTEX)
- attribute vec4 a_position;
- void main() {
- vec2 ratio = max(floor((rubyOutputSize+0.0001)/rubyInputSize), 1.0);
- vec4 clean = vec4(ratio*rubyInputSize/rubyOutputSize, 1.0, 1.0);
- gl_Position = a_position * clean;
- v_texCoord = vec2(a_position.x+1.0,1.0-a_position.y)/2.0*rubyInputSize;
- }
- #elif defined(FRAGMENT)
- uniform sampler2D rubyTexture;
- void main() {
- gl_FragColor = texelFetch(rubyTexture, ivec2(v_texCoord), 0);
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement