-
- [vert.glsl]
-
- #version 130
-
- in vec2 in_position;
-
- uniform vec2 u_screen_res;
-
- out vec2 pass_position;
-
- void main()
- {
- pass_position = ((vec2(1.0) + in_position) * 0.5 * u_screen_res);
- gl_Position = vec4(in_position, 0.0, 1.0);
- }
-
- [frag.glsl]
-
- #version 130
-
- #if defined GL_ES
- precision highp float;
- #endif
-
- in vec2 pass_position;
-
- uniform sampler2D u_texture;
- uniform vec3 u_source_point;
- uniform vec2 u_screen_res;
-
- void main(void)
- {
- if (floor(u_source_point.xy) == floor(pass_position))
- gl_FragColor = vec4(u_source_point.xy / u_screen_res, u_source_point.z, 1.0);
- else
- {
- vec4 src_color = texture2D(u_texture, pass_position / u_screen_res);
- gl_FragColor = src_color;//vec4(0.0, 0.0, 0.0, 1.0);
- }
- //vec4(pass_position / u_screen_res, 0.0, 1.0);
- }
-
|