JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 161
  • Score
    100M100P100Q86444F
  • License MIT

optimized FXAA shader for ThreeJS

Package Exports

  • three-shader-fxaa

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (three-shader-fxaa) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

three-shader-fxaa

experimental

Demo

screen

Optimized FXAA shader for ThreeJS. This shader is compiled and versioned with glslify, which means it can take advantage of some nice features like:

  • versioning; if glsl-fxaa is patched, users of three-shader-fxaa will get the patch too
  • glslify transforms, like optimizing and minifying during your application bundle step
  • robust shader code that is easy to re-use and share across projects
  • and more...
var THREE = require('three')
var fxaa = require('three-shader-fxaa')()

var shader = new THREE.ShaderMaterial( fxaa ) 
shader.uniforms.tDiffuse.set = myTexture
shader.uniforms.resolution.set(width, height)

Or with effect composer:

var pass = new THREE.ShaderPass(fxaa) 
effectComposer.addPass( pass )
pass.uniforms.tDiffuse.set = myTexture
pass.uniforms.resolution.set(width, height)

Intended to be used with THREE on npm, tested with r68.

Usage

NPM

fxaa()

Calling the function returns a new object with the following properties. This can be piped into THREE.ShaderMaterial or THREE.EffectComposer.

{
    vertexShader: '...shader source...',
    fragmentShader: '...shader source...',
    uniforms: { 
        tDiffuse: { type: 't', value: new THREE.Texture() },
        resolution: { type: 'v2', value: new THREE.Vector2() }
    }
}

License

MIT, see LICENSE.md for details.