This commit is contained in:
Branimir Karadžić 2018-09-20 15:49:56 -07:00
parent 2066d36774
commit fd65b5a36e
6 changed files with 39 additions and 34 deletions

View File

@ -7,7 +7,6 @@ $input v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
#include "../common/common.sh"
uniform vec4 u_color;
void main()
@ -18,5 +17,4 @@ void main()
// for convenience, we also output the same color, to the first texture of the texture chain used for bloom.
// this color will now be bloomed, in the following passes.
gl_FragData[1] = u_color;
}

View File

@ -23,20 +23,20 @@ void main()
sum += (4.0/32.0) * texture2D(s_tex, uv).rgba;
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(-halfpixel.x, -halfpixel.y));
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(+halfpixel.x, +halfpixel.y));
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(+halfpixel.x, -halfpixel.y));
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(-halfpixel.x, -halfpixel.y) );
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(+halfpixel.x, +halfpixel.y) );
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(+halfpixel.x, -halfpixel.y) );
sum += (4.0/32.0) * texture2D(s_tex, uv + vec2(-halfpixel.x, +halfpixel.y) );
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, 0.0));
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, 0.0));
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(0.0, +oneepixel.y));
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(0.0, -oneepixel.y));
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, 0.0) );
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, 0.0) );
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(0.0, +oneepixel.y) );
sum += (2.0/32.0) * texture2D(s_tex, uv + vec2(0.0, -oneepixel.y) );
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, +oneepixel.y));
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, +oneepixel.y));
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, -oneepixel.y));
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, -oneepixel.y));
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, +oneepixel.y) );
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, +oneepixel.y) );
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(+oneepixel.x, -oneepixel.y) );
sum += (1.0/32.0) * texture2D(s_tex, uv + vec2(-oneepixel.x, -oneepixel.y) );
gl_FragColor.xyzw = sum;
}

View File

@ -1,9 +1,13 @@
$input v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
SAMPLER2D(s_tex, 0);
//SAMPLER2D(s_target_tex, 1);
uniform vec4 u_pixelSize;
uniform vec4 u_intensity;

View File

@ -6,7 +6,6 @@ $output v_wpos, v_view, v_normal, v_tangent, v_bitangent, v_texcoord0
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"
void main()

View File

@ -1,6 +1,10 @@
$input a_position, a_texcoord0
$output v_texcoord0
/*
* Copyright 2018 Eric Arnebäck. All rights reserved.
* License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
*/
#include "../common/common.sh"