You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
803 B

  1. [vert.glsl]
  2. #version 130
  3. in vec2 in_position;
  4. uniform vec2 u_screen_res;
  5. out vec2 pass_position;
  6. void main()
  7. {
  8. pass_position = ((vec2(1.0) + in_position) * 0.5 * u_screen_res);
  9. gl_Position = vec4(in_position, 0.0, 1.0);
  10. }
  11. [frag.glsl]
  12. #version 130
  13. #if defined GL_ES
  14. precision highp float;
  15. #endif
  16. in vec2 pass_position;
  17. uniform sampler2D u_texture;
  18. uniform vec3 u_source_point;
  19. uniform vec2 u_screen_res;
  20. void main(void)
  21. {
  22. if (floor(u_source_point.xy) == floor(pass_position))
  23. gl_FragColor = vec4(u_source_point.xy / u_screen_res, u_source_point.z, 1.0);
  24. else
  25. {
  26. vec4 src_color = texture2D(u_texture, pass_position / u_screen_res);
  27. gl_FragColor = src_color;//vec4(0.0, 0.0, 0.0, 1.0);
  28. }
  29. //vec4(pass_position / u_screen_res, 0.0, 1.0);
  30. }