1// Copyright (c) 2015 Sergio Gonzalez. All rights reserved. 2// License: https://github.com/serge-rgb/milton#license 3 4#if HAS_TEXTURE_MULTISAMPLE 5 uniform sampler2DMS u_canvas; 6#else 7 uniform sampler2D u_canvas; 8#endif 9 10uniform vec2 u_screen_size; 11 12void 13main() 14{ 15 vec2 coord = gl_FragCoord.xy / u_screen_size; 16#if HAS_TEXTURE_MULTISAMPLE 17 vec3 color = texelFetch(u_canvas, ivec2(gl_FragCoord.xy), 0).rgb; 18#else 19 vec3 color = texture(u_canvas, coord).rgb; 20#endif 21 22 23 out_color = vec4(vec3(1)-color, 1); 24} 25