26 lines
791 B
GLSL
26 lines
791 B
GLSL
#version 330 core
|
|
|
|
uniform sampler2DRect colorSampler;
|
|
uniform sampler2DRect blurSampler0;
|
|
uniform sampler2DRect blurSampler1;
|
|
uniform sampler2DRect blurSampler2;
|
|
uniform sampler2DRect blurSampler3;
|
|
|
|
uniform int width;
|
|
uniform int height;
|
|
|
|
layout(location = 0)out vec3 minMaxMean;
|
|
layout(location = 1)out vec4 outColor;
|
|
|
|
void main(void) {
|
|
ivec2 ipos = ivec2(gl_FragCoord.xy);
|
|
vec3 color = texelFetch(colorSampler, ipos).xyz;
|
|
color += texelFetch(blurSampler0, ipos).xyz;
|
|
vec2 pos = vec2(gl_FragCoord.x/width, gl_FragCoord.y/height);
|
|
color += texture(blurSampler1, pos).xyz;
|
|
color += texture(blurSampler2, pos).xyz;
|
|
color += texture(blurSampler3, pos).xyz;
|
|
outColor = vec4(color, 1.0);
|
|
minMaxMean = vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);
|
|
}
|