mirror of
https://github.com/Rezmason/matrix.git
synced 2026-04-23 08:09:31 -07:00
All non-trivial shaders are now loaded from files.
This commit is contained in:
17
shaders/glsl/bloomPass.blur.frag.glsl
Normal file
17
shaders/glsl/bloomPass.blur.frag.glsl
Normal file
@@ -0,0 +1,17 @@
|
||||
precision mediump float;
|
||||
|
||||
uniform float width, height;
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 direction;
|
||||
|
||||
varying vec2 vUV;
|
||||
|
||||
void main() {
|
||||
vec2 size = width > height ? vec2(width / height, 1.) : vec2(1., height / width);
|
||||
gl_FragColor =
|
||||
texture2D(tex, vUV) * 0.442 +
|
||||
(
|
||||
texture2D(tex, vUV + direction / max(width, height) * size) +
|
||||
texture2D(tex, vUV - direction / max(width, height) * size)
|
||||
) * 0.279;
|
||||
}
|
||||
Reference in New Issue
Block a user