The frame buffer type decides whether postprocessing bands in dark scenes
A post processing library for three.js.
At a glance
- What is it?
- A Zlib licensed effect composer for three.js that merges effects into one pass and stores intermediates in unsigned byte sRGB buffers. Tone mapping has to move from the renderer to the end of the pipeline when postprocessing is used.
- Who is it for?
- Adopt it if you are already on three.js and want bloom, SSAO or depth of field as effects rather than render targets you wire by hand. Before committing, check two things in your own project: whether the target devices can afford HalfFloatType frame buffers, since the default unsigned byte buffers are the ones README.md says band in dark scenes, and where your depth input comes from with the renderer's depth flag off.
- Can I use it commercially?
- Yes. Zlib is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 14 days ago.
- What is it written in?
- Mainly JavaScript, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on November 15, 2026, and from our analysis. They are not legal advice.
Star history
- pmndrs/postprocessing2,977 ★ · +106
| Repository | 2026-09-30 | 2026-11-15 |
|---|---|---|
| pmndrs/postprocessing | 2.9k | 3k |
106 Stars in the last 46 days, measured from the daily GitHub snapshot. Compare with other projects
Editorial analysis
The renderer setup switches antialias, stencil and depth off before the composer appears
The usage section opens with a WebGLRenderer construction rather than with the composer, and the four attributes in it are the first decision a project has to make. `powerPreference` asks for the high performance adapter, and `antialias`, `stencil` and `depth` are all false:
import { WebGLRenderer } from "three";
const renderer = new WebGLRenderer({
powerPreference: "high-performance",
antialias: false,
stencil: false,
depth: false
});Turning the renderer's own antialiasing off sits consistently with the effect list in README.md, whose first entry is Antialiasing. The depth flag is harder to square. The same list carries SSAO, Depth of Field, and Depth Picking nested under Shock Wave, all of which read scene depth, yet the recommended configuration leaves the renderer without a depth buffer. Treat these four values as the configuration the composer expects rather than as a general recipe for three.js renderers, because they also decide what every other pass in your pipeline can read.
The supported color workflow and the quality recommendation are two different buffer types
Color management carries the most numbers in README.md, and the default is a compromise. New applications are told to follow a linear workflow, and postprocessing is said to support that automatically: set `WebGLRenderer.outputColorSpace` to `SRGBColorSpace` and the library follows suit. The automatic part stops at the color space. Intermediate results are held in `UnsignedByteType` sRGB frame buffers, which the text calls a trade-off between hardware support, efficiency and quality, since linear results normally require at least 12 bits per color channel to prevent color degradation and banding. With low precision sRGB buffers, colors clamp to `[0.0, 1.0]`, and the information that is lost shifts to the darker spectrum, which shows up as noticeable banding in dark scenes. Linear `HalfFloatType` buffers do not have those problems and are named the preferred option for HDR-like workflows on desktop devices:
import { HalfFloatType } from "three";
const composer = new EffectComposer(renderer, {
frameBufferType: HalfFloatType
});So the default you get for free and the setting the text recommends are separate arguments, and the quality path has to be requested when the composer is constructed.
Tone mapping has to leave the renderer and land at the end of the chain
With postprocessing in place, `toneMapping` should be `NoToneMapping`, which is the three.js default, and high precision frame buffers should be enabled. Otherwise colors get mapped to `[0.0, 1.0]` at the start of the pipeline and every later stage works on already compressed values. Tone mapping then comes back at the end of the pipeline as a `ToneMappingEffect`.
The second half of that section argues about the clear color. Tone mapping is not applied to the clear color when you use only the renderer, because clearing does not involve shaders. Postprocessing applies to the full input image, so tone mapping hits the clear color too, uniformly. The consequence the README spells out is that tone mapping a clear color background with and without postprocessing gives different results, and that the postprocessing approach is the correct one. If your application is mostly a background with an overlay on top, adopting the composer changes how that background looks, and the library counts the new result as the fix rather than the regression. That makes the two tone mapping paths a migration decision, not a detail.
The sample render loop queues the next frame before it draws the current one
The composer example is three statements and a loop. `EffectComposer` is constructed with the renderer, `RenderPass` goes in first so the buffers are cleared and the scene is rendered for later processing, and `EffectPass` carries the effects along with the camera:
import { BloomEffect, EffectComposer, EffectPass, RenderPass } from "postprocessing";
const composer = new EffectComposer(renderer);
composer.addPass(new RenderPass(scene, camera));
composer.addPass(new EffectPass(camera, new BloomEffect()));
requestAnimationFrame(function render() {
requestAnimationFrame(render);
composer.render();
});Two details in that loop are worth copying rather than adapting. `requestAnimationFrame(render)` sits at the top of the callback, so the next frame is already queued before the current one is drawn, and `composer.render()` runs last. The loop calls `requestAnimationFrame` directly instead of the renderer's own animation loop, so no three.js specific hook is exercised by the sample. Nothing in it sets a renderer size, a pixel ratio or a toggle for pausing, and the `scene` and `camera` bindings come from the surrounding application. Effects reach `EffectPass` as constructor arguments, which makes `new BloomEffect()` the smallest possible form of that call, with no options and no lookup table attached.
A single triangle fills the screen, and EffectPass merges what would be separate passes
Two implementation choices carry the performance story, and neither comes with a number attached. The first is the fullscreen triangle. Every fullscreen render operation uses a single triangle that fills the screen where a quad is the more usual choice; the argument is that this harmonizes with modern GPU rasterization patterns and eliminates unnecessary fragment calculations along the screen diagonal, which is called out as especially beneficial for GPGPU passes and effects that use complex fragment shaders. The word gpgpu also sits in the package keywords.
The second is `EffectPass`, which takes any combination of effects and organizes and merges them, so several effects share one render operation instead of being chained as separate passes, and each effect picks its own blend function. The README links a Performance Test page inside the demo, the total demo download size is about 60 MB, and the test wiring in `package.json` is ava with `failFast` over `./test/**/*`, which is unit test setup rather than a frame timing harness.
The npm tarball is one directory, and the type declarations are copied rather than emitted
The published package is narrower than the repository. The `files` array in `package.json` lists `./build` and nothing else, so `src/`, `manual/`, `demo/` and `types/` stay out of the tarball. `main` points at `./build/index.cjs`, `module` at `./build/index.js`, and the `exports` map gives each condition its own types entry, `./build/types/index.d.ts` for import and `./build/types/index.d.cts` for require. The declarations are not emitted by the build: `build:dts` copies `types/*` into `build/types`, then copies the same files a second time renamed to `index.d.cts`, which is why the repository keeps a `types/` directory. The `sideEffects` field is set to false, so consumers are expected to tree shake.
Version numbers line up for once. `package.json` reads 6.39.6, the same number as the newest release tag dated 2026-11-01, and the two tags before it are v6.39.5 on 2026-09-09 and v6.39.4 on 2026-07-27. The repository was last pushed to on 2026-11-01. The gap in guidance is custom effects: README.md sends you to the project wiki for creating custom effects or passes, and that wiki is not part of this tree.
The install line says npm while devEngines refuses pnpm below 11
Two version policies sit next to each other and they do not agree. The install line is npm:
npm install three postprocessing`three` is a peer dependency, so it has to be named in the same command or already installed alongside. But `devEngines` in `package.json` pins the package manager to pnpm `>=12 <13` with `onFail` set to `error`, and the runtime to node `>=24` with `onFail` set to `error`. Both are hard failures rather than warnings, and `pnpm-lock.yaml` plus `pnpm-workspace.yaml` at the root match that choice. A consumer who follows the README with npm is fine; anyone cloning the repository to build or contribute has to switch tools first.
The rest of `package.json` describes a site build as much as a library. `build:css` compiles Sass from `manual/assets/css/src/values` and `manual/assets/css/src` into `manual/assets/css/dist`, `build:js` runs `esbuild.js`, and `clean` deletes `build`, `temp`, `manual/resources`, `manual/assets/**/dist` and `public`. The `deploy` script chains `copy`, `postcss` and `hugo`, which is how the demo and the documentation the README links to are built out of this repository. License metadata says Zlib and a `LICENSE.md` sits at the root.
Editorial conclusion
Adopt it if you are already on three.js and want bloom, SSAO or depth of field as effects rather than render targets you wire by hand. Before committing, check two things in your own project: whether the target devices can afford HalfFloatType frame buffers, since the default unsigned byte buffers are the ones README.md says band in dark scenes, and where your depth input comes from with the renderer's depth flag off. The releases come at a steady clip, v6.39.4 on 2026-07-27, v6.39.5 on 2026-09-09 and v6.39.6 on 2026-11-01, with pushes continuing to 2026-11-01, but the guidance for writing a custom effect lives in the project wiki rather than in the tree.
Frequently asked questions
What does postprocessing need installed alongside three.js?
three is a peer dependency, and the install line in README.md is `npm install three postprocessing`. The library then expects a WebGLRenderer built with `powerPreference` set for high performance and with `antialias`, `stencil` and `depth` all false.
Which frame buffer type does postprocessing use by default?
Intermediate results go into `UnsignedByteType` sRGB buffers, described as a trade-off between hardware support, efficiency and quality. Passing `frameBufferType: HalfFloatType` to the EffectComposer constructor switches to linear high precision buffers, named the preferred option for HDR-like workflows on desktop devices.
What must the renderer toneMapping setting be when postprocessing handles tone mapping?
`NoToneMapping`, which is the three.js default, together with high precision frame buffers enabled. Otherwise colors are mapped to `[0.0, 1.0]` at the start of the pipeline, and the mapping itself has to be reintroduced at the end as a `ToneMappingEffect`.
What does the postprocessing npm package actually publish?
Only the build directory. The `files` array lists `./build`, `main` points at `./build/index.cjs`, `module` at `./build/index.js`, and `types` at `./build/types/index.d.cts`. The `types/` directory at the repository root is copied into `build/types` by the `build:dts` script rather than emitted by a compiler.
Which package manager does the postprocessing repository require for development?
pnpm 12. The `devEngines` block pins the package manager to `>=12 <13` and the runtime to node `>=24`, both with `onFail` set to `error`, and `pnpm-lock.yaml` with `pnpm-workspace.yaml` sit at the repository root. The README install line still uses npm.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/pmndrs-postprocessing)Star history chart for your README
[](https://hysenlabs.com/projects/pmndrs-postprocessing)Was this useful?