Final.glsl 915 B

123456789101112131415161718192021222324252627282930
  1. // The final pass
  2. #pragma anki vertShaderBegins
  3. #pragma anki include "shaders/SimpleVert.glsl"
  4. #pragma anki fragShaderBegins
  5. uniform sampler2D rasterImage;
  6. in vec2 vTexCoords;
  7. layout(location = 0) out vec3 fFragColor;
  8. void main()
  9. {
  10. //if( gl_FragCoord.x > 0.5 ) discard;
  11. fFragColor = texture2D(rasterImage, vTexCoords).rgb;
  12. //fragColor = vec3(1.0, 0.0, 1.0);
  13. //gl_FragColor.rgb = vec3(texture2D(rasterImage, vTexCoords).r);
  14. /*vec4 c = texture2D( rasterImage, texCoords );
  15. if( c.r == 0.0 && c.g == 0.0 && c.b==0.0 && c.a != 0.0 )*/
  16. //gl_FragColor.rgb = vec3( texture2D( rasterImage, texCoords ).a );
  17. //gl_FragColor.rgb = MedianFilter( rasterImage, texCoords );
  18. //gl_FragColor.rgb = vec3( gl_FragCoord.xy/tex_size_, 0.0 );
  19. //gl_FragColor.rgb = vec3( gl_FragCoord.xy*vec2( 1.0/R_W, 1.0/R_H ), 0.0 );
  20. //gl_FragColor.rgb = texture2D( rasterImage, gl_FragCoord.xy/textureSize(rasterImage,0) ).rgb;
  21. }