{"_id":"@amilajack/glsl-fast-gaussian-blur","_rev":"1-17fec7f74e3867cdf375c3805f4a5e0d","name":"@amilajack/glsl-fast-gaussian-blur","dist-tags":{"latest":"2.0.0"},"versions":{"2.0.0":{"name":"@amilajack/glsl-fast-gaussian-blur","version":"2.0.0","description":"optimized 9-tap gaussian blur for GLSL","main":"./src/index.js","license":"MIT","private":false,"author":{"name":"Amila Welihinda","email":"amilajack@gmail.com","url":"https://github.com/amilajack"},"dependencies":{},"devDependencies":{"a-big-triangle":"^1.0.0","array-range":"^1.0.1","baboon-image-uri":"^1.0.1","canvas-loop":"^1.0.4","eslint":"^4.19.1","eslint-config-bliss":"^1.0.21","gl-fbo":"^2.0.3","gl-post":"^1.0.1","gl-shader":"^4.0.1","gl-texture2d":"^2.0.8","glslify-loader":"^1.0.2","lint-staged":"^7.0.5","load-img":"^1.0.0","raf-loop":"^1.1.0","raw-loader":"^0.5.1","webgl-context":"^2.1.2","webpack":"^4.7.0","webpack-cli":"^2.1.2","webpack-dev-server":"^3.1.4"},"scripts":{"build":"webpack","lint":"eslint .","precommit":"lint-staged","preversion":"yarn build","start":"webpack-dev-server"},"lint-staged":{"*.js":["eslint --fix","git add"]},"files":["demo"],"keywords":["glsl","shader","webgl","stackgl","glslify","blur","blurs","blurred","blurring","shaders","tap","taps","gaussian","kernel","weights"],"repository":{"type":"git","url":"git://github.com/amilajack/glsl-fast-gaussian-blur.git"},"homepage":"https://github.com/amilajack/glsl-fast-gaussian-blur","bugs":{"url":"https://github.com/amilajack/glsl-fast-gaussian-blur/issues"},"gitHead":"2f1ba53b10995d6a0e2c894ab202a88f994253c3","_id":"@amilajack/glsl-fast-gaussian-blur@2.0.0","_npmVersion":"6.0.0","_nodeVersion":"10.0.0","_npmUser":{"name":"amilajack","email":"amilajack@gmail.com"},"dist":{"integrity":"sha512-TFraVM+sXepZGbKlqxMBSjEZggAG75AD6WEGSK4c/yg0n8gRmdpnjq0g14dkvTAyZPtAVO3yuPIr3i+hvlLPfg==","shasum":"07bcfeb874cd2a555c3951756eecb5d72eb24e38","tarball":"https://registry.npmjs.org/@amilajack/glsl-fast-gaussian-blur/-/glsl-fast-gaussian-blur-2.0.0.tgz","fileCount":3,"unpackedSize":5436,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJa7gMDCRA9TVsSAnZWagAAQ1EP/33zqUia+hAC0UP4qa8B\nFPvk3tebBhQdiksCf+RCegNT9fUMAQTzOQZPI8HB+oaizpaD4EEeIG3PaStj\nthFaBpklM2GAtp/Wx8g84p5XCiKOAOTnLvTJ4io0h0wey5ok895M2oNKi4yh\nFx6MWdz76PR0ja27Agcbp3Gy9ZDdxZtqKvFcsAaEjGI1l068mrQBuboYTnb5\nc8C3hZub4TLLkFwzeNSVOvwldZu3JA21b98zBdR67T6JFl7pNoASuvysQMq1\n/DFySEAxwETzZ5ifTHO+VQlektpum8tEBakXNdwGbpCrVSVVvPRzuhsQsiAr\nf2+kNbBO3cbNS06JdO4StipzQ93HkPTFpzugT6GdG4znMQbrRYwkaO/EV54K\nBb+5Um6QnlhT4RD4NF0Cyf5hTopO+N5I5lUZ9af+/tnTBrIm/4aqM06+Mnpq\nYvLtCzzKFF6erC/xOsaxYpVPBpqD2+erJQxhDTExbaBdIdeCpFXe9n4QR5i5\nI/bK3J479sBAU08HJ6dlieaWiMqyKPTWwI3vN5mXszAeP+wVxoJibjCyPN0N\nRtnmtgKeLYiRLej76JtzZqO0ulvXTwq9GzyxteTd9LDzB5kqkeQ4S6sRMwKd\nTeTU0VTB8YlfwYKbig46CeFtj0U1XW2U82r/LU9qlWLq5EXxKoTHljZUDU8D\nqLFD\r\n=USpQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC3aoD+3tlIYWvaGPaAOrHS2NuMKwPI3amPFNTSz8p8EgIhAJ8hcX6VLdBm703XbtjGFLlsq5nF0zbLeU8yhCyGHugL"}]},"maintainers":[{"name":"amilajack","email":"amilajack@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/glsl-fast-gaussian-blur_2.0.0_1525547777699_0.908284224030772"},"_hasShrinkwrap":false}},"time":{"created":"2018-05-05T19:16:17.642Z","2.0.0":"2018-05-05T19:16:17.809Z","modified":"2022-04-04T13:48:43.963Z"},"maintainers":[{"name":"amilajack","email":"amilajack@gmail.com"}],"description":"optimized 9-tap gaussian blur for GLSL","homepage":"https://github.com/amilajack/glsl-fast-gaussian-blur","keywords":["glsl","shader","webgl","stackgl","glslify","blur","blurs","blurred","blurring","shaders","tap","taps","gaussian","kernel","weights"],"repository":{"type":"git","url":"git://github.com/amilajack/glsl-fast-gaussian-blur.git"},"author":{"name":"Amila Welihinda","email":"amilajack@gmail.com","url":"https://github.com/amilajack"},"bugs":{"url":"https://github.com/amilajack/glsl-fast-gaussian-blur/issues"},"license":"MIT","readme":"# glsl-fast-gaussian-blur\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n[![demo](http://i.imgur.com/dfCyeqv.png)](http://jam3.github.io/glsl-fast-gaussian-blur/)\n\n[demo](http://jam3.github.io/glsl-fast-gaussian-blur/) - [source](./demo/index.js)\n\nOptimized separable gaussian blurs for GLSL. This is adapted from [Efficient Gaussian Blur with Linear Sampling](http://rastergrid.com/blog/2010/09/efficient-gaussian-blur-with-linear-sampling/).\n\n## Example\n\nThe function blurs in a single direction. For correct results, the texture should be using `gl.LINEAR` filtering.\n\n```glsl\n#pragma glslify: blur = require('glsl-fast-gaussian-blur')\n\nuniform vec2 iResolution;\nuniform sampler2D iChannel0;\nuniform vec2 direction;\n\nvoid main() {\n  vec2 uv = vec2(gl_FragCoord.xy / iResolution.xy);\n  gl_FragColor = blur(iChannel0, uv, iResolution.xy, direction);\n}\n```\n\nThe module provides three levels of \"taps\" (the number of pixels averaged for the blur) that can be required individually. The default is 9.\n\n```glsl\n#pragma glslify: blur1 = require('glsl-fast-gaussian-blur/13')\n#pragma glslify: blur2 = require('glsl-fast-gaussian-blur/9')\n#pragma glslify: blur3 = require('glsl-fast-gaussian-blur/5')\n```\n\nSince this is separable, you will need multiple passes to blur an image in both directions. See [here](https://github.com/mattdesl/lwjgl-basics/wiki/ShaderLesson5) for details or [the demo](./demo/index.js) for an implementation.\n\n## Install\n\nUse [npm](https://www.npmjs.com/) to install and [glslify](https://github.com/stackgl/glslify) to consume the function in your shaders.\n\n```sh\nnpm install glsl-fast-gaussian-blur --save\n```\n\n## Setup\n```bash\ngit clone https://github.com/amilajack/glsl-fast-gaussian-blur\ncd glsl-fast-gaussian-blur\nyarn\nyarn start\n```\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-fast-gaussian-blur.png)](https://www.npmjs.com/package/glsl-fast-gaussian-blur)\n\n#### `vec4 blur(sampler2D image, vec2 uv, vec2 resolution, vec2 direction)`\n\nBlurs the `image` from the specified `uv` coordinate, using the given `resolution` (size in pixels of screen) and `direction` -- typically either `[1, 0]` (horizontal) or `[0, 1]` (vertical).\n\nReturns the blurred pixel color.\n\n## Further Optimizations\n\nThis can be further optimized on some devices (notably PowerVR) by using non-dependent texture reads. This can be done by calculating the texture coordinates in the vertex shader, and passing them as varyings to the fragment shader. This is left as an exercise for the reader to keep this module simple. You can read more about it [here](http://xissburg.com/faster-gaussian-blur-in-glsl/).\n","readmeFilename":"README.md"}