{"_id":"glsl-fxaa","_rev":"9-223054ba6f4e66311b476a630c00020b","name":"glsl-fxaa","description":"FXAA implementation for glslify in WebGL","dist-tags":{"latest":"3.0.0"},"versions":{"1.0.0":{"name":"glsl-fxaa","version":"1.0.0","description":"FXAA implementation for glslify in WebGL","main":"index.glsl","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com"},"dependencies":{"glslify":"^1.6.0"},"devDependencies":{"add-event-listener":"0.0.1","baboon-image":"^1.0.0","dom-style":"0.0.2","domready":"^1.0.5","gl-clear":"0.0.1","kami-batch":"^2.0.4","kami-shader":"^1.1.0","kami-texture":"^1.1.0","tape":"~2.13.2","webgl-context":"^1.2.1"},"scripts":{"test":"tape test.js"},"testling":{"files":"test.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"repository":{"type":"git","url":"git://github.com/mattdesl/glsl-fxaa.git"},"homepage":"https://github.com/mattdesl/glsl-fxaa","bugs":{"url":"https://github.com/mattdesl/glsl-fxaa/issues"},"keywords":["glslify","glsl","webgl","gl","fxaa","anti","alias","aliasing","aa","anti-alias","msaa","anti-aliasing"],"browserify":{"transform":["glslify"]},"gitHead":"2c6c72f8f3149e4d8b8166a1b3d373408458c4ee","_id":"glsl-fxaa@1.0.0","_shasum":"5fffbf6b13a4705817b354a16b86813c0c175371","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"5fffbf6b13a4705817b354a16b86813c0c175371","tarball":"https://registry.npmjs.org/glsl-fxaa/-/glsl-fxaa-1.0.0.tgz","integrity":"sha512-YmYFgarQFraSVp4nmcGC3cuguhXot5LakP5iY36JEYGQ6yy24fadiEQgZzw4MGlW9eTLoaN/PSPHVIV0nOUsFQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDmvtEc+lrxyG+nSyZcvj3bi0yOYbD9oGBrB6IvsZ5fRAiEAkoflQ0kVPvEFAL44lkUKQIr6bpNdwTNOKNKLo80qDRk="}]}},"2.0.0":{"name":"glsl-fxaa","version":"2.0.0","description":"FXAA implementation for glslify in WebGL","main":"index.glsl","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com"},"dependencies":{"glslify":"^1.6.0"},"devDependencies":{"add-event-listener":"0.0.1","baboon-image":"^1.0.0","dom-style":"0.0.2","domready":"^1.0.5","gl-clear":"0.0.1","kami-batch":"^2.0.4","kami-shader":"^1.1.0","kami-texture":"^1.1.0","tape":"~2.13.2","webgl-context":"^1.2.1"},"scripts":{"test":"tape test.js"},"testling":{"files":"test.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"repository":{"type":"git","url":"git://github.com/mattdesl/glsl-fxaa.git"},"homepage":"https://github.com/mattdesl/glsl-fxaa","bugs":{"url":"https://github.com/mattdesl/glsl-fxaa/issues"},"keywords":["glslify","glsl","webgl","gl","fxaa","anti","alias","aliasing","aa","anti-alias","msaa","anti-aliasing"],"browserify":{"transform":["glslify"]},"gitHead":"44f0e8c48be2c8911048faa9347390a994d8c1b5","_id":"glsl-fxaa@2.0.0","_shasum":"e40c6b2b98dda9c2caa80aafcc654565e4397544","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"e40c6b2b98dda9c2caa80aafcc654565e4397544","tarball":"https://registry.npmjs.org/glsl-fxaa/-/glsl-fxaa-2.0.0.tgz","integrity":"sha512-t8xUOO9K/jLy9U4Df8lIDr7mdi412umsAI9+Csw+yYMGiobaEo/EjkYFqSTrnF9KBoRwfOXSIBpU4spRluPnkg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE/I4ZQ0XI71LhV+DDP3d5NTAS6L0bLhoEkB6kzmWwI9AiEA2LhfEwBFMx+L+4vsd9J7vf3IxRpEJXwt0Qie9Yg0PNE="}]}},"2.1.0":{"name":"glsl-fxaa","version":"2.1.0","description":"FXAA implementation for glslify in WebGL","main":"index.glsl","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com"},"dependencies":{"glslify":"^1.6.0"},"devDependencies":{"add-event-listener":"0.0.1","baboon-image":"^1.0.0","dom-style":"0.0.2","domready":"^1.0.5","gl-clear":"0.0.1","kami-batch":"^2.0.4","kami-shader":"^1.1.0","kami-texture":"^1.1.0","tape":"~2.13.2","webgl-context":"^1.2.1"},"scripts":{"test":"tape test.js"},"testling":{"files":"test.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"repository":{"type":"git","url":"git://github.com/mattdesl/glsl-fxaa.git"},"homepage":"https://github.com/mattdesl/glsl-fxaa","bugs":{"url":"https://github.com/mattdesl/glsl-fxaa/issues"},"keywords":["glslify","glsl","webgl","gl","fxaa","anti","alias","aliasing","aa","anti-alias","msaa","anti-aliasing"],"browserify":{"transform":["glslify"]},"gitHead":"881fdaf863d8ab5eba1e5428ffbc2c2c19145cc4","_id":"glsl-fxaa@2.1.0","_shasum":"c7fc29207137c7959beddb154ab8b6fa8c8b4063","_from":".","_npmVersion":"1.4.21","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"dist":{"shasum":"c7fc29207137c7959beddb154ab8b6fa8c8b4063","tarball":"https://registry.npmjs.org/glsl-fxaa/-/glsl-fxaa-2.1.0.tgz","integrity":"sha512-4Nc1JRBFrC5Lb8l9lpATN637KpAsVSMeW9Zfrh+I7gZ7RKCMjzoo8XpHWn43PqYoISGMSGWdRtxjUUe1bKVqFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBZwBwzjG5IaKnN1gElmVkvwCbXnfgnxbeq0VBU+d1stAiEAlbU6w09y41COTRlssZr1SMd+QubcBHmge36DdKJN578="}]}},"3.0.0":{"name":"glsl-fxaa","version":"3.0.0","description":"FXAA implementation for glslify in WebGL","main":"index.glsl","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com"},"dependencies":{},"devDependencies":{"a-big-triangle":"^1.0.2","browserify":"^10.2.4","gl-shader":"^4.0.5","gl-texture2d":"^2.0.9","glslify":"^2.2.1","img":"^1.0.0","uglify-js":"^2.4.23","webgl-context":"^2.2.0"},"scripts":{"start":"budo demo/index.js:bundle.js --dir demo --live --verbose -- -t glslify | garnish","build":"browserify demo/index.js -t glslify | uglifyjs -cm > demo/bundle.js"},"testling":{"files":"test.js","browsers":["ie/6..latest","chrome/22..latest","firefox/16..latest","safari/latest","opera/11.0..latest","iphone/6","ipad/6","android-browser/latest"]},"repository":{"type":"git","url":"git://github.com/mattdesl/glsl-fxaa.git"},"homepage":"https://github.com/mattdesl/glsl-fxaa","bugs":{"url":"https://github.com/mattdesl/glsl-fxaa/issues"},"keywords":["glslify","glsl","webgl","gl","fxaa","anti","alias","aliasing","aa","anti-alias","msaa","anti-aliasing"],"gitHead":"5028eff0bc801aab51b884b27b47c313defa6a0c","_id":"glsl-fxaa@3.0.0","_shasum":"f432228fba9d2a8a7240943c593d20c3176f3b93","_from":".","_npmVersion":"2.1.18","_nodeVersion":"0.10.32","_npmUser":{"name":"mattdesl","email":"dave.des@gmail.com"},"dist":{"shasum":"f432228fba9d2a8a7240943c593d20c3176f3b93","tarball":"https://registry.npmjs.org/glsl-fxaa/-/glsl-fxaa-3.0.0.tgz","integrity":"sha512-DocLGbKW+YFIynx80X65GENCfLg8skTETH56flJEPEH6ZPRs//hytRmIVU5Q2c4nPkhoz1rZGmkia+ckU6g7YQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCX/I3ayUDPkHD+iuk/Qul5zIQNq4kEJwsQBlurPD0uygIga152TJgzE0MyA78M/74eFLJ8G2pNdJiuKtMiKec4fUk="}]},"maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}]}},"readme":"# glsl-fxaa\n\n[![unstable](http://badges.github.io/stability-badges/dist/unstable.svg)](http://github.com/badges/stability-badges)\n\n[(demo)](http://mattdesl.github.io/glsl-fxaa/demo) - [(source)](./demo/index.js)\n\nA WebGL implementation of Fast Approximate Anti-Aliasing (FXAA v2). This is a screen-space technique. The code was originally from [Geeks3D.com](http://www.geeks3d.com/20110405/fxaa-fast-approximate-anti-aliasing-demo-glsl-opengl-test-radeon-geforce/) and cleaned up by [Armin Ronacher](https://github.com/mitsuhiko/webgl-meincraft) for WebGL. \n\nFXAA is particularly useful in WebGL since most browsers do not currently support MSAA, and even those that do (e.g. Chrome) will not support it outside of the main frame buffer (which is common when doing post-processing effects like color grading).\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-fxaa.png)](https://nodei.co/npm/glsl-fxaa/)\n\n#### ```vec4 fxaa(sampler2D tex, vec2 fragCoord, vec2 resolution)```\n\nReturns the anti-aliased color from your frame texture. \n\nInside GLSL fragment shader:\n\n```glsl\n#pragma glslify: fxaa = require(glsl-fxaa)\n\nuniform vec2 resolution;\n\nvoid main() {\n\tvec2 fragCoord = v_texCoord0 * resolution;\n\tgl_FragColor = fxaa(u_texture0, fragCoord, resolution);\n}\n```\n\n### optimizing\n\nIf you plan on using FXAA instead of native anti-aliasing (i.e. for post-processed 3D scenes), disabling native AA when creating your WebGL context should give you a performance boost in some browsers.\n\nThis FXAA shader uses 9 dependent texture reads. For various mobile GPUs (particularly iOS), we can optimize the shader by making 5 of the texture2D calls non-dependent. To do this, the coordinates have to be computed in the vertex shader and passed along:\n\nvert shader:\n\n```glsl\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform vec2 resolution;\n\n#pragma glslify: texcoords = require(glsl-fxaa/texcoords.glsl)\n\nvoid main() {\n   //compute the texture coords and store them in varyings\n   vec2 fragCoord = vTexCoord0 * resolution;\n   texcoords(fragCoord, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n\n   //.. rest of shader\n}\n```\n\nfrag shader:\n\n```glsl\nvarying vec2 v_rgbNW;\nvarying vec2 v_rgbNE;\nvarying vec2 v_rgbSW;\nvarying vec2 v_rgbSE;\nvarying vec2 v_rgbM;\n\nuniform vec2 resolution;\n\n#pragma glslify: fxaa = require(glsl-fxaa/fxaa.glsl)\n\nvoid main() {\n    //can also use gl_FragCoord.xy\n    vec2 fragCoord = vTexCoord0 * resolution; \n\n\tgl_FragColor = fxaa(u_texture0, fragCoord, resolution, v_rgbNW, v_rgbNE, v_rgbSW, v_rgbSE, v_rgbM);\n}\n```\n\nIn most cases, you should just use the simplest `index.glsl` use case demonstrated earlier. \n\n## demo\n\nSee the [demo](demo/) folder. To run:\n\n```sh\n# clone repo\ngit clone https://github.com/mattdesl/glsl-fxaa.git\n\n# install deps\nnpm install\n\n# run local host\nnpm start\n```\n\nNow open `localhost:9966` to test. Use `npm run build` to build a bundle.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/mattdesl/glsl-fxaa/blob/master/LICENSE.md) for details.\n","maintainers":[{"name":"mattdesl","email":"dave.des@gmail.com"}],"time":{"modified":"2022-06-18T13:00:46.942Z","created":"2014-08-07T04:07:53.998Z","1.0.0":"2014-08-07T04:07:53.998Z","2.0.0":"2014-08-07T15:35:45.460Z","2.1.0":"2014-08-10T16:33:00.176Z","3.0.0":"2015-06-24T15:58:59.344Z"},"homepage":"https://github.com/mattdesl/glsl-fxaa","keywords":["glslify","glsl","webgl","gl","fxaa","anti","alias","aliasing","aa","anti-alias","msaa","anti-aliasing"],"repository":{"type":"git","url":"git://github.com/mattdesl/glsl-fxaa.git"},"author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com"},"bugs":{"url":"https://github.com/mattdesl/glsl-fxaa/issues"},"license":"MIT","readmeFilename":"README.md"}