Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ivec2 itexSize =textureSize(rbga_tex,0);
- vec2 texSize = vec2(itexSize);
- vec2 texelSize = 1.0 / (texSize / 2.0);
- vec2 pixel = uv * texSize + 0.5;
- pixel = (floor(pixel) / texSize) - vec2(texelSize/2.0);
- //bilinear filtering:
- float sc = 4.0;
- vec3 ts = texture(rbga_tex, pixel ).rgb * 0.25; // center
- vec3 tr = texture(rbga_tex, pixel + vec2(texelSize.x * sc, 0.0) ).rgb * 0.25;
- vec3 bl = texture(rbga_tex, pixel + vec2(0.0, texelSize.y * sc) ).rgb * 0.25;
- vec3 br = texture(rbga_tex, pixel + vec2(texelSize.x, texelSize.y) * sc).rgb * 0.25;
- vec3 tex1 = (ts + tr + bl + br) ;
- // calculate and write U...
- // calculate and write V...
Add Comment
Please, Sign In to add comment