dorkhub

threejs-post-process-example

a tutorial on ThreeJS post processing

Experience-Monks
JavaScript264 forksMITupdated 10 years ago
git clone https://github.com/Experience-Monks/threejs-post-process-example.gitExperience-Monks/threejs-post-process-example

Post-Processing in ThreeJS

images

before and after post-processing – click here for a live demo


This is an example of post-processing effects in ThreeJS, including FXAA and Lookup Table color transforms.

This example also provides some insight into the development workflow at Jam3, and how we scale and re-use code across some of our WebGL experiences.

To build this demo, we used the following tools:

  • npm to install dependencies
  • budo for a fast development server
  • browserify to bundle dependencies
  • babelify for ES2015 transpiling
  • glslify to inline GLSL shaders into our JavaScript bundle

We bring together some of the following modules:

Running from Source

You can git clone this repo to run from source.

git clone https://github.com/Jam3/threejs-post-process-example.git
cd threejs-post-process-example

# install dependencies
npm install

Now you can run either demo:

# with post-processing
npm run start

# without post-processing
npm run no-post

Or build the static site:

npm run build

Effects

FXAA

For an optimized Fast Approximate Antialiasing (FXAA) shader, we use three-shader-fxaa.

Color Lookup Transforms

We use glsl-lut for the efficient color lookup transforms.

  • pass.vert – a simple "pass through" vertex shader
  • lut.frag – a fragment shader which transforms colors with glsl-lut

The images/ folder includes various lookup table examples, including the "identity" lookup table, which can be adjusted for your own effects.

Further Reading

more like this

lottery

🎉🌟✨🎈年会抽奖程序,基于 Express + Three.js的 3D 球体抽奖程序,奖品🧧🎁,文字,图片,抽奖规则均可配置,😜抽奖人员信息Excel一键导入😍,抽奖结果Excel导出😎,给你的抽奖活动带来全新酷炫体验🚀🚀🚀

JavaScript4.6k

ForwardWidgets

Widgets for Douban and Trakt watchlists plus personalized recommendations, live TV streaming including PlutoTV, Yatu ra…

JavaScript247

search

search projects, people, and tags