npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

three-dither-shader

v1.0.12

Published

This package gives you dither shader material

Downloads

39

Readme

Three Dither Shader

Personally, I find the game Return of the Obra Dinn absolutely beautiful — whether it's the 1-bit color palette or, especially, the incredibly well-done dithering effect.

That's why, for my portfolio, I wanted to give a little tribute to this exceptional game by recreating a dithering effect as the main visual element.

This is the first shader I've ever written, and also the first package I've published on npm. So if you run into any bugs or issues, feel free to open an issue so I can fix it!


🛠️ Installation

To use Three Dither Shader in a Three.js project, install it with:

npm install three-dither-shader

or

yarn add three-dither-shader

⚙️ Usage

Create an instance of DitherMaterial

import { DitherMaterial } from "three-dither-shader"

const dither = new DitherMaterial()

Get the material

const material = dither.getMaterial(1, 1)

The parameters correspond to your mesh’s dimensions, which helps the shader handle UV deformation correctly.

Apply it to a mesh

const cube = new THREE.Mesh(
  new THREE.BoxGeometry(),
  material
)```

---

### 💡 Light management

⚠️ If your scene looks black or empty — don’t worry! This is normal. Lighting is handled inside the shader, not via Three.js lights.

To add a light source:

```js
import { LightManager } from "three-dither-shader"

LightManager.addLight([0, 1, 1], 1)

🧪 Adjusting global pixelRatio

If the render looks too small or low-res, you can tweak the global pixelRatio:

LightManager.setPixelRatio(150)

🎛️ Customizing uniforms

Each DitherMaterial exposes its own set of uniforms, so you can customize things manually if needed:

uniforms: {
    pixelRatio: { value: LightManager.getPixelRatio() },
    decayIntencity: { value: this.decay },
    meshDimention: { value: new THREE.Vector2(1, 1) }
},

Support

For support, email [email protected] or join our Slack channel.