Files
qglengine/shaders/selection_apply.glsl
peri4 292f68a574 version 1.2.0
fixed framebuffer size feature
2023-05-17 15:58:39 +03:00

27 lines
638 B
GLSL

// vert //
void main(void) {
qgl_FragTexture = qgl_Texture;
gl_Position = qgl_ftransform();
}
// frag //
uniform sampler2D fb_out, fb_hover, fb_select;
void main(void) {
//ivec2 tc = ivec2(gl_FragCoord.xy);
//vec4 src = texelFetch(fb_out , tc, 0);
vec2 stc = qgl_FragTexture.xy;
vec4 src = texture(fb_out , stc);
vec4 hov = texture(fb_hover , stc);
vec4 sel = texture(fb_select, stc);
src.rgb = clamp(src.rgb, vec3(0), vec3(1));
src.rgb = mix(src.rgb, sel.rgb, sel.a);
src.rgb = mix(src.rgb, hov.rgb, hov.a * 0.667f);
//src.rgb = src.rgb + (sel.rgb*sel.a);
qgl_FragData[0] = src;
//qgl_FragData[0] = vec4(sel.a);
}