Giter Site home page Giter Site logo

pampanelson / threejs-post-process-example Goto Github PK

View Code? Open in Web Editor NEW

This project forked from experience-monks/threejs-post-process-example

0.0 2.0 0.0 918 KB

a tutorial on ThreeJS post processing

License: MIT License

JavaScript 87.33% HTML 6.35% GLSL 6.32%

threejs-post-process-example's Introduction

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

threejs-post-process-example's People

Contributors

mattdesl avatar

Watchers

James Cloos avatar WangJunKai avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.