|
63 | 63 | void main() { |
64 | 64 | float x = properties.invSize.x; |
65 | 65 | float y = properties.invSize.y; |
| 66 | + float twoX = 2.0 * x; |
| 67 | + float twoY = 2.0 * y; |
66 | 68 |
|
67 | | - float a = texture(lumSampler, vec2(texCoord.x - 2*x, texCoord.y + 2*y)).r; |
68 | | - float b = texture(lumSampler, vec2(texCoord.x, texCoord.y + 2*y)).r; |
69 | | - float c = texture(lumSampler, vec2(texCoord.x + 2*x, texCoord.y + 2*y)).r; |
| 69 | + float a = texture(lumSampler, vec2(texCoord.x - twoX, texCoord.y + twoY)).r; |
| 70 | + float b = texture(lumSampler, vec2(texCoord.x, texCoord.y + twoY)).r; |
| 71 | + float c = texture(lumSampler, vec2(texCoord.x + twoX, texCoord.y + twoY)).r; |
70 | 72 |
|
71 | | - float d = texture(lumSampler, vec2(texCoord.x - 2*x, texCoord.y)).r; |
72 | | - float e = texture(lumSampler, vec2(texCoord.x, texCoord.y)).r; |
73 | | - float f = texture(lumSampler, vec2(texCoord.x + 2*x, texCoord.y)).r; |
| 73 | + float d = texture(lumSampler, vec2(texCoord.x - twoX, texCoord.y)).r; |
| 74 | + float e = texture(lumSampler, vec2(texCoord.x, texCoord.y)).r; |
| 75 | + float f = texture(lumSampler, vec2(texCoord.x + twoX, texCoord.y)).r; |
74 | 76 |
|
75 | | - float g = texture(lumSampler, vec2(texCoord.x - 2*x, texCoord.y - 2*y)).r; |
76 | | - float h = texture(lumSampler, vec2(texCoord.x, texCoord.y - 2*y)).r; |
77 | | - float i = texture(lumSampler, vec2(texCoord.x + 2*x, texCoord.y - 2*y)).r; |
| 77 | + float g = texture(lumSampler, vec2(texCoord.x - twoX, texCoord.y - twoY)).r; |
| 78 | + float h = texture(lumSampler, vec2(texCoord.x, texCoord.y - twoY)).r; |
| 79 | + float i = texture(lumSampler, vec2(texCoord.x + twoX, texCoord.y - twoY)).r; |
78 | 80 |
|
79 | 81 | float j = texture(lumSampler, vec2(texCoord.x - x, texCoord.y + y)).r; |
80 | 82 | float k = texture(lumSampler, vec2(texCoord.x + x, texCoord.y + y)).r; |
81 | 83 | float l = texture(lumSampler, vec2(texCoord.x - x, texCoord.y - y)).r; |
82 | 84 | float m = texture(lumSampler, vec2(texCoord.x + x, texCoord.y - y)).r; |
83 | 85 |
|
84 | | - outLum = e*0.125; |
85 | | - outLum += (a+c+g+i)*0.03125; |
86 | | - outLum += (b+d+f+h)*0.0625; |
87 | | - outLum += (j+k+l+m)*0.125; |
| 86 | + outLum = e * 0.125; |
| 87 | + outLum += (a + c + g + i) * 0.03125; |
| 88 | + outLum += (b + d + f + h) * 0.0625; |
| 89 | + outLum += (j + k + l + m) * 0.125; |
88 | 90 | } |
89 | 91 | "#, |
90 | 92 | ) |
|
0 commit comments