File: module-Bayer.md | Updated: 11/15/2025
Bayer is an addon, and must be imported explicitly, see Installation#Addons.
import { bayer16 } from 'three/addons/tsl/math/Bayer.js';
This TSL function can be used to sample a Bayer16 texture which is a 16x16 texture with a Bayer Matrix pattern. It can be used for dithering effects but also as an alternative to blue-noise. When used with Ray Marching specifically in VolumeNodeMaterial#offsetNode, it reduces banding problem, thus being able to use fewer steps without affecting the visuals as much.
uv | The uv to sample the bayer16 texture.
---|---
Returns: The sampled bayer value.