Update to 1.17-pre3

This commit is contained in:
Pyrofab
2021-06-02 14:33:24 +02:00
parent a520948fff
commit e1346d2516
11 changed files with 169 additions and 146 deletions

View File

@@ -1,9 +1,9 @@
#version 120
#version 150
uniform sampler2D DiffuseSampler;
varying vec2 texCoord;
varying vec2 oneTexel;
in vec2 texCoord;
in vec2 oneTexel;
uniform vec2 InSize;
@@ -11,6 +11,8 @@ uniform vec2 BlurDir;
uniform float Radius;
uniform float Progress;
out vec4 fragColor;
void main() {
vec4 blurred = vec4(0.0);
float totalStrength = 0.0;
@@ -18,7 +20,7 @@ void main() {
float totalSamples = 0.0;
float progRadius = floor(Radius * Progress);
for(float r = -progRadius; r <= progRadius; r += 1.0) {
vec4 sample = texture2D(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
vec4 sample = texture(DiffuseSampler, texCoord + oneTexel * r * BlurDir);
// Accumulate average alpha
totalAlpha = totalAlpha + sample.a;
@@ -29,5 +31,5 @@ void main() {
totalStrength = totalStrength + strength;
blurred = blurred + sample;
}
gl_FragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha);
fragColor = vec4(blurred.rgb / (progRadius * 2.0 + 1.0), totalAlpha);
}

View File

@@ -1,8 +1,8 @@
{
"blend": {
"func": "add",
"srcrgb": "one",
"dstrgb": "zero"
"srcrgb": "srcalpha",
"dstrgb": "1-srcalpha"
},
"vertex": "sobel",
"fragment": "blur:fade_in_blur",