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.
 
 
 

71 rivejä
1.6 KiB

  1. //-----------------------------------------------------------------------------
  2. //GLSL
  3. //-----------------------------------------------------------------------------
  4. [vert.glsl]
  5. #version 120
  6. attribute vec2 in_position;
  7. uniform vec2 in_screen_res;
  8. varying vec2 pass_position;
  9. void main()
  10. {
  11. pass_position = ((vec2(1.0) + in_position) * 0.5 * in_screen_res);
  12. gl_Position = vec4(in_position, 0.0, 1.0);
  13. }
  14. [frag.glsl]
  15. #version 120
  16. #if defined GL_ES
  17. precision highp float;
  18. #endif
  19. uniform sampler2D in_texture;
  20. uniform vec3 in_source_point;
  21. uniform vec2 in_screen_res;
  22. varying vec2 pass_position;
  23. void main(void)
  24. {
  25. if (floor(in_source_point.xy) == floor(pass_position))
  26. gl_FragColor = vec4(in_source_point.xy / in_screen_res, in_source_point.z, 1.0);
  27. else
  28. {
  29. vec4 src_color = texture2D(in_texture, pass_position / in_screen_res);
  30. gl_FragColor = src_color;//vec4(0.0, 0.0, 0.0, 1.0);
  31. }
  32. //vec4(pass_position / in_screen_res, 0.0, 1.0);
  33. }
  34. //-----------------------------------------------------------------------------
  35. //HLSL
  36. //-----------------------------------------------------------------------------
  37. [vert.hlsl]
  38. void main(float2 in_Position : POSITION,
  39. out float2 pass_Position : TEXCOORD0,
  40. out float4 out_Position : POSITION)
  41. {
  42. pass_Position = in_Position;
  43. out_Position = float4(in_Position, 0.0, 1.0);
  44. }
  45. [frag.hlsl]
  46. void main(in float2 pass_Position : TEXCOORD0,
  47. uniform sampler2D in_Texture,
  48. uniform float in_Flag,
  49. uniform float3 in_Point,
  50. uniform float3 in_Color,
  51. out float4 out_FragColor : COLOR)
  52. {
  53. out_FragColor = float4(0.0);
  54. }