mirror of
https://github.com/Motschen/Blur.git
synced 2025-12-17 12:15:10 +01:00
Update to 1.17-pre3
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"blend": {
|
||||
"func": "add",
|
||||
"srcrgb": "one",
|
||||
"dstrgb": "zero"
|
||||
"srcrgb": "srcalpha",
|
||||
"dstrgb": "1-srcalpha"
|
||||
},
|
||||
"vertex": "sobel",
|
||||
"fragment": "blur:fade_in_blur",
|
||||
|
||||
Reference in New Issue
Block a user