further adjustments on bloom
This commit is contained in:
@@ -11,12 +11,12 @@ varying vec2 vTexCoord;
|
||||
uniform sampler2D u_texture;
|
||||
|
||||
void main() {
|
||||
vec4 color = texture(u_texture, vTexCoord)*vColor;
|
||||
vec4 color = texture(u_texture, vTexCoord);
|
||||
float brightness = (color.r*0.2126) + (color.g*0.7152) + (color.b * 0.0722);
|
||||
|
||||
if (brightness > 0.7) {
|
||||
gl_FragColor = color;
|
||||
} else {
|
||||
gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
|
||||
gl_FragColor = vec4(0.0);
|
||||
}
|
||||
}
|
||||
|
@@ -11,8 +11,14 @@ varying vec2 vTexCoord;
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
uniform sampler2D u_texture1;
|
||||
uniform sampler2D u_texture2;
|
||||
|
||||
void main() {
|
||||
vec4 origColor = texture(u_texture, vTexCoord);
|
||||
vec4 blurredColor = texture(u_texture1, vTexCoord);
|
||||
gl_FragColor = origColor + blurredColor;
|
||||
vec4 origColor = texture2D(u_texture, vTexCoord);
|
||||
vec4 blurredColor = texture2D(u_texture1, vTexCoord);
|
||||
vec4 lightFilterColor = texture2D(u_texture2, vTexCoord);
|
||||
|
||||
vec4 result;
|
||||
result = origColor + blurredColor;
|
||||
gl_FragColor = result*vColor;
|
||||
}
|
||||
|
@@ -43,5 +43,5 @@ void main() {
|
||||
sum += texture2D(u_texture, vec2(tc.x + 4.0*blur*hstep, tc.y + 4.0*blur*vstep)) * 0.035855;
|
||||
sum += texture2D(u_texture, vec2(tc.x + 5.0*blur*hstep, tc.y + 5.0*blur*vstep)) * 0.014374;
|
||||
|
||||
gl_FragColor = vColor * vec4(sum.rgb, 1.0);
|
||||
gl_FragColor = vec4(sum.rgb, 1.0);
|
||||
}
|
Reference in New Issue
Block a user