mirror of
https://github.com/servo/servo.git
synced 2025-07-25 16:20:36 +01:00
Remove unused old blur shader.
This commit is contained in:
parent
9991e0674b
commit
8aff2dd298
2 changed files with 0 additions and 58 deletions
|
@ -1,44 +0,0 @@
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
// `vBorderPosition` is the position of the source texture in the atlas.
|
|
||||||
|
|
||||||
float gauss(float x, float sigma) {
|
|
||||||
return (1.0 / sqrt(6.283185307179586 * sigma * sigma)) * exp(-(x * x) / (2.0 * sigma * sigma));
|
|
||||||
}
|
|
||||||
|
|
||||||
void main(void) {
|
|
||||||
#ifdef SERVO_ES2
|
|
||||||
// TODO(gw): for loops have to be unrollable on es2.
|
|
||||||
SetFragColor(vec4(1.0, 0.0, 0.0, 1.0));
|
|
||||||
#else
|
|
||||||
vec2 sideOffsets = (vDestTextureSize - vSourceTextureSize) / 2.0;
|
|
||||||
int range = int(vBlurRadius) * 3;
|
|
||||||
float sigma = vBlurRadius / 2.0;
|
|
||||||
vec4 value = vec4(0.0);
|
|
||||||
vec2 sourceTextureUvOrigin = vBorderPosition.xy;
|
|
||||||
vec2 sourceTextureUvSize = vBorderPosition.zw - sourceTextureUvOrigin;
|
|
||||||
for (int offset = -range; offset <= range; offset++) {
|
|
||||||
float offsetF = float(offset);
|
|
||||||
vec2 lColorTexCoord = (vColorTexCoord.xy * vDestTextureSize - sideOffsets) /
|
|
||||||
vSourceTextureSize;
|
|
||||||
lColorTexCoord += vec2(offsetF) / vSourceTextureSize * uDirection;
|
|
||||||
vec4 x = lColorTexCoord.x >= 0.0 &&
|
|
||||||
lColorTexCoord.x <= 1.0 &&
|
|
||||||
lColorTexCoord.y >= 0.0 &&
|
|
||||||
lColorTexCoord.y <= 1.0 ?
|
|
||||||
texture(sDiffuse, lColorTexCoord * sourceTextureUvSize + sourceTextureUvOrigin) :
|
|
||||||
vec4(0.0);
|
|
||||||
|
|
||||||
// Alpha must be premultiplied in order to properly blur the alpha channel.
|
|
||||||
value += vec4(x.rgb * x.a, x.a) * gauss(offsetF, sigma);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Unpremultiply the alpha.
|
|
||||||
value = vec4(value.rgb / value.a, value.a);
|
|
||||||
|
|
||||||
SetFragColor(value);
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,14 +0,0 @@
|
||||||
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
||||||
|
|
||||||
void main(void)
|
|
||||||
{
|
|
||||||
vColorTexCoord = aColorTexCoordRectTop.xy;
|
|
||||||
vBorderPosition = aBorderPosition;
|
|
||||||
vBlurRadius = aBlurRadius;
|
|
||||||
vDestTextureSize = aDestTextureSize;
|
|
||||||
vSourceTextureSize = aSourceTextureSize;
|
|
||||||
gl_Position = uTransform * vec4(aPosition, 1.0);
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue