Untitled
Toggle main menu visibility
Loading...
Searching...
No Matches
bloom_downscale.frag
Go to the documentation of this file.
1
#version 460 core
2
3
uniform sampler2D
srcTexture
;
4
5
in
vec2
vUV
;
6
out
vec4
fragColor
;
7
8
void
main
() {
9
10
vec2
srcTexelSize = 1.0 /
vec2
(textureSize(
srcTexture
, 0));
11
float
x = srcTexelSize.
x
;
12
float
y = srcTexelSize.
y
;
13
14
15
vec3
a = texture(
srcTexture
,
vec2
(
vUV
.
x
- 2.0 * x,
vUV
.
y
+ 2.0 * y)).rgb;
16
vec3
b = texture(
srcTexture
,
vec2
(
vUV
.
x
,
vUV
.
y
+ 2.0*y)).rgb;
17
vec3
c = texture(
srcTexture
,
vec2
(
vUV
.
x
+ 2.0 * x,
vUV
.
y
+ 2.0 * y)).rgb;
18
19
vec3
d = texture(
srcTexture
,
vec2
(
vUV
.
x
- 2.0 * x,
vUV
.
y
)).rgb;
20
vec3
e = texture(
srcTexture
,
vec2
(
vUV
.
x
,
vUV
.
y
)).rgb;
21
vec3
f = texture(
srcTexture
,
vec2
(
vUV
.
x
+ 2.0 * x,
vUV
.
y
)).rgb;
22
23
vec3
g = texture(
srcTexture
,
vec2
(
vUV
.
x
- 2.0 * x,
vUV
.
y
- 2.0 * y)).rgb;
24
vec3
h = texture(
srcTexture
,
vec2
(
vUV
.
x
,
vUV
.
y
- 2.0*y)).rgb;
25
vec3
i = texture(
srcTexture
,
vec2
(
vUV
.
x
+ 2.0 * x,
vUV
.
y
- 2.0 * y)).rgb;
26
27
vec3
j = texture(
srcTexture
,
vec2
(
vUV
.
x
- x,
vUV
.
y
+ y)).rgb;
28
vec3
k = texture(
srcTexture
,
vec2
(
vUV
.
x
+ x,
vUV
.
y
+ y)).rgb;
29
vec3
l = texture(
srcTexture
,
vec2
(
vUV
.
x
- x,
vUV
.
y
- y)).rgb;
30
vec3
m = texture(
srcTexture
,
vec2
(
vUV
.
x
+ x,
vUV
.
y
- y)).rgb;
31
32
vec3
downsample = e * 0.125;
33
downsample += (a + c + g + i) * 0.03125;
34
downsample += (b + d + f + h) * 0.0625;
35
downsample += (j + k + l + m) * 0.125;
36
37
fragColor
=
vec4
(downsample, 1.0);
38
}
main
void main()
Definition
audio_probe_bake.comp:465
fragColor
out vec4 fragColor
Definition
bloom.frag:6
srcTexture
uniform sampler2D srcTexture
Definition
bloom_downscale.frag:3
vUV
in vec2 vUV
Definition
lightmap.frag:13
vec2::x
float x
Definition
types.h:11
vec2::y
float y
Definition
types.h:11
vec2
Definition
types.h:11
vec3
Definition
types.h:12
vec4
Definition
types.h:13
src
render
bloom_downscale.frag
Generated by
1.18.0