speck-renderer
Version:
Browser-based WebGL molecule renderer with the goal of producing figures that are as attractive as they are practical.
7 lines (6 loc) • 819 B
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
var blurShader = "#version 100\nprecision highp float;\n\nattribute vec3 aPosition;\n\nvoid main() {\n gl_Position = vec4(aPosition, 1);\n}\n\n\n// __split__\n\n\n#version 100\nprecision highp float;\n\nuniform sampler2D uTexture;\nuniform float uRes;\nuniform int leftRight;\n\nvoid main() {\n vec2 dir;\n if (leftRight == 1) {\n dir = vec2(1,0)/uRes;\n } else {\n dir = vec2(0,1)/uRes;\n }\n const int range = 16;\n vec4 sample = vec4(0,0,0,0);\n for (int i = -range; i <= range; i++) {\n vec2 p = gl_FragCoord.xy/uRes + dir * float(i);\n sample += texture2D(uTexture, p);\n }\n sample /= float(range) * 2.0 + 1.0;\n gl_FragColor = sample;\n}";
exports.default = blurShader;