{"versions":{"1.0.0":{"name":"glsl-aastep","version":"1.0.0","description":"anti-alias smoothstep utility function","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{},"scripts":{"test":"node test.js"},"keywords":["aa","aastep","anti","alias","anti-alias","antialias","derivative","standard","float","dFdx","dFdy","GL_OES_standard_derivatives"],"repository":{"type":"git","url":"git://github.com/stackgl/glsl-aastep.git"},"homepage":"https://github.com/stackgl/glsl-aastep","bugs":{"url":"https://github.com/stackgl/glsl-aastep/issues"},"gitHead":"4beb360b31eb0d4471cf5f41c65aebcc2bb32139","_id":"glsl-aastep@1.0.0","_shasum":"1cb896b94e377b5a69db7646923e0f96233328d8","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"1cb896b94e377b5a69db7646923e0f96233328d8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glsl-aastep/-/glsl-aastep-1.0.0.tgz","size":1451,"integrity":"sha512-4eV/REFLz9ohefzYnVkV7Xe4vHzLRelpwyzto9TZ7/4jwxYXIFxf7+j+L+LeDrUmoDqzo1yz3SRa/gSijQBJAQ=="},"directories":{},"_cnpmcore_publish_time":"2021-12-24T04:47:22.482Z","contributors":[]},"1.0.1":{"name":"glsl-aastep","version":"1.0.1","description":"anti-alias smoothstep utility function","main":"index.js","license":"MIT","author":{"name":"Matt DesLauriers","email":"dave.des@gmail.com","url":"https://github.com/mattdesl"},"dependencies":{},"devDependencies":{},"scripts":{"test":"node test.js"},"keywords":["aa","aastep","anti","alias","anti-alias","antialias","derivative","standard","float","dFdx","dFdy","GL_OES_standard_derivatives"],"repository":{"type":"git","url":"git://github.com/stackgl/glsl-aastep.git"},"homepage":"https://github.com/stackgl/glsl-aastep","bugs":{"url":"https://github.com/stackgl/glsl-aastep/issues"},"gitHead":"49d59670789be4b9863c3991baa3a58b9bff8c05","_id":"glsl-aastep@1.0.1","_shasum":"eeaf16961e472c9b8b3d965d080ab8ec1d4c6bb8","_from":".","_npmVersion":"1.4.28","_npmUser":{"name":"anonymous","email":"dave.des@gmail.com"},"maintainers":[{"name":"anonymous","email":"dave.des@gmail.com"}],"dist":{"shasum":"eeaf16961e472c9b8b3d965d080ab8ec1d4c6bb8","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/glsl-aastep/-/glsl-aastep-1.0.1.tgz","size":1481,"integrity":"sha512-PkaadLzPyxlsCmKBd99FK6H1c8z+p4F6iPbc0noWy5zc5O73kejRvw4kzfxKdzE8cXm5OLhExPBP/X4h7rLGnw=="},"directories":{},"_cnpmcore_publish_time":"2021-12-24T04:47:23.341Z","contributors":[]}},"dist-tags":{"latest":"1.0.1"},"name":"glsl-aastep","time":{"created":"2022-01-27T08:10:37.908Z","modified":"2024-12-29T00:47:29.143Z","1.0.0":"2015-04-05T16:15:52.808Z","1.0.1":"2015-04-05T20:06:26.320Z"},"readme":"# glsl-aastep\n\n[![stable](http://badges.github.io/stability-badges/dist/stable.svg)](http://github.com/badges/stability-badges)\n\n![smooth](http://i.imgur.com/w7El33x.png)\n\n[(glslbin demo)](http://glslb.in/s/d7b309df)\n\nPerforms a smoothstep using standard derivatives for anti-aliased edges at any level of magnification. If `GL_OES_standard_derivatives` is not available, this falls back to using `step()` without any anti-aliasing. \n\nFor this module to work, you must enable standard derivatives at your top-level shader:\n\n```glsl\nprecision mediump float;\n\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#pragma glslify: aastep = require('glsl-aastep')\n\n//rest of your shader\n```\n\nA full example of 2D circle rendering:\n\n```glsl\nprecision highp float;\n\n#ifdef GL_OES_standard_derivatives\n#extension GL_OES_standard_derivatives : enable\n#endif\n\n#pragma glslify: aastep = require('glsl-aastep')\n\nuniform float iGlobalTime;\nuniform vec3  iResolution;\n\nvoid main() {\n  //centered texture coordinates\n  vec2 uv = vec2(gl_FragCoord.xy / iResolution.xy) - 0.5;\n\n  //correct aspect\n  uv.x *= iResolution.x / iResolution.y;\n\n  //animate zoom\n  uv /= sin(iGlobalTime * 0.2); \n\n  //radial distance\n  float len = length(uv);\n\n  //anti-alias\n  len = aastep(0.5, len);\n\n  gl_FragColor.rgb = vec3(len);\n  gl_FragColor.a   = 1.0;\n}\n```\n\nSuggestions/PRs welcome.\n\n## Usage\n\n[![NPM](https://nodei.co/npm/glsl-aastep.png)](https://www.npmjs.com/package/glsl-aastep)\n\n#### `float aastep(float threshold, float value)`\n\nPerforms a `step(threshold, value)` function, except that the edge is smoothed across the width of a single fragment to create anti-aliasing at any scale. Returns the smoothed float.\n\n## Contributing\n\nSee [stackgl/contributing](https://github.com/stackgl/contributing) for details.\n\n## License\n\nMIT, see [LICENSE.md](http://github.com/stackgl/glsl-aastep/blob/master/LICENSE.md) for details.","users":{}}