Untitled
Loading...
Searching...
No Matches
bloom_upscale.frag
Go to the documentation of this file.
1#version 460 core
2
3uniform sampler2D srcTexture;
4uniform float uFilterRadius;
5
8
9void main() {
10
11 float x = uFilterRadius;
12 float y = uFilterRadius;
13
14 vec3 a = texture(srcTexture, vec2(vUV.x - x, vUV.y + y)).rgb;
15 vec3 b = texture(srcTexture, vec2(vUV.x, vUV.y + y)).rgb;
16 vec3 c = texture(srcTexture, vec2(vUV.x + x, vUV.y + y)).rgb;
17
18 vec3 d = texture(srcTexture, vec2(vUV.x - x, vUV.y)).rgb;
19 vec3 e = texture(srcTexture, vec2(vUV.x, vUV.y)).rgb;
20 vec3 f = texture(srcTexture, vec2(vUV.x + x, vUV.y)).rgb;
21
22 vec3 g = texture(srcTexture, vec2(vUV.x - x, vUV.y - y)).rgb;
23 vec3 h = texture(srcTexture, vec2(vUV.x, vUV.y - y)).rgb;
24 vec3 i = texture(srcTexture, vec2(vUV.x + x, vUV.y - y)).rgb;
25
26 vec3 upsample = e * 4.0;
27 upsample += (b + d + f + h) * 2.0;
28 upsample += (a + c + g + i);
29 upsample *= 1.0 / 16.0;
30
31 fragColor = vec4(upsample, 1.0);
32
33}
void main()
out vec4 fragColor
Definition bloom.frag:6
uniform sampler2D srcTexture
uniform float uFilterRadius
in vec2 vUV
Definition lightmap.frag:13
float x
Definition types.h:11
float y
Definition types.h:11
Definition types.h:11
Definition types.h:12
Definition types.h:13