Bloom
This commit is contained in:
26
core/assets/bloomshaders/gaussian.fragment.glsl
Normal file
26
core/assets/bloomshaders/gaussian.fragment.glsl
Normal file
@@ -0,0 +1,26 @@
|
||||
#ifdef GL_ES
|
||||
#define LOWP lowp
|
||||
#define MED mediump
|
||||
precision lowp float;
|
||||
#else
|
||||
#define LOWP
|
||||
#define MED
|
||||
#endif
|
||||
|
||||
uniform sampler2D u_texture;
|
||||
varying MED vec2 v_texCoords0;
|
||||
varying MED vec2 v_texCoords1;
|
||||
varying MED vec2 v_texCoords2;
|
||||
varying MED vec2 v_texCoords3;
|
||||
varying MED vec2 v_texCoords4;
|
||||
const float center = 0.2270270270;
|
||||
const float close = 0.3162162162;
|
||||
const float far = 0.0702702703;
|
||||
void main()
|
||||
{
|
||||
gl_FragColor.rgb = far * texture2D(u_texture, v_texCoords0).rgb
|
||||
+ close * texture2D(u_texture, v_texCoords1).rgb
|
||||
+ center * texture2D(u_texture, v_texCoords2).rgb
|
||||
+ close * texture2D(u_texture, v_texCoords3).rgb
|
||||
+ far * texture2D(u_texture, v_texCoords4).rgb;
|
||||
}
|
||||
Reference in New Issue
Block a user