JSPM

  • Created
  • Published
  • Downloads 179
  • Score
    100M100P100Q74956F
  • License MIT

postprocessing wrapper for React and react-three-fiber

Package Exports

  • react-postprocessing

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 (react-postprocessing) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

react-postprocessing

npm npm

This is a postprocessing wrapper for react-three-fiber. This is not (yet) meant for complex orchestration of effects, but can save you hundreds of LOC for a straight forward effects-chain. The composer configures webGL2 MSAA (multisamping-anti-aleasing) by default so you get high performance crisp results w/o jagged edges.

# using npm
npm install postprocessing react-postprocessing

What does it look like?

Well, you can do pretty much anything, but here's an example combining a couple of effects (live demo).

Bubbles Demo
import React from 'react'
import { EffectComposer, DepthOfField, Bloom, Noise, Vignette } from 'react-postprocessing'
import { Canvas } from 'react-three-fiber'

function App() {
  return (
    <Canvas>
      {/* Your regular scene contents go here, like always ... */}
      <EffectComposer>
        <DepthOfField focusDistance={0} focalLength={0.02} bokehScale={2} height={480} />
        <Bloom luminanceThreshold={0} luminanceSmoothing={0.9} height={300} />
        <Noise opacity={0.02} />
        <Vignette eskil={false} offset={0.1} darkness={1.1} />
      </EffectComposer>
    </Canvas>
  )
}

Documentation

api.md