Better bloom
This commit is contained in:
@@ -15,32 +15,4 @@ void main(){
|
||||
+ center * texture2D(u_texture, v_texCoords2)
|
||||
+ close * texture2D(u_texture, v_texCoords3)
|
||||
+ far * texture2D(u_texture, v_texCoords4);
|
||||
|
||||
|
||||
//TODO this is broken (too bright)
|
||||
|
||||
/*
|
||||
vec4
|
||||
v1 = texture2D(u_texture, v_texCoords0),
|
||||
v2 = texture2D(u_texture, v_texCoords1),
|
||||
v3 = texture2D(u_texture, v_texCoords2),
|
||||
v4 = texture2D(u_texture, v_texCoords3),
|
||||
v5 = texture2D(u_texture, v_texCoords4);
|
||||
|
||||
float
|
||||
a1 = v1.a * far,
|
||||
a2 = v2.a * close,
|
||||
a3 = v3.a * center,
|
||||
a4 = v4.a * close,
|
||||
a5 = v5.a * far;
|
||||
|
||||
gl_FragColor = vec4(
|
||||
//RGB values are weighed by their alpha values and their base weight (less alpha -> less contribution)
|
||||
(v1.rgb * a1 + v2.rgb * a2 + v3.rgb * a3 + v4.rgb * a4 + v5.rgb * a5) /
|
||||
//RGB must then be weighed by the sum of all alpha processed. don't allow divide by zero
|
||||
max(a1 + a2 + a3 + a4 + a5, 0.0001),
|
||||
//alpha is just the weighed sum
|
||||
a1 + a2 + a3 + a4 + a5);*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user