Skip to content

Threejs post-processing shader to apply an ordered dithering effect

License

Notifications You must be signed in to change notification settings

samwhitford/threejs-ordered-dithering-effect

Repository files navigation

threejs-ordered-dithering-effect

Threejs post-processing shader to apply an ordered dithering effect

Copy provided files into your threejs project.

Ensure you're using EffectComposer and RenderPass. Guide here

Import the effect like so:

import { OrderedDitherPass } from './OrderedDitherPass.js'

Initialise like so:

const orderedDitherEffect = new OrderedDitherPass(mapSize, scale);
composer.addPass( orderedDitherEffect );

mapSize refers to the Bayer matrix threshold map size.

This can be a value of 2, 4 or 8 at this time.

scale refers to the scale of the effect. This is locked to increments of 0.5 (i.e. 1, 1.5, 2, 2.5 and so on). other values can be entered but the value will be sanitised by the shader.

Default values will be applied if none are provided (mapSize: 4, scale: 1)

📝 License

This project is licensed under MIT license.

📢 Shout outs!

Hugh Kennedy for this repo - https://github.com/hughsk/glsl-dither

About

Threejs post-processing shader to apply an ordered dithering effect

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published