Features
Sprites should be cheap enough to scatter without counting them. `Sprite2D` and `AnimatedSprite2D` join an instanced batch on scenegraph entry. The spritesheet loader speaks TexturePacker; the animation system drives per-instance playback.
An ECS packs sprite state into compact GPU buffers, so per-sprite effects share one material without fragmenting the batch. Tint, outline, dissolve, palette swap — written in TSL, branch-pruned at compile time.
Every primitive ships a typed JSX wrapper — ``, ``, ``, ``. Hooks compose with `useFrame` and `useThree`. Compatible with react-three-fiber v10's alpha WebGPU canvas, mounts inside `
The retro effect category — CRT scanlines, dithering, pixelation, palette quantization — runs as per-sprite TSL nodes. `TextureLoader` applies pixel-art presets: nearest-neighbor filtering, no mipmaps, no subpixel bleeding.
Pixelate, dither, CRT scanlines, dissolve, palette swap, chromatic aberration — a TSL effect library composed per-sprite via a typed schema. Override the color node to drop in your own.
`TileMap2D` batches like sprites, with chunks instead of per-tile draws — only visible chunks render. Loads from Tiled or LDtk JSON, with multiple layers, animated tiles, and collision data.
Quick start: 2D in three.js
```typescript
import { Sprite2D, SpriteGroup } from 'three-flatland'
// Create a sprite group and add to your scene
const spriteGroup = new SpriteGroup()
scene.add(spriteGroup)
// Create sprites with textures
const player = new Sprite2D({ texture: playerTexture })
const enemy = new Sprite2D({ texture: enemyTexture })
enemy.position.set(2, 0, 0)
// Add sprites to the group
spriteGroup.add(player, enemy)
```
```tsx
import { Canvas, extend } from '@react-three/fiber/webgpu'
import { Sprite2D, SpriteGroup } from 'three-flatland/react'
extend({ Sprite2D, SpriteGroup })
function Game() {
return (
)
}
```
Built for three.js
Composing existing 2D rendering libraries with three.js is hard. Pull one in and you're running a second full renderer that competes for the frame, with GPU resources shared by hand and the integration held together by hacks. Inside react-three-fiber the cost doubles: another reconciler, state marshaled across two React instances.
three-flatland is built directly on three.js. There's no parallel renderer to coordinate, no bridge between React instances to maintain. three.js is the renderer, react-three-fiber is the reconciler, and every 2D primitive — `Sprite2D`, `TileMap2D`, `SpriteGroup` — is a Three.js object that mounts into the scenegraph the same way a `Mesh` does.
Most sprite batchers fall apart the moment a single sprite needs special treatment. Changing a uniform tanks the batch; shifting a z-index forces a scenegraph reorder; attaching an effect reflows the scene around it.
three-flatland's batcher composes effects on a single shared material — adding a glow to one sprite doesn't fragment the batch or rebuild the shader. The cost stays proportional to what's actually used: the uber-shader prunes unused branches at compile time, and the ECS keeps batch archetypes optimal as effects appear and disappear. To customize beyond the defaults, swap the color node or write a new effect against the same schema.
Flatland doesn't define a secondary ecosystem inside three.js — three.js is the ecosystem. Each `@three-flatland/*` package follows a Unix-style one-job rule, is tree-shakable, and works in any three.js project, with or without Flatland.
`@three-flatland/skia` brings Skia to Three.js — with a native WebGPU backend (Graphite/Dawn) that CanvasKit doesn't ship, plus a Zig-built WASM bundle tuned for size and speed. A TSL port of the Slug glyph-rendering algorithm is in flight — fully shader-driven, accurate at any scale, with real dynamic kerning instead of bitmap atlas sampling. A KTX2 Basis transcoder and runtime encoder (WASM + SIMD) and a VS Code plugin for 2D web projects are in development.
If your only 2D need is in-canvas app UI (buttons, panels, settings menus, dialogs), uikit is purpose-built for that. Flatland isn't.
For sprites, tilemaps, particles, shaders, HUDs, data viz, hybrid 2.5D — that's three-flatland's territory. Every `@three-flatland/*` package stands on its own, so adopting Flatland is incremental, not all-or-nothing.
# three-flatland
## Modules
- [nodes/src](/three-flatland/api/nodes/src/index/)
- [presets/src](/three-flatland/api/presets/src/index/)
- [three-flatland/src](/three-flatland/api/three-flatland/src/index/)
- [three-flatland/src/react](/three-flatland/api/three-flatland/src/react/index/)
# nodes/src
## Interfaces
- [CRTOptions](/three-flatland/api/nodes/src/interfaces/crtoptions/)
- [DissolveOptions](/three-flatland/api/nodes/src/interfaces/dissolveoptions/)
- [Light2DResult](/three-flatland/api/nodes/src/interfaces/light2dresult/)
- [LitSpriteOptions](/three-flatland/api/nodes/src/interfaces/litspriteoptions/)
- [OutlineOptions](/three-flatland/api/nodes/src/interfaces/outlineoptions/)
## Type Aliases
- [ColorInput](/three-flatland/api/nodes/src/type-aliases/colorinput/)
- [FloatInput](/three-flatland/api/nodes/src/type-aliases/floatinput/)
- [Vec2Input](/three-flatland/api/nodes/src/type-aliases/vec2input/)
- [Vec3Input](/three-flatland/api/nodes/src/type-aliases/vec3input/)
- [Vec4Input](/three-flatland/api/nodes/src/type-aliases/vec4input/)
## Functions
- [afterimage](/three-flatland/api/nodes/src/functions/afterimage/)
- [afterimageGlow](/three-flatland/api/nodes/src/functions/afterimageglow/)
- [afterimageTinted](/three-flatland/api/nodes/src/functions/afterimagetinted/)
- [alphaMask](/three-flatland/api/nodes/src/functions/alphamask/)
- [alphaMaskInvert](/three-flatland/api/nodes/src/functions/alphamaskinvert/)
- [alphaMaskValue](/three-flatland/api/nodes/src/functions/alphamaskvalue/)
- [alphaTest](/three-flatland/api/nodes/src/functions/alphatest/)
- [alphaTestOpaque](/three-flatland/api/nodes/src/functions/alphatestopaque/)
- [ambientLight2D](/three-flatland/api/nodes/src/functions/ambientlight2d/)
- [analogGlitch](/three-flatland/api/nodes/src/functions/analogglitch/)
- [bayerDither](/three-flatland/api/nodes/src/functions/bayerdither/)
- [bayerDither2x2](/three-flatland/api/nodes/src/functions/bayerdither2x2/)
- [bayerDither4x4](/three-flatland/api/nodes/src/functions/bayerdither4x4/)
- [bayerDither8x8](/three-flatland/api/nodes/src/functions/bayerdither8x8/)
- [bloom](/three-flatland/api/nodes/src/functions/bloom/)
- [bloomAnamorphic](/three-flatland/api/nodes/src/functions/bloomanamorphic/)
- [bloomSimple](/three-flatland/api/nodes/src/functions/bloomsimple/)
- [bloomThreshold](/three-flatland/api/nodes/src/functions/bloomthreshold/)
- [blurBox](/three-flatland/api/nodes/src/functions/blurbox/)
- [blurBox3x3](/three-flatland/api/nodes/src/functions/blurbox3x3/)
- [blurBoxDirectional](/three-flatland/api/nodes/src/functions/blurboxdirectional/)
- [blurBoxSmooth](/three-flatland/api/nodes/src/functions/blurboxsmooth/)
- [blurFocus](/three-flatland/api/nodes/src/functions/blurfocus/)
- [blurGaussian](/three-flatland/api/nodes/src/functions/blurgaussian/)
- [blurGaussian2Pass](/three-flatland/api/nodes/src/functions/blurgaussian2pass/)
- [blurGaussian9](/three-flatland/api/nodes/src/functions/blurgaussian9/)
- [blurKawase](/three-flatland/api/nodes/src/functions/blurkawase/)
- [blurKawaseDown](/three-flatland/api/nodes/src/functions/blurkawasedown/)
- [blurKawaseMulti](/three-flatland/api/nodes/src/functions/blurkawasemulti/)
- [blurKawaseSimple](/three-flatland/api/nodes/src/functions/blurkawasesimple/)
- [blurKawaseUp](/three-flatland/api/nodes/src/functions/blurkawaseup/)
- [blurMotion](/three-flatland/api/nodes/src/functions/blurmotion/)
- [blurMotionObject](/three-flatland/api/nodes/src/functions/blurmotionobject/)
- [blurMotionVelocity](/three-flatland/api/nodes/src/functions/blurmotionvelocity/)
- [blurRadial](/three-flatland/api/nodes/src/functions/blurradial/)
- [blurRadialDistance](/three-flatland/api/nodes/src/functions/blurradialdistance/)
- [blurShake](/three-flatland/api/nodes/src/functions/blurshake/)
- [blurSpin](/three-flatland/api/nodes/src/functions/blurspin/)
- [brightness](/three-flatland/api/nodes/src/functions/brightness/)
- [brightnessClamped](/three-flatland/api/nodes/src/functions/brightnessclamped/)
- [brightnessMultiply](/three-flatland/api/nodes/src/functions/brightnessmultiply/)
- [c64Palette](/three-flatland/api/nodes/src/functions/c64palette/)
- [cgaPalette](/three-flatland/api/nodes/src/functions/cgapalette/)
- [chromaticAberration](/three-flatland/api/nodes/src/functions/chromaticaberration/)
- [chromaticAberrationCustom](/three-flatland/api/nodes/src/functions/chromaticaberrationcustom/)
- [chromaticAberrationPulse](/three-flatland/api/nodes/src/functions/chromaticaberrationpulse/)
- [chromaticAberrationRadial](/three-flatland/api/nodes/src/functions/chromaticaberrationradial/)
- [colorBleeding](/three-flatland/api/nodes/src/functions/colorbleeding/)
- [colorRemap](/three-flatland/api/nodes/src/functions/colorremap/)
- [colorRemapCustom](/three-flatland/api/nodes/src/functions/colorremapcustom/)
- [colorReplace](/three-flatland/api/nodes/src/functions/colorreplace/)
- [colorReplaceHard](/three-flatland/api/nodes/src/functions/colorreplacehard/)
- [colorReplaceMultiple](/three-flatland/api/nodes/src/functions/colorreplacemultiple/)
- [contrast](/three-flatland/api/nodes/src/functions/contrast/)
- [contrastSCurve](/three-flatland/api/nodes/src/functions/contrastscurve/)
- [crtBloom](/three-flatland/api/nodes/src/functions/crtbloom/)
- [crtColorBleed](/three-flatland/api/nodes/src/functions/crtcolorbleed/)
- [crtComplete](/three-flatland/api/nodes/src/functions/crtcomplete/)
- [crtConvergence](/three-flatland/api/nodes/src/functions/crtconvergence/)
- [crtCurvature](/three-flatland/api/nodes/src/functions/crtcurvature/)
- [crtCurvatureWithCorners](/three-flatland/api/nodes/src/functions/crtcurvaturewithcorners/)
- [crtVignette](/three-flatland/api/nodes/src/functions/crtvignette/)
- [directionalLight2D](/three-flatland/api/nodes/src/functions/directionallight2d/)
- [dissolve](/three-flatland/api/nodes/src/functions/dissolve/)
- [dissolveDirectional](/three-flatland/api/nodes/src/functions/dissolvedirectional/)
- [dissolvePixelated](/three-flatland/api/nodes/src/functions/dissolvepixelated/)
- [dissolveSimple](/three-flatland/api/nodes/src/functions/dissolvesimple/)
- [distortBarrel](/three-flatland/api/nodes/src/functions/distortbarrel/)
- [distortBulge](/three-flatland/api/nodes/src/functions/distortbulge/)
- [distortDisplace](/three-flatland/api/nodes/src/functions/distortdisplace/)
- [distortNoise](/three-flatland/api/nodes/src/functions/distortnoise/)
- [distortPerlin](/three-flatland/api/nodes/src/functions/distortperlin/)
- [distortPinch](/three-flatland/api/nodes/src/functions/distortpinch/)
- [distortPixelate](/three-flatland/api/nodes/src/functions/distortpixelate/)
- [distortPixelateCount](/three-flatland/api/nodes/src/functions/distortpixelatecount/)
- [distortShatter](/three-flatland/api/nodes/src/functions/distortshatter/)
- [distortSimplex](/three-flatland/api/nodes/src/functions/distortsimplex/)
- [distortSpherize](/three-flatland/api/nodes/src/functions/distortspherize/)
- [distortTurbulence](/three-flatland/api/nodes/src/functions/distortturbulence/)
- [distortTwirl](/three-flatland/api/nodes/src/functions/distorttwirl/)
- [dmgPalette](/three-flatland/api/nodes/src/functions/dmgpalette/)
- [dotMatrix](/three-flatland/api/nodes/src/functions/dotmatrix/)
- [eagle](/three-flatland/api/nodes/src/functions/eagle/)
- [fadeEdge](/three-flatland/api/nodes/src/functions/fadeedge/)
- [fadeEdgeHorizontal](/three-flatland/api/nodes/src/functions/fadeedgehorizontal/)
- [fadeEdgeRadial](/three-flatland/api/nodes/src/functions/fadeedgeradial/)
- [fadeEdgeVertical](/three-flatland/api/nodes/src/functions/fadeedgevertical/)
- [filmGrain](/three-flatland/api/nodes/src/functions/filmgrain/)
- [flash](/three-flatland/api/nodes/src/functions/flash/)
- [flashAdditive](/three-flatland/api/nodes/src/functions/flashadditive/)
- [flashAlpha](/three-flatland/api/nodes/src/functions/flashalpha/)
- [flashDamage](/three-flatland/api/nodes/src/functions/flashdamage/)
- [flashHeal](/three-flatland/api/nodes/src/functions/flashheal/)
- [flashPowerUp](/three-flatland/api/nodes/src/functions/flashpowerup/)
- [flashSmooth](/three-flatland/api/nodes/src/functions/flashsmooth/)
- [gbcPalette](/three-flatland/api/nodes/src/functions/gbcpalette/)
- [ghost](/three-flatland/api/nodes/src/functions/ghost/)
- [ghostSpeed](/three-flatland/api/nodes/src/functions/ghostspeed/)
- [ghostTrail](/three-flatland/api/nodes/src/functions/ghosttrail/)
- [glowSelective](/three-flatland/api/nodes/src/functions/glowselective/)
- [grayscale](/three-flatland/api/nodes/src/functions/grayscale/)
- [hq2x](/three-flatland/api/nodes/src/functions/hq2x/)
- [hq3x](/three-flatland/api/nodes/src/functions/hq3x/)
- [hq4x](/three-flatland/api/nodes/src/functions/hq4x/)
- [hueShift](/three-flatland/api/nodes/src/functions/hueshift/)
- [hueShiftNormalized](/three-flatland/api/nodes/src/functions/hueshiftnormalized/)
- [interlacing](/three-flatland/api/nodes/src/functions/interlacing/)
- [lcdBacklightBleed](/three-flatland/api/nodes/src/functions/lcdbacklightbleed/)
- [lcdGBC](/three-flatland/api/nodes/src/functions/lcdgbc/)
- [lcdGhosting](/three-flatland/api/nodes/src/functions/lcdghosting/)
- [lcdGrid](/three-flatland/api/nodes/src/functions/lcdgrid/)
- [lcdMotionGhost](/three-flatland/api/nodes/src/functions/lcdmotionghost/)
- [lcdPocket](/three-flatland/api/nodes/src/functions/lcdpocket/)
- [litCelShaded](/three-flatland/api/nodes/src/functions/litcelshaded/)
- [litDiffuse](/three-flatland/api/nodes/src/functions/litdiffuse/)
- [litRim](/three-flatland/api/nodes/src/functions/litrim/)
- [litSpecular](/three-flatland/api/nodes/src/functions/litspecular/)
- [litSprite](/three-flatland/api/nodes/src/functions/litsprite/)
- [litSpriteMulti](/three-flatland/api/nodes/src/functions/litspritemulti/)
- [md9bitPalette](/three-flatland/api/nodes/src/functions/md9bitpalette/)
- [normalFromHeight](/three-flatland/api/nodes/src/functions/normalfromheight/)
- [normalFromHeightSmooth](/three-flatland/api/nodes/src/functions/normalfromheightsmooth/)
- [ntscComposite](/three-flatland/api/nodes/src/functions/ntsccomposite/)
- [outline](/three-flatland/api/nodes/src/functions/outline/)
- [outline8](/three-flatland/api/nodes/src/functions/outline8/)
- [palettize](/three-flatland/api/nodes/src/functions/palettize/)
- [palettizeDithered](/three-flatland/api/nodes/src/functions/palettizedithered/)
- [palettizeNearest](/three-flatland/api/nodes/src/functions/palettizenearest/)
- [phosphorApertureGrille](/three-flatland/api/nodes/src/functions/phosphoraperturegrille/)
- [phosphorMask](/three-flatland/api/nodes/src/functions/phosphormask/)
- [phosphorShadowMask](/three-flatland/api/nodes/src/functions/phosphorshadowmask/)
- [phosphorSimple](/three-flatland/api/nodes/src/functions/phosphorsimple/)
- [phosphorSlotMask](/three-flatland/api/nodes/src/functions/phosphorslotmask/)
- [pixelate](/three-flatland/api/nodes/src/functions/pixelate/)
- [pixelateBySize](/three-flatland/api/nodes/src/functions/pixelatebysize/)
- [pocketPalette](/three-flatland/api/nodes/src/functions/pocketpalette/)
- [pointLight2D](/three-flatland/api/nodes/src/functions/pointlight2d/)
- [posterize](/three-flatland/api/nodes/src/functions/posterize/)
- [posterizeGamma](/three-flatland/api/nodes/src/functions/posterizegamma/)
- [ppuPalette](/three-flatland/api/nodes/src/functions/ppupalette/)
- [pulse](/three-flatland/api/nodes/src/functions/pulse/)
- [pulseGlow](/three-flatland/api/nodes/src/functions/pulseglow/)
- [pulseHeartbeat](/three-flatland/api/nodes/src/functions/pulseheartbeat/)
- [pulseRadial](/three-flatland/api/nodes/src/functions/pulseradial/)
- [pulseRainbow](/three-flatland/api/nodes/src/functions/pulserainbow/)
- [quantize](/three-flatland/api/nodes/src/functions/quantize/)
- [quantizeRGB](/three-flatland/api/nodes/src/functions/quantizergb/)
- [sai2x](/three-flatland/api/nodes/src/functions/sai2x/)
- [sampleSprite](/three-flatland/api/nodes/src/functions/samplesprite/)
- [saturate](/three-flatland/api/nodes/src/functions/saturate/)
- [scale2x](/three-flatland/api/nodes/src/functions/scale2x/)
- [scale3x](/three-flatland/api/nodes/src/functions/scale3x/)
- [scanlines](/three-flatland/api/nodes/src/functions/scanlines/)
- [scanlinesGlow](/three-flatland/api/nodes/src/functions/scanlinesglow/)
- [scanlinesGrid](/three-flatland/api/nodes/src/functions/scanlinesgrid/)
- [scanlinesInterlaced](/three-flatland/api/nodes/src/functions/scanlinesinterlaced/)
- [scanlinesSmooth](/three-flatland/api/nodes/src/functions/scanlinessmooth/)
- [shadow2D](/three-flatland/api/nodes/src/functions/shadow2d/)
- [shadowDrop](/three-flatland/api/nodes/src/functions/shadowdrop/)
- [shadowDropSoft](/three-flatland/api/nodes/src/functions/shadowdropsoft/)
- [shadowSDF2D](/three-flatland/api/nodes/src/functions/shadowsdf2d/)
- [shadowSoft2D](/three-flatland/api/nodes/src/functions/shadowsoft2d/)
- [shimmer](/three-flatland/api/nodes/src/functions/shimmer/)
- [shimmerHolographic](/three-flatland/api/nodes/src/functions/shimmerholographic/)
- [shimmerMetallic](/three-flatland/api/nodes/src/functions/shimmermetallic/)
- [shimmerWave](/three-flatland/api/nodes/src/functions/shimmerwave/)
- [signalInterference](/three-flatland/api/nodes/src/functions/signalinterference/)
- [snesPalette](/three-flatland/api/nodes/src/functions/snespalette/)
- [sparkle](/three-flatland/api/nodes/src/functions/sparkle/)
- [sparkleRainbow](/three-flatland/api/nodes/src/functions/sparklerainbow/)
- [sparkleStar](/three-flatland/api/nodes/src/functions/sparklestar/)
- [speedLines](/three-flatland/api/nodes/src/functions/speedlines/)
- [spotLight2D](/three-flatland/api/nodes/src/functions/spotlight2d/)
- [spriteUV](/three-flatland/api/nodes/src/functions/spriteuv/)
- [staticNoise](/three-flatland/api/nodes/src/functions/staticnoise/)
- [superEagle](/three-flatland/api/nodes/src/functions/supereagle/)
- [tint](/three-flatland/api/nodes/src/functions/tint/)
- [tintAdditive](/three-flatland/api/nodes/src/functions/tintadditive/)
- [trail](/three-flatland/api/nodes/src/functions/trail/)
- [trailAdditive](/three-flatland/api/nodes/src/functions/trailadditive/)
- [trailBlur](/three-flatland/api/nodes/src/functions/trailblur/)
- [trailVelocity](/three-flatland/api/nodes/src/functions/trailvelocity/)
- [uvFlip](/three-flatland/api/nodes/src/functions/uvflip/)
- [uvOffset](/three-flatland/api/nodes/src/functions/uvoffset/)
- [uvRotate](/three-flatland/api/nodes/src/functions/uvrotate/)
- [uvScale](/three-flatland/api/nodes/src/functions/uvscale/)
- [vbPalette](/three-flatland/api/nodes/src/functions/vbpalette/)
- [vhsDistortion](/three-flatland/api/nodes/src/functions/vhsdistortion/)
- [vignette](/three-flatland/api/nodes/src/functions/vignette/)
- [waveHorizontal](/three-flatland/api/nodes/src/functions/wavehorizontal/)
- [waveRadial](/three-flatland/api/nodes/src/functions/waveradial/)
- [waveRipple](/three-flatland/api/nodes/src/functions/waveripple/)
- [waveVertical](/three-flatland/api/nodes/src/functions/wavevertical/)
- [waveWater](/three-flatland/api/nodes/src/functions/wavewater/)
# afterimage
> **afterimage**(`currentColor`, `previousTex`, `uv`, `persistence?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L20)
Create afterimage/ghost effect by blending with a previous frame.
Requires a texture containing the previous frame.
## Parameters
### currentColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Current frame color
### previousTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Previous frame texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
How much previous frame persists (0-1, default: 0.8)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blended color with afterimage
## Example
```ts
// Render to texture, then use previous frame
const ghosted = afterimage(currentColor, previousFrameTexture, uv, 0.85)
```
# afterimageGlow
> **afterimageGlow**(`currentColor`, `previousTex`, `uv`, `persistence?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:76](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L76)
Additive afterimage for glowing ghost effects.
## Parameters
### currentColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Current frame color
### previousTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Previous frame texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.7`
Persistence amount
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Glow intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with additive afterimage
# afterimageTinted
> **afterimageTinted**(`currentColor`, `previousTex`, `uv`, `persistence?`, `ghostTint?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:46](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L46)
Afterimage with color tinting for ghost trails.
## Parameters
### currentColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Current frame color
### previousTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Previous frame texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
Persistence amount
### ghostTint?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color tint for the ghost (default: slight blue)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with tinted afterimage
# alphaMask
> **alphaMask**(`inputColor`, `maskTex`, `maskUV`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/alphaMask.ts:24](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/alphaMask.ts#L24)
Multiply alpha by a mask texture's value.
The mask texture's red channel (or luminance) is used as the mask value.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### maskTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Mask texture (uses red channel)
### maskUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates for mask sampling
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Mask strength (0 = no mask, 1 = full mask)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with masked alpha
## Examples
```ts
// Apply mask texture
alphaMask(texture(tex, uv()), maskTexture, uv())
```
```ts
// Partial mask effect
alphaMask(texture(tex, uv()), maskTexture, uv(), 0.5)
```
# alphaMaskInvert
> **alphaMaskInvert**(`inputColor`, `maskTex`, `maskUV`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/alphaMask.ts:68](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/alphaMask.ts#L68)
Invert mask and apply to alpha (areas with high mask value become transparent).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### maskTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Mask texture (uses red channel, inverted)
### maskUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates for mask sampling
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Mask strength
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with inverted mask applied to alpha
# alphaMaskValue
> **alphaMaskValue**(`inputColor`, `mask`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/alphaMask.ts:53](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/alphaMask.ts#L53)
Multiply alpha by a mask value (single float instead of texture).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### mask
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Mask value (0-1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with masked alpha
## Example
```ts
// Fade sprite by 50%
alphaMaskValue(texture(tex, uv()), 0.5)
```
# alphaTest
> **alphaTest**(`inputColor`, `threshold`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/alphaTest.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/alphaTest.ts#L21)
Discard pixels with alpha below a threshold.
Useful for hard-edged transparency (pixel art, text).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### threshold
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Alpha threshold (pixels below this are discarded)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color unchanged, or discarded if below threshold
## Examples
```ts
// Discard nearly transparent pixels
alphaTest(texture(tex, uv()), 0.5)
```
```ts
// Animated alpha cutoff
alphaTest(texture(tex, uv()), thresholdUniform)
```
# alphaTestOpaque
> **alphaTestOpaque**(`inputColor`, `threshold`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/alphaTest.ts:39](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/alphaTest.ts#L39)
Discard pixels with alpha below threshold and set remaining alpha to 1.
Creates a hard mask effect.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### threshold
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Alpha threshold
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Opaque color if above threshold, discarded otherwise
# ambientLight2D
> **ambientLight2D**(`lightColor?`, `intensity?`): [`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Defined in: [packages/nodes/src/lighting/lights.ts:169](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L169)
Ambient light provides uniform illumination from all directions.
## Parameters
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Light intensity
## Returns
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Light2DResult with upward direction (for ambient occlusion compatibility)
## Example
```ts
const ambient = ambientLight2D([0.2, 0.2, 0.3], 1.0)
```
# analogGlitch
> **analogGlitch**(`tex`, `uv`, `time`, `intensity?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:190](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L190)
Analog glitch effect with continuous distortion.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.03`
Glitch intensity (default: 0.03)
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with analog glitch
# bayerDither
> **bayerDither**(`inputColor`, `levels?`, `scale?`, `screenCoord?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/bayerDither.ts:298](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/bayerDither.ts#L298)
Apply Bayer matrix ordered dithering (defaults to 4x4).
Alias for bayerDither4x4 as it's the most commonly used pattern.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### levels?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Number of color levels per channel (default: 2 = binary)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Scale of dither pattern (default: 1)
### screenCoord?
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates (use UV * textureSize for per-sprite)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Dithered color
## Examples
```ts
// Binary dithering (2-color)
bayerDither(texture(tex, uv()), 2, 1, screenUV.mul(resolution))
```
```ts
// 4-level dithering for retro look
bayerDither(color, 4)
```
# bayerDither2x2
> **bayerDither2x2**(`inputColor`, `levels?`, `scale?`, `screenCoord?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/bayerDither.ts:173](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/bayerDither.ts#L173)
Apply 2x2 Bayer matrix ordered dithering.
Creates a coarse dither pattern - good for very low resolution retro effects.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### levels?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Number of color levels per channel (default: 2 = binary)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Scale of dither pattern (default: 1)
### screenCoord?
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates (use UV * textureSize for per-sprite)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Dithered color
## Example
```ts
// Binary dithering on sprite
bayerDither2x2(color, 2, 1, uv().mul(textureSize))
```
# bayerDither4x4
> **bayerDither4x4**(`inputColor`, `levels?`, `scale?`, `screenCoord?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/bayerDither.ts:214](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/bayerDither.ts#L214)
Apply 4x4 Bayer matrix ordered dithering.
Standard dither pattern - good balance of quality and retro aesthetic.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### levels?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Number of color levels per channel (default: 2 = binary)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Scale of dither pattern (default: 1)
### screenCoord?
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates (use UV * textureSize for per-sprite)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Dithered color
## Example
```ts
// 4-level dithering for retro look
bayerDither4x4(color, 4, 1, uv().mul(textureSize))
```
# bayerDither8x8
> **bayerDither8x8**(`inputColor`, `levels?`, `scale?`, `screenCoord?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/bayerDither.ts:254](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/bayerDither.ts#L254)
Apply 8x8 Bayer matrix ordered dithering.
Fine dither pattern - smoother gradients while maintaining retro feel.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### levels?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Number of color levels per channel (default: 2 = binary)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Scale of dither pattern (default: 1)
### screenCoord?
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates (use UV * textureSize for per-sprite)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Dithered color
## Example
```ts
// 8-level dithering for smoother retro effect
bayerDither8x8(color, 8, 1, uv().mul(textureSize))
```
# bloom
> **bloom**(`inputColor`, `bloomTex`, `uv`, `intensity?`, `tint?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:63](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L63)
Apply bloom effect using pre-blurred bright texture.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Original scene color
### bloomTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Pre-extracted and blurred bloom texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Bloom intensity (default: 1)
### tint?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Bloom color tint (default: white)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with bloom applied
## Example
```ts
const final = bloom(sceneColor, bloomBlurredTexture, uv, 1.2, [1, 0.95, 0.9])
```
# bloomAnamorphic
> **bloomAnamorphic**(`inputColor`, `bloomTex`, `uv`, `intensity?`, `tint?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:123](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L123)
Anamorphic bloom - horizontal streak effect.
Common in film and sci-fi aesthetics.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### bloomTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Horizontally blurred bloom texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Streak intensity
### tint?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Streak color tint (often slightly colored)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with anamorphic bloom
# bloomSimple
> **bloomSimple**(`tex`, `uv`, `threshold?`, `radius?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:150](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L150)
Simple single-pass bloom approximation.
Samples in a star pattern for quick glow effect.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.7`
Brightness threshold
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Glow radius
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Glow intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with bloom approximation
# bloomThreshold
> **bloomThreshold**(`inputColor`, `threshold?`, `softThreshold?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:25](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L25)
Extract bright areas for bloom effect.
Returns only pixels above a brightness threshold.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (vec4)
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
Brightness threshold (0-1, default: 0.8)
### softThreshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Soft threshold knee (0-1, default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Extracted bright areas
## Example
```ts
const brights = bloomThreshold(inputColor, 0.8)
const blurred = blurKawase(brights, uv, ...)
const final = inputColor.add(blurred)
```
# blurBox
> **blurBox**(`tex`, `uv`, `radius?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurBox.ts:19](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurBox.ts#L19)
Simple box blur with uniform weights.
Faster than Gaussian but produces more blocky results.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius in UV space
### samples?
`number` = `3`
Number of samples per axis (default: 3)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
## Example
```ts
const blurred = blurBox(texture, uv, 0.01, 5)
```
# blurBox3x3
> **blurBox3x3**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurBox.ts:80](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurBox.ts#L80)
Fast 3x3 box blur.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurBoxDirectional
> **blurBoxDirectional**(`tex`, `uv`, `direction?`, `radius?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurBox.ts:51](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurBox.ts#L51)
Directional box blur.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Blur direction
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius
### samples?
`number` = `5`
Number of samples
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurBoxSmooth
> **blurBoxSmooth**(`tex`, `uv`, `radius?`, `softness?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurBox.ts:114](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurBox.ts#L114)
Variable-size box blur with smooth edges.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius
### softness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Edge softness (0 = sharp box, 1 = smooth falloff)
### samples?
`number` = `5`
Number of samples per axis
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurFocus
> **blurFocus**(`tex`, `uv`, `center?`, `focusRadius?`, `blurAmount?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurRadial.ts:141](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurRadial.ts#L141)
Focus blur - sharp in center, blurred at edges.
Simulates depth of field or tilt-shift effect.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Focus center point
### focusRadius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Radius of sharp focus area
### blurAmount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Maximum blur at edges
### samples?
`number` = `5`
Blur quality
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Focus-blurred color
# blurGaussian
> **blurGaussian**(`tex`, `uv`, `direction?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurGaussian.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurGaussian.ts#L21)
Gaussian blur using a 5-tap kernel.
Provides smooth, natural-looking blur with minimal samples.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Blur direction (use [1,0] for horizontal, [0,1] for vertical)
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius in UV space (default: 0.01)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
## Example
```ts
// Two-pass Gaussian blur (horizontal then vertical)
const blurH = blurGaussian(texture, uv, [1, 0], 0.01)
const blurV = blurGaussian(blurH, uv, [0, 1], 0.01)
```
# blurGaussian2Pass
> **blurGaussian2Pass**(`tex`, `uv`, `radius?`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurGaussian.ts:96](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurGaussian.ts#L96)
Simple two-pass Gaussian blur helper.
Applies horizontal then vertical blur.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel (for proper scaling)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurGaussian9
> **blurGaussian9**(`tex`, `uv`, `direction?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurGaussian.ts:59](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurGaussian.ts#L59)
Higher quality 9-tap Gaussian blur.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Blur direction
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur radius
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurKawase
> **blurKawase**(`tex`, `uv`, `offset?`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurKawase.ts:23](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurKawase.ts#L23)
Kawase blur - fast, iterative blur technique.
Used in many games for efficient bloom/blur effects.
Each iteration doubles the effective blur radius.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### offset?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Current iteration offset (increases each pass)
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel in UV space
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color for this iteration
## Example
```ts
// Multi-pass Kawase blur
let blurred = blurKawase(texture, uv, 0, [1/width, 1/height])
blurred = blurKawase(blurred, uv, 1, [1/width, 1/height])
blurred = blurKawase(blurred, uv, 2, [1/width, 1/height])
```
# blurKawaseDown
> **blurKawaseDown**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurKawase.ts:87](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurKawase.ts#L87)
Dual Kawase blur downscale pass.
Used in dual-filter blur approach for efficient large blurs.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Texel size at current resolution
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Downscaled blurred color
# blurKawaseMulti
> **blurKawaseMulti**(`tex`, `uv`, `iterations?`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurKawase.ts:150](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurKawase.ts#L150)
Multi-iteration Kawase blur in a single pass (approximation).
Useful when multiple render passes aren't available.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### iterations?
`number` = `3`
Number of blur iterations to simulate
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Texel size
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurKawaseSimple
> **blurKawaseSimple**(`tex`, `uv`, `radius?`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurKawase.ts:55](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurKawase.ts#L55)
Single-pass approximation of multi-iteration Kawase blur.
Samples at multiple offsets in one pass.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Blur radius
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Texel size
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Blurred color
# blurKawaseUp
> **blurKawaseUp**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurKawase.ts:116](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurKawase.ts#L116)
Dual Kawase blur upscale pass.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Texel size at current resolution
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled blurred color
# blurMotion
> **blurMotion**(`tex`, `uv`, `direction`, `strength?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurMotion.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurMotion.ts#L21)
Directional motion blur.
Simulates motion in a specific direction.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Motion direction (vec2)
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Blur strength/length (default: 0.05)
### samples?
`number` = `8`
Number of blur samples (default: 8)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Motion-blurred color
## Example
```ts
// Horizontal motion blur
const blurred = blurMotion(texture, uv, [1, 0], 0.05)
```
# blurMotionObject
> **blurMotionObject**(`tex`, `uv`, `velocity`, `maxBlur?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurMotion.ts:90](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurMotion.ts#L90)
Object motion blur with depth consideration.
Samples more in the direction of motion.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### velocity
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Velocity at this pixel
### maxBlur?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Maximum blur length
### samples?
`number` = `8`
Number of samples
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Motion-blurred color
# blurMotionVelocity
> **blurMotionVelocity**(`tex`, `uv`, `velocity`, `scale?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurMotion.ts:57](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurMotion.ts#L57)
Velocity-based motion blur.
Blur strength and direction based on velocity vector.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### velocity
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Velocity vector (direction and magnitude)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Velocity to blur scale (default: 1)
### samples?
`number` = `8`
Number of samples
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Velocity-blurred color
## Example
```ts
const blurred = blurMotionVelocity(texture, uv, velocityTexture.rg)
```
# blurRadial
> **blurRadial**(`tex`, `uv`, `center?`, `strength?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurRadial.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurRadial.ts#L20)
Radial blur (zoom blur) emanating from a center point.
Creates a motion blur effect as if zooming in/out.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point of the blur (default: [0.5, 0.5])
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Blur strength (default: 0.1)
### samples?
`number` = `8`
Number of blur samples (default: 8)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Radially blurred color
## Example
```ts
const zoomed = blurRadial(texture, uv, [0.5, 0.5], 0.1)
```
# blurRadialDistance
> **blurRadialDistance**(`tex`, `uv`, `center?`, `strength?`, `samples?`, `falloff?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurRadial.ts:57](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurRadial.ts#L57)
Radial blur with distance-based intensity.
Blur strength increases with distance from center.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Base blur strength
### samples?
`number` = `8`
Number of samples
### falloff?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
How much blur increases with distance
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Radially blurred color
# blurShake
> **blurShake**(`tex`, `uv`, `intensity?`, `samples?`, `seed?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurMotion.ts:132](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurMotion.ts#L132)
Camera shake blur effect.
Simulates the blur from camera vibration.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Shake intensity
### samples?
`number` = `5`
Number of samples
### seed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Random seed for shake pattern
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Shake-blurred color
# blurSpin
> **blurSpin**(`tex`, `uv`, `center?`, `angle?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurRadial.ts:97](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurRadial.ts#L97)
Spin blur - circular motion blur around a center point.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center of rotation
### angle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Total rotation angle in radians
### samples?
`number` = `8`
Number of samples
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Spin-blurred color
# brightness
> **brightness**(`inputColor`, `amount`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/brightness.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/brightness.ts#L20)
Adjust brightness by adding a value to all color channels.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Brightness adjustment (-1 to 1, 0 = no change)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with adjusted brightness
## Examples
```ts
// Brighten by 20%
brightness(texture(tex, uv()), 0.2)
```
```ts
// Darken
brightness(texture(tex, uv()), -0.3)
```
# brightnessClamped
> **brightnessClamped**(`inputColor`, `amount`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/brightness.ts:53](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/brightness.ts#L53)
Adjust brightness with clamping to prevent overflow.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Brightness adjustment (-1 to 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with adjusted brightness, clamped to 0-1
# brightnessMultiply
> **brightnessMultiply**(`inputColor`, `factor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/brightness.ts:40](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/brightness.ts#L40)
Adjust brightness multiplicatively (exposure-like).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### factor
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Brightness factor (1 = no change, >1 = brighter, <1 = darker)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with adjusted brightness
## Example
```ts
// Double brightness
brightnessMultiply(texture(tex, uv()), 2)
```
# c64Palette
> **c64Palette**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:230](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L230)
Commodore 64 palette approximation.
16 fixed colors with characteristic look.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color mapped to C64-like palette
# cgaPalette
> **cgaPalette**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:206](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L206)
CGA 4-color palette (Mode 4, Palette 1).
Classic PC palette: black, cyan, magenta, white.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color mapped to CGA palette
# chromaticAberration
> **chromaticAberration**(`tex`, `uv`, `amount?`, `angle?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/chromaticAberration.ts:19](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/chromaticAberration.ts#L19)
Chromatic aberration effect - separates RGB channels.
Simulates lens imperfection or analog video artifacts.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### amount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.005`
Separation amount in UV space (default: 0.005)
### angle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Separation angle in radians (default: 0 = horizontal)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with chromatic aberration
## Example
```ts
const aberrated = chromaticAberration(texture, uv, 0.005)
```
# chromaticAberrationCustom
> **chromaticAberrationCustom**(`tex`, `uv`, `redOffset?`, `blueOffset?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/chromaticAberration.ts:86](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/chromaticAberration.ts#L86)
Asymmetric chromatic aberration with separate RGB offsets.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### redOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Red channel offset
### blueOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Blue channel offset
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with custom chromatic aberration
# chromaticAberrationPulse
> **chromaticAberrationPulse**(`tex`, `uv`, `time`, `baseAmount?`, `pulseAmount?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/chromaticAberration.ts:114](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/chromaticAberration.ts#L114)
Pulsing/animated chromatic aberration.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### baseAmount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.002`
Base aberration amount
### pulseAmount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.003`
Additional pulse amount
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Animation speed
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Animated chromatic aberration
# chromaticAberrationRadial
> **chromaticAberrationRadial**(`tex`, `uv`, `amount?`, `center?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/chromaticAberration.ts:50](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/chromaticAberration.ts#L50)
Radial chromatic aberration - increases toward edges.
More realistic lens distortion simulation.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### amount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Maximum aberration at edges
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point of the effect
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with radial chromatic aberration
# colorBleeding
> **colorBleeding**(`tex`, `uv`, `amount?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:16](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L16)
Color bleeding/smearing effect.
Simulates horizontal color bleeding in composite video signals.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### amount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.003`
Bleed amount (default: 0.003)
### samples?
`number` = `4`
Number of samples (default: 4)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with bleeding effect
# colorRemap
> **colorRemap**(`inputColor`, `gradientTex`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/colorRemap.ts:28](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/colorRemap.ts#L28)
Remap colors using a gradient texture (LUT) based on luminance.
The gradient texture should be a horizontal strip where left = dark, right = bright.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### gradientTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Horizontal gradient texture for color lookup
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Effect strength (0 = original, 1 = fully remapped)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color remapped through gradient
## Examples
```ts
// Remap colors through a fire gradient
colorRemap(texture(tex, uv()), fireGradientTexture)
```
```ts
// Partial remap with uniform
colorRemap(texture(tex, uv()), gradientTex, strengthUniform)
```
# colorRemapCustom
> **colorRemapCustom**(`inputColor`, `gradientTex`, `lookupValue`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/colorRemap.ts:62](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/colorRemap.ts#L62)
Remap colors using a custom channel for lookup instead of luminance.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### gradientTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Horizontal gradient texture for color lookup
### lookupValue
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Custom value for gradient lookup (0-1)
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Effect strength (0 = original, 1 = fully remapped)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color remapped through gradient
## Example
```ts
// Remap based on red channel
colorRemapCustom(texture(tex, uv()), gradientTex, inputColor.r)
```
# colorReplace
> **colorReplace**(`inputColor`, `targetColor`, `replaceColor`, `tolerance?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/colorReplace.ts:23](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/colorReplace.ts#L23)
Replace a target color with a new color.
Uses smooth tolerance for anti-aliased sprites (smooth falloff at edges).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### targetColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to find and replace (RGB tuple or vec3 node)
### replaceColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to replace with (RGB tuple or vec3 node)
### tolerance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Match tolerance (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with replacement applied
## Examples
```ts
// Swap red for blue
colorReplace(color, [1, 0, 0], [0, 0, 1], 0.1)
```
```ts
// Create team color variants with uniform
colorReplace(color, baseColor, teamColorUniform, 0.15)
```
# colorReplaceHard
> **colorReplaceHard**(`inputColor`, `targetColor`, `replaceColor`, `tolerance?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/colorReplace.ts:64](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/colorReplace.ts#L64)
Replace a target color with a new color using hard cutoff (no blending).
Good for pixel art with exact color matching.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### targetColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to find and replace (RGB tuple or vec3 node)
### replaceColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to replace with (RGB tuple or vec3 node)
### tolerance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Match tolerance (default: 0.01)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with replacement applied
## Example
```ts
// Exact color swap for pixel art
colorReplaceHard(color, [1, 0, 0], [0, 0, 1], 0.01)
```
# colorReplaceMultiple
> **colorReplaceMultiple**(`inputColor`, `sourceColors`, `targetColors`, `tolerance?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/colorReplace.ts:110](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/colorReplace.ts#L110)
Replace multiple colors at once (palette swap).
Each source color maps to a corresponding target color.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### sourceColors
\[`number`, `number`, `number`\][]
Array of colors to find (RGB tuples)
### targetColors
\[`number`, `number`, `number`\][]
Array of colors to replace with (RGB tuples)
### tolerance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Match tolerance (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with all replacements applied
## Example
```ts
// Swap entire character palette
colorReplaceMultiple(
color,
[[1, 0, 0], [0, 1, 0], [0, 0, 1]], // Source: red, green, blue
[[1, 0.5, 0], [0, 0.5, 0], [0.5, 0, 1]], // Target: orange, dark green, purple
0.15
)
```
# contrast
> **contrast**(`inputColor`, `amount`, `midpoint?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/contrast.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/contrast.ts#L21)
Adjust contrast by scaling color values around a midpoint.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Contrast factor (1 = no change, >1 = more contrast, <1 = less contrast)
### midpoint?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Center point for scaling (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with adjusted contrast
## Examples
```ts
// Increase contrast
contrast(texture(tex, uv()), 1.5)
```
```ts
// Decrease contrast (flatten)
contrast(texture(tex, uv()), 0.5)
```
# contrastSCurve
> **contrastSCurve**(`inputColor`, `amount`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/contrast.ts:44](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/contrast.ts#L44)
Apply S-curve contrast (smoother, more natural-looking).
Uses smoothstep for a sigmoid-like curve.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Contrast intensity (0 = no change, 1 = maximum)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with S-curve contrast
# crtBloom
> **crtBloom**(`tex`, `uv`, `intensity?`, `spread?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:97](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L97)
CRT bloom/phosphor glow effect.
Simulates the characteristic glow of phosphor displays.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Bloom intensity (default: 0.3)
### spread?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.002`
Glow spread (default: 0.002)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with phosphor bloom
# crtColorBleed
> **crtColorBleed**(`tex`, `uv`, `amount?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:135](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L135)
CRT color bleeding/smearing effect.
Simulates horizontal color bleeding in composite video.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### amount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.002`
Bleeding amount (default: 0.002)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with bleeding effect
# crtComplete
> **crtComplete**(`tex`, `uv`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:174](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L174)
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
### options?
[`CRTOptions`](/three-flatland/api/nodes/src/interfaces/crtoptions/) = `{}`
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
# crtConvergence
> **crtConvergence**(`tex`, `uv`, `redOffset?`, `blueOffset?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:223](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L223)
CRT convergence error simulation.
Misaligns RGB channels slightly like poorly calibrated CRTs.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### redOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Red channel offset
### blueOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Blue channel offset
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with convergence error
# crtCurvature
> **crtCurvature**(`uv`, `curvature?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:18](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L18)
CRT barrel/curvature distortion.
Simulates the curved glass of CRT monitors.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### curvature?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Curvature amount (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const curvedUV = crtCurvature(uv, 0.15)
const color = texture(tex, curvedUV)
```
# crtCurvatureWithCorners
> **crtCurvatureWithCorners**(`uv`, `curvature?`, `cornerDarkness?`): `object`
Defined in: [packages/nodes/src/display/crtEffects.ts:41](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L41)
CRT curvature with corner darkening.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### curvature?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Curvature amount
### cornerDarkness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
How much corners darken (default: 0.1)
## Returns
`object`
Object with distorted UV and corner mask
### cornerMask
> **cornerMask**: [`Node`](https://threejs.org/docs/)\<`"float"`\>
### uv
> **uv**: [`Node`](https://threejs.org/docs/)\<`"vec2"`\> = `curved`
# crtVignette
> **crtVignette**(`inputColor`, `uv`, `intensity?`, `curvature?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/crtEffects.ts:70](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L70)
CRT vignette - darkens edges like old CRT displays.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Vignette strength (default: 0.3)
### curvature?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Edge curvature (default: 2)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with CRT vignette
# directionalLight2D
> **directionalLight2D**(`lightDir`, `lightColor?`, `intensity?`): [`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Defined in: [packages/nodes/src/lighting/lights.ts:140](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L140)
Calculate directional light (like sunlight) - infinite distance, uniform direction.
## Parameters
### lightDir
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Direction the light is coming FROM (will be negated)
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light intensity
## Returns
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Light2DResult with no distance attenuation
## Example
```ts
// Sun coming from top-right
const sun = directionalLight2D([1, 1], [1, 0.95, 0.9], 1.0)
```
# dissolve
> **dissolve**(`inputColor`, `inputUV`, `options`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/dissolve.ts:44](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L44)
Dissolve effect using a noise texture.
Creates a burning/disintegration effect with a glowing edge.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### options
[`DissolveOptions`](/three-flatland/api/nodes/src/interfaces/dissolveoptions/)
Dissolve configuration
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with dissolve effect applied
## Examples
```ts
// Basic dissolve
dissolve(texture(tex, uv()), uv(), {
progress: 0.5,
noiseTex: noiseTexture,
})
```
```ts
// Dissolve with custom edge color
dissolve(texture(tex, uv()), uv(), {
progress: dissolveUniform,
noiseTex: noiseTexture,
edgeColor: [0, 1, 0.5],
edgeWidth: 0.15,
})
```
# dissolveDirectional
> **dissolveDirectional**(`inputColor`, `inputUV`, `progress`, `noiseTex`, `direction?`, `noiseStrength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/dissolve.ts:173](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L173)
Directional dissolve (wipe effect with noise).
Combines a directional gradient with noise for a more organic wipe.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Dissolve progress (0-1)
### noiseTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Noise texture
### direction?
`"up"` \| `"down"` \| `"left"` \| `"right"`
Wipe direction: 'left', 'right', 'up', 'down'
### noiseStrength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
How much noise affects the wipe (0-1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with directional dissolve effect
# dissolvePixelated
> **dissolvePixelated**(`inputColor`, `inputUV`, `progress`, `noiseTex`, `pixelCount?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/dissolve.ts:136](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L136)
Pixelated dissolve effect - blocks disappear together in a pixel grid.
Creates a retro/8-bit style dissolve effect perfect for pixel art.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates (raw, not frame-mapped)
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Dissolve progress (0-1)
### noiseTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Noise texture for dissolve pattern
### pixelCount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `16`
Number of pixels in the grid (default: 16)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with pixelated dissolve effect
## Examples
```ts
// Basic pixelated dissolve
dissolvePixelated(color, uv(), dissolveProgress, noiseTexture)
```
```ts
// Coarser 8x8 pixel grid
dissolvePixelated(color, uv(), dissolveProgress, noiseTexture, 8)
```
# dissolveSimple
> **dissolveSimple**(`inputColor`, `inputUV`, `progress`, `noiseTex`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/dissolve.ts:98](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L98)
Simple dissolve without edge glow.
More performant when edge effect isn't needed.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Dissolve progress (0-1)
### noiseTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Noise texture for dissolve pattern
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with simple dissolve effect
# distortBarrel
> **distortBarrel**(`uv`, `strength?`, `zoom?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:124](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L124)
Barrel distortion - simulates lens distortion.
Commonly used for CRT screen curvature simulation.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates (should be 0-1)
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Distortion strength (positive = barrel, negative = pincushion)
### zoom?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Zoom adjustment to compensate for distortion (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
// CRT-like barrel distortion
const curved = distortBarrel(uv, 0.2)
```
# distortBulge
> **distortBulge**(`uv`, `center?`, `strength?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:50](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L50)
Bulge distortion - pushes pixels away from center.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Bulge center point
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Bulge strength (positive = bulge out)
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Effect radius in UV space
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const bulged = distortBulge(uv, [0.5, 0.5], 0.3, 0.4)
```
# distortDisplace
> **distortDisplace**(`uv`, `displacement`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:223](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L223)
Displacement map distortion - use a texture to distort UVs.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### displacement
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Displacement values (vec2 or from texture.rg)
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Displacement strength
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Displaced UV coordinates
# distortNoise
> **distortNoise**(`uv`, `strength?`, `scale?`, `time?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distortNoise.ts:92](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distortNoise.ts#L92)
Apply noise-based distortion to UV coordinates.
Uses simple value noise for displacement.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Distortion strength in UV space
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Noise scale (higher = finer detail)
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time for moving noise
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Noise-distorted UV coordinates
## Example
```ts
const distorted = distortNoise(uv, 0.03, 5, time)
```
# distortPerlin
> **distortPerlin**(`uv`, `strength?`, `scale?`, `time?`, `octaves?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distortNoise.ts:126](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distortNoise.ts#L126)
Apply Perlin noise distortion for smoother, more organic displacement.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Distortion strength
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `5`
Noise scale
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
### octaves?
`number` = `1`
Number of noise octaves for detail (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Perlin-distorted UV coordinates
## Example
```ts
const distorted = distortPerlin(uv, 0.02, 8, time, 2)
```
# distortPinch
> **distortPinch**(`uv`, `center?`, `strength?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:17](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L17)
Pinch distortion - pulls pixels toward center.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Pinch center point (default: [0.5, 0.5])
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Pinch strength (positive = pinch in, negative = expand)
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Effect radius in UV space
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const pinched = distortPinch(uv, [0.5, 0.5], 0.5, 0.5)
```
# distortPixelate
> **distortPixelate**(`uv`, `pixelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:158](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L158)
Pixelate distortion - snaps UV to grid for chunky pixel effect.
Use for transitions or stylized rendering.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### pixelSize?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Size of each "pixel" in UV space (default: 0.05)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Pixelated UV coordinates
## Example
```ts
const pixelated = distortPixelate(uv, 0.02)
const color = texture(tex, pixelated)
```
# distortPixelateCount
> **distortPixelateCount**(`uv`, `pixelCount?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:174](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L174)
Pixelate with pixel count (more intuitive API).
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### pixelCount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `64`
Number of pixels across (default: 64)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Pixelated UV coordinates
# distortShatter
> **distortShatter**(`uv`, `fragments?`, `offset?`, `seed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:191](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L191)
Shatter/fragment distortion - breaks image into polygonal pieces.
Creates a crystalline/broken glass effect.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### fragments?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Number of fragment divisions (default: 10)
### offset?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Maximum offset for each fragment (default: 0.02)
### seed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Random seed for fragment pattern
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Shattered UV coordinates
# distortSimplex
> **distortSimplex**(`uv`, `strength?`, `scale?`, `time?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distortNoise.ts:172](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distortNoise.ts#L172)
Simplex-like noise distortion (approximation).
Faster than Perlin with similar quality.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Distortion strength
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `5`
Noise scale
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Simplex-distorted UV coordinates
# distortSpherize
> **distortSpherize**(`uv`, `center?`, `strength?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:245](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L245)
Spherize distortion - wraps UV onto a sphere surface.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Effect center
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Spherize strength (0-1)
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Effect radius
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Spherized UV coordinates
# distortTurbulence
> **distortTurbulence**(`uv`, `strength?`, `scale?`, `time?`, `octaves?`, `lacunarity?`, `persistence?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distortNoise.ts:241](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distortNoise.ts#L241)
Turbulent noise distortion with multiple octaves.
Creates a more chaotic, organic distortion pattern.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.03`
Distortion strength
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `4`
Base noise scale
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
### octaves?
`number` = `4`
Number of noise layers
### lacunarity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Frequency multiplier per octave (default: 2)
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Amplitude multiplier per octave (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Turbulence-distorted UV coordinates
# distortTwirl
> **distortTwirl**(`uv`, `center?`, `angle?`, `radius?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/distort.ts:83](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/distort.ts#L83)
Twirl/swirl distortion - rotates pixels around center.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Twirl center point
### angle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `...`
Maximum rotation angle in radians at center
### radius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Effect radius (distortion fades to zero at edge)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const twirled = distortTwirl(uv, [0.5, 0.5], Math.PI, 0.4)
```
# dmgPalette
> **dmgPalette**(`inputColor`, `contrast?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:40](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L40)
Convert color to DMG Game Boy palette.
Uses the iconic green shades of the original DMG-01.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (vec4)
### contrast?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Palette contrast adjustment (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color mapped to DMG palette
## Example
```ts
const gameboy = dmgPalette(inputColor)
```
# dotMatrix
> **dotMatrix**(`input`, `uv`, `resolution?`, `pixelFill?`, `backgroundColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:77](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L77)
Game Boy DMG-style dot matrix display.
Simulates the distinctive square-pixel LCD look of the original Game Boy.
When input is a TextureNode (has .sample()), it pixelates by snapping UVs
to pixel centers. When input is a computed color, applies pixel grid only.
Pixel edges are slightly soft to simulate the slow LCD crystal response
time characteristic of Game Boy hardware.
## Parameters
### input
[`Node`](https://threejs.org/docs/)\<`"vec4"`\> \| [`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (TSLNode) or texture node (for pixelated sampling)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `160`
Pixel resolution (default: 160 for GB)
### pixelFill?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.85`
Fill ratio of pixel within cell (default: 0.85)
### backgroundColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of LCD background between pixels
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with dot matrix effect
# eagle
> **eagle**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/eagle.ts:18](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/eagle.ts#L18)
Eagle pixel art upscaling algorithm.
Simple 2x upscaler that enhances diagonal lines.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture (pixel art)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel in source texture
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
## Example
```ts
const upscaled = eagle(texture, uv, [1/256, 1/256])
```
# fadeEdge
> **fadeEdge**(`inputColor`, `inputUV`, `edgeWidth?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/fadeEdge.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/fadeEdge.ts#L21)
Fade alpha towards the edges of UV space using smoothstep.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### edgeWidth?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Width of the fade region (0-0.5, default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with edge-faded alpha
## Examples
```ts
// Fade edges with default width
fadeEdge(texture(tex, uv()), uv())
```
```ts
// Wide fade edge
fadeEdge(texture(tex, uv()), uv(), 0.3)
```
# fadeEdgeHorizontal
> **fadeEdgeHorizontal**(`inputColor`, `inputUV`, `edgeWidth?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/fadeEdge.ts:84](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/fadeEdge.ts#L84)
Fade alpha only on horizontal edges.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### edgeWidth?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Width of the fade region
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with horizontally faded alpha
# fadeEdgeRadial
> **fadeEdgeRadial**(`inputColor`, `inputUV`, `innerRadius?`, `outerRadius?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/fadeEdge.ts:57](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/fadeEdge.ts#L57)
Fade alpha in a circular pattern from center.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### innerRadius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Radius where fade starts (0-1)
### outerRadius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Radius where fully transparent (0-1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with radial-faded alpha
## Example
```ts
// Circular fade from 0.3 to 0.5 radius
fadeEdgeRadial(texture(tex, uv()), uv(), 0.3, 0.5)
```
# fadeEdgeVertical
> **fadeEdgeVertical**(`inputColor`, `inputUV`, `edgeWidth?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/alpha/fadeEdge.ts:106](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/fadeEdge.ts#L106)
Fade alpha only on vertical edges.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### edgeWidth?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Width of the fade region
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with vertically faded alpha
# filmGrain
> **filmGrain**(`inputColor`, `uv`, `time`, `intensity?`, `luminanceInfluence?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:231](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L231)
Film grain effect.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time (for grain variation)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Grain intensity (default: 0.1)
### luminanceInfluence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
How much luminance affects grain (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with film grain
# flash
> **flash**(`inputColor`, `progress`, `flashColor?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:19](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L19)
Apply a flash effect - temporary color overlay that fades out.
Useful for damage feedback, power-ups, or emphasis.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color (vec4)
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress (0 = start, 1 = end/invisible)
### flashColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of the flash (default: white)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Flash intensity at peak (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with flash overlay
## Example
```ts
// Trigger flash on hit, animate progress from 0 to 1
const flashed = flash(inputColor, flashProgress, [1, 1, 1])
```
# flashAdditive
> **flashAdditive**(`inputColor`, `progress`, `flashColor?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:78](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L78)
Additive flash that brightens without fully replacing color.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress
### flashColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color to add
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
Flash intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with additive flash
# flashAlpha
> **flashAlpha**(`inputColor`, `progress`, `flashColor?`, `alphaFlash?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:104](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L104)
Flash that affects alpha as well (sprite becomes visible/invisible).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress
### flashColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of flash
### alphaFlash?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
How much to affect alpha (0 = none, 1 = fully visible at flash)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with alpha flash
# flashDamage
> **flashDamage**(`inputColor`, `progress`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:130](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L130)
Damage flash effect - quick red flash common in games.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress (0 = hit, 1 = recovered)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.7`
Flash intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with damage flash
# flashHeal
> **flashHeal**(`inputColor`, `progress`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:146](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L146)
Healing flash effect - green glow.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.6`
Flash intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with healing flash
# flashPowerUp
> **flashPowerUp**(`inputColor`, `progress`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:162](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L162)
Power-up flash with golden glow.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
Flash intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with power-up flash
# flashSmooth
> **flashSmooth**(`inputColor`, `progress`, `flashColor?`, `peakTime?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/flash.ts:47](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/flash.ts#L47)
Flash with smooth in and out transition.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### progress
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Flash progress (0-1)
### flashColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of flash
### peakTime?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
When flash is brightest (0-1, default: 0.2)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Peak intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with smooth flash
# gbcPalette
> **gbcPalette**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:170](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L170)
Game Boy Color palette simulation.
15-bit color (5 bits per channel) with GBC's characteristic color response.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color quantized to GBC palette
# ghost
> **ghost**(`tex`, `uv`, `offsets`, `baseOpacity?`, `fadeWithDistance?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:108](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L108)
Multiple ghost/clone effect at offset positions.
Creates several semi-transparent copies at fixed offsets.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### offsets
\[`number`, `number`\][]
Array of offset positions for ghosts
### baseOpacity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Opacity of each ghost (default: 0.3)
### fadeWithDistance?
`boolean` = `true`
Fade ghosts based on offset distance
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with ghost clones
## Example
```ts
const ghosts = ghost(texture, uv, [[0.02, 0], [0.04, 0], [0.06, 0]], 0.3)
```
# ghostSpeed
> **ghostSpeed**(`tex`, `uv`, `velocity`, `maxGhosts?`, `spacing?`, `opacity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:189](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L189)
Speed ghost effect - ghosts that appear based on movement speed.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### velocity
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Movement velocity
### maxGhosts?
`number` = `5`
Maximum number of ghosts at full speed
### spacing?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.015`
Base spacing between ghosts
### opacity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Ghost opacity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with speed-based ghosts
# ghostTrail
> **ghostTrail**(`tex`, `uv`, `direction`, `count?`, `spacing?`, `opacity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/afterimage.ts:150](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/afterimage.ts#L150)
Directional ghost trail - creates ghosts along a direction.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Direction of ghost trail
### count?
`number` = `3`
Number of ghosts
### spacing?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Space between ghosts
### opacity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.4`
Ghost opacity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with directional ghosts
# glowSelective
> **glowSelective**(`inputColor`, `targetColor`, `glowColor?`, `tolerance?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:90](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L90)
Selective glow based on color matching.
Only applies glow to pixels matching a specific color.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### targetColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to glow
### glowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of the glow
### tolerance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Color matching tolerance (default: 0.2)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Glow intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with selective glow
# grayscale
> **grayscale**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/saturate.ts:49](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/saturate.ts#L49)
Convert color to grayscale using luminance weights.
Shorthand for saturate(color, 0).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Grayscale color
## Example
```ts
grayscale(texture(tex, uv()))
```
# hq2x
> **hq2x**(`tex`, `uv`, `texelSize?`, `threshold?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/hq2x.ts:22](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/hq2x.ts#L22)
HQ2x-style pixel art upscaling (simplified GPU implementation).
High quality 2x upscaling that preserves edges while smoothing.
Note: This is a simplified approximation of the full HQ2x algorithm,
which requires lookup tables that are impractical for real-time GPU shaders.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture (pixel art)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel in source texture
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Color difference threshold (default: 0.05)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
## Example
```ts
const upscaled = hq2x(texture, uv, [1/256, 1/256])
```
# hq3x
> **hq3x**(`tex`, `uv`, `texelSize?`, `threshold?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/hq2x.ts:117](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/hq2x.ts#L117)
HQ3x-style upscaling (simplified).
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Source texel size
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Color difference threshold
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
# hq4x
> **hq4x**(`tex`, `uv`, `texelSize?`, `threshold?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/hq2x.ts:197](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/hq2x.ts#L197)
HQ4x-style upscaling (simplified).
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Source texel size
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Color difference threshold
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
# hueShift
> **hueShift**(`inputColor`, `angle`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/hueShift.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/hueShift.ts#L21)
Shift the hue of a color using a rotation matrix in RGB space.
This is more efficient than RGB->HSV->RGB conversion.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### angle
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Hue shift angle in radians (0 to 2*PI for full cycle)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with shifted hue
## Examples
```ts
// Shift hue by 90 degrees
hueShift(texture(tex, uv()), Math.PI / 2)
```
```ts
// Animate rainbow effect
hueShift(texture(tex, uv()), timeUniform)
```
# hueShiftNormalized
> **hueShiftNormalized**(`inputColor`, `amount`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/hueShift.ts:63](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/hueShift.ts#L63)
Shift hue by a normalized amount (0-1 maps to 0-360 degrees).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Hue shift amount (0-1, wraps around)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with shifted hue
## Example
```ts
// Shift hue by 25%
hueShiftNormalized(texture(tex, uv()), 0.25)
```
# interlacing
> **interlacing**(`inputColor`, `uv`, `resolution?`, `field?`, `blendFactor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:51](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L51)
Interlacing effect.
Simulates interlaced video display with field alternation.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `480`
Vertical resolution
### field?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Current field (0 or 1, alternate each frame)
### blendFactor?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
How much to blend inactive lines (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with interlacing
# lcdBacklightBleed
> **lcdBacklightBleed**(`inputColor`, `uv`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:186](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L186)
LCD backlight bleed effect.
Simulates uneven backlight distribution.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Bleed intensity (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with backlight bleed
# lcdGBC
> **lcdGBC**(`inputColor`, `uv`, `resolution?`, `gridIntensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:250](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L250)
Game Boy Color LCD simulation.
Slightly different grid pattern than GBA.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `160`
Display resolution
### gridIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Grid visibility
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with GBC LCD effect
# lcdGhosting
> **lcdGhosting**(`currentTex`, `previousTex`, `uv`, `persistence?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:128](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L128)
LCD ghosting/motion blur effect.
Simulates the slow pixel response time of LCD displays.
## Parameters
### currentTex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Current frame texture
### previousTex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Previous frame texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.6`
Ghost persistence (default: 0.6)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with ghosting effect
# lcdGrid
> **lcdGrid**(`inputColor`, `uv`, `resolution?`, `gridIntensity?`, `subpixelIntensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L20)
LCD pixel grid effect.
Simulates the visible pixel structure of LCD/TFT displays like GBA.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (vec4)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Display resolution (default: 240 for GBA)
### gridIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.15`
Grid line darkness (default: 0.15)
### subpixelIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Subpixel structure visibility (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with LCD grid effect
## Example
```ts
const gba = lcdGrid(inputColor, uv, 240, 0.15)
```
# lcdMotionGhost
> **lcdMotionGhost**(`tex`, `uv`, `velocity`, `persistence?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:163](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L163)
Simple LCD persistence effect (single texture version).
Creates motion blur by blending with offset samples.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### velocity
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Motion direction and speed
### persistence?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.4`
Ghost amount
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with motion ghosting
# lcdPocket
> **lcdPocket**(`inputColor`, `uv`, `resolution?`, `contrast?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/lcd.ts:211](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/lcd.ts#L211)
Game Boy Pocket LCD effect.
Gray-scale LCD simulation with distinctive look.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (will be converted to grayscale)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `160`
Pixel resolution
### contrast?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1.2`
Display contrast
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with GB Pocket LCD effect
# litCelShaded
> **litCelShaded**(`normal`, `lightDir`, `surfaceColor`, `lightColor?`, `attenuation?`, `bands?`, `shadowColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:128](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L128)
Calculate cel-shaded (toon) lighting with hard bands.
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Surface normal
### lightDir
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Direction to light
### surfaceColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base surface color
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color
### attenuation?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light attenuation
### bands?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `3`
Number of shading bands (default: 3)
### shadowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color of shadowed areas (default: darker version of surface)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Cel-shaded color (vec4)
## Example
```ts
const toon = litCelShaded(normal, light.direction, inputColor, light.color, light.attenuation, 3)
```
# litDiffuse
> **litDiffuse**(`normal`, `lightDir`, `surfaceColor`, `lightColor`, `attenuation?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L20)
Calculate diffuse (Lambertian) lighting.
Basic directional shading based on surface normal and light direction.
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Surface normal (normalized vec3 in tangent space)
### lightDir
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Direction to light (normalized vec3)
### surfaceColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base surface color (vec4)
### lightColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Light color (vec3)
### attenuation?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light attenuation factor (0-1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Lit surface color (vec4)
## Example
```ts
const lit = litDiffuse(normal, light.direction, inputColor, light.color, light.attenuation)
```
# litRim
> **litRim**(`normal`, `viewDir?`, `rimColor?`, `rimPower?`, `rimStrength?`): [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:94](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L94)
Calculate rim/fresnel lighting effect.
Creates a glow around edges when viewed from an angle.
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Surface normal
### viewDir?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Direction to camera/viewer
### rimColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Rim light color
### rimPower?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Rim falloff exponent (higher = tighter rim)
### rimStrength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Rim intensity multiplier
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Rim light color (vec3, add to other lighting)
## Example
```ts
const rim = litRim(normal, [0, 0, 1], [0.5, 0.8, 1], 3, 1)
```
# litSpecular
> **litSpecular**(`normal`, `lightDir`, `viewDir?`, `lightColor?`, `attenuation?`, `shininess?`, `specularStrength?`): [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:54](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L54)
Calculate specular highlights (Blinn-Phong model).
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Surface normal
### lightDir
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Direction to light
### viewDir?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Direction to camera/viewer (default: straight up/forward)
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color
### attenuation?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light attenuation
### shininess?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `32`
Specular power/tightness (higher = smaller, sharper highlight)
### specularStrength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Specular intensity multiplier
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Specular highlight color (vec3, add to diffuse result)
## Example
```ts
const spec = litSpecular(normal, light.direction, viewDir, light.color, light.attenuation, 32, 0.5)
```
# litSprite
> **litSprite**(`normal`, `surfaceColor`, `light`, `ambient?`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:282](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L282)
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
### surfaceColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
### light
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
### ambient?
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
### options?
[`LitSpriteOptions`](/three-flatland/api/nodes/src/interfaces/litspriteoptions/) = `{}`
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
# litSpriteMulti
> **litSpriteMulti**(`normal`, `surfaceColor`, `lights`, `ambient?`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/lit.ts:177](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L177)
Combined sprite lighting with multiple lights.
Accumulates diffuse (and optionally specular) contributions from all lights,
adds ambient, and optionally applies rim lighting.
## Parameters
### normal
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Surface normal (normalized vec3)
### surfaceColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base surface color (vec4)
### lights
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)[]
Array of Light2DResult from point/spot/directional lights
### ambient?
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Optional ambient Light2DResult
### options?
[`LitSpriteOptions`](/three-flatland/api/nodes/src/interfaces/litspriteoptions/) = `{}`
Additional lighting options
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Fully lit color (vec4)
## Example
```ts
const result = litSpriteMulti(normal, baseColor, [torch1, torch2], ambient, {
specular: true,
shininess: 32,
})
```
# md9bitPalette
> **md9bitPalette**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:127](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L127)
Convert color to Sega Genesis/Mega Drive 9-bit palette.
VDP outputs 512 possible colors (3 bits per channel).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color quantized to 9-bit color space
# normalFromHeight
> **normalFromHeight**(`heightTex`, `uv`, `strength?`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/normalFromHeight.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/normalFromHeight.ts#L20)
Generate a normal map from a heightmap texture.
Uses Sobel-like sampling to compute surface normals from grayscale height data.
## Parameters
### heightTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Heightmap texture (grayscale, white = high, black = low)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates to sample
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Normal strength multiplier (default: 1)
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Size of one texel in UV space, or calculated from texture dimensions
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Normal vector in tangent space (vec3, -1 to 1 range)
## Example
```ts
// Generate normals from heightmap
const normals = normalFromHeight(heightmap, spriteUV, 2.0)
```
# normalFromHeightSmooth
> **normalFromHeightSmooth**(`heightTex`, `uv`, `strength?`, `scale?`): [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/normalFromHeight.ts:64](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/normalFromHeight.ts#L64)
Generate a normal map from a heightmap with adjustable detail.
Uses a larger sampling kernel for smoother normals.
## Parameters
### heightTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Heightmap texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Normal strength multiplier
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Sampling scale (higher = smoother but less detail)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Normal vector in tangent space
# ntscComposite
> **ntscComposite**(`tex`, `uv`, `artifactIntensity?`, `bleedAmount?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:80](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L80)
NTSC composite video artifact simulation.
Simplified version of composite video encoding artifacts.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### artifactIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Artifact visibility (default: 0.3)
### bleedAmount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.002`
Color bleed amount (default: 0.002)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with NTSC artifacts
# outline
> **outline**(`inputColor`, `inputUV`, `tex`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/sprite/outline.ts:37](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L37)
Add an outline effect by sampling neighboring pixels.
Detects edges based on alpha differences and draws outline around opaque areas.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (typically texture sample result)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
The texture to sample for neighbor detection
### options?
[`OutlineOptions`](/three-flatland/api/nodes/src/interfaces/outlineoptions/) = `{}`
Outline configuration
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with outline applied
## Examples
```ts
// Basic white outline
outline(texture(tex, uv()), uv(), tex, { color: [1, 1, 1, 1] })
```
```ts
// Glowing outline with custom thickness
outline(texture(tex, uv()), uv(), tex, {
color: [0, 1, 0, 1],
thickness: 0.02,
textureSize: [64, 64]
})
```
# outline8
> **outline8**(`inputColor`, `inputUV`, `tex`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/sprite/outline.ts:90](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L90)
Add an outline effect with 8-directional sampling for smoother edges.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (typically texture sample result)
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
The texture to sample for neighbor detection
### options?
[`OutlineOptions`](/three-flatland/api/nodes/src/interfaces/outlineoptions/) = `{}`
Outline configuration
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with outline applied
# palettize
> **palettize**(`inputColor`, `paletteTex`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/palettize.ts:31](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/palettize.ts#L31)
Map colors to nearest match in a palette texture.
Palette should be a 1D horizontal texture (Nx1 pixels).
This function samples the palette by computing the luminance of the input color
and using it to index into the palette texture.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### paletteTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Palette texture (horizontal strip)
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Effect strength (0 = original, 1 = fully palettized)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color snapped to palette
## Examples
```ts
// Apply GameBoy palette
palettize(color, gbPaletteTexture)
```
```ts
// Partial palette effect
palettize(color, retroPalette, 0.5)
```
# palettizeDithered
> **palettizeDithered**(`inputColor`, `paletteTex`, `paletteSize`, `dither?`, `screenCoord?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/palettize.ts:106](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/palettize.ts#L106)
Map colors to palette with dithering for smoother transitions.
Uses Bayer matrix dithering to blend between palette colors.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### paletteTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Palette texture (horizontal strip)
### paletteSize
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of colors in palette
### dither?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Dither strength between palette colors (0-1, default: 0.5)
### screenCoord?
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates for dithering pattern
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color snapped to palette with dithering
## Examples
```ts
// GameBoy 4-color palette with dithering
palettizeDithered(color, gbPalette, 4, 0.5, uv().mul(textureSize))
```
```ts
// C64 palette with strong dithering
palettizeDithered(color, c64Palette, 16, 0.8, screenCoord)
```
# palettizeNearest
> **palettizeNearest**(`inputColor`, `paletteTex`, `paletteSize`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/palettize.ts:151](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/palettize.ts#L151)
Find nearest color in palette by comparing RGB distance.
More accurate than luminance-based but more expensive.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### paletteTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Palette texture (horizontal strip)
### paletteSize
`number`
Number of colors in palette (max 16)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color snapped to nearest palette color
## Example
```ts
// Find nearest color in 8-color palette
palettizeNearest(color, palette8, 8)
```
# phosphorApertureGrille
> **phosphorApertureGrille**(`inputColor`, `uv`, `resolution?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/phosphorMask.ts:18](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/phosphorMask.ts#L18)
Aperture grille phosphor mask (Trinitron-style).
Vertical RGB stripes like Sony Trinitron CRTs.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (vec4)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `640`
Horizontal resolution (default: 640)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Mask intensity (default: 0.3)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with aperture grille effect
## Example
```ts
const trinitron = phosphorApertureGrille(inputColor, uv, 640, 0.25)
```
# phosphorMask
> **phosphorMask**(`inputColor`, `uv`, `maskType?`, `resolution?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/phosphorMask.ts:177](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/phosphorMask.ts#L177)
Customizable phosphor mask with configurable pattern.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### maskType?
`"slot"` \| `"aperture"` \| `"shadow"`
Type: 'aperture', 'slot', or 'shadow'
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `640`
Resolution scale
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Mask intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with phosphor mask
# phosphorShadowMask
> **phosphorShadowMask**(`inputColor`, `uv`, `resolution?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/phosphorMask.ts:99](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/phosphorMask.ts#L99)
Shadow mask phosphor pattern.
Triangular/delta arrangement of phosphor dots.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `300`
Resolution scale
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Mask intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with shadow mask effect
# phosphorSimple
> **phosphorSimple**(`inputColor`, `screenCoord`, `scale?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/phosphorMask.ts:146](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/phosphorMask.ts#L146)
Simple RGB stripe mask (lightweight version).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### screenCoord
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Screen coordinates (gl_FragCoord.xy or similar)
### scale?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Stripe scale (pixels per color)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Effect intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with RGB stripes
# phosphorSlotMask
> **phosphorSlotMask**(`inputColor`, `uv`, `resolutionX?`, `resolutionY?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/phosphorMask.ts:57](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/phosphorMask.ts#L57)
Slot mask phosphor pattern.
Staggered RGB pattern common in many CRT TVs.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolutionX?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `640`
Horizontal resolution
### resolutionY?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `480`
Vertical resolution
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Mask intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with slot mask effect
# pixelate
> **pixelate**(`inputUV`, `resolution`, `pivot?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/pixelate.ts:25](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/pixelate.ts#L25)
Pixelate UV coordinates by snapping to a pixel grid.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### resolution
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Pixel grid resolution as [width, height] or vec2 node
### pivot?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point for pixelation (default: [0.5, 0.5] = center)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Pixelated UV coordinates (snapped to grid centers)
## Examples
```ts
// Pixelate to 16x16 grid (centered)
pixelate(uv(), [16, 16])
```
```ts
// Animate pixelation with uniform (stays centered)
pixelate(uv(), resolutionUniform)
```
```ts
// Pixelate from top-left corner
pixelate(uv(), [16, 16], [0, 1])
```
# pixelateBySize
> **pixelateBySize**(`inputUV`, `pixelSize`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/pixelate.ts:48](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/pixelate.ts#L48)
Pixelate UV coordinates with a single pixel size value.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### pixelSize
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Size of pixels (higher = more pixelated)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Pixelated UV coordinates
## Example
```ts
// Pixelate with 8 pixel size
pixelateBySize(uv(), 8)
```
# pocketPalette
> **pocketPalette**(`inputColor`, `contrast?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:73](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L73)
Convert color to Game Boy Pocket palette.
Uses gray shades instead of green.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### contrast?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Contrast adjustment
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color mapped to Pocket palette
# pointLight2D
> **pointLight2D**(`surfacePos`, `lightPos`, `lightColor?`, `intensity?`, `distance?`, `decay?`): [`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Defined in: [packages/nodes/src/lighting/lights.ts:34](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L34)
Calculate 2D point light contribution at a surface position.
Provides direction, color, and distance-based attenuation.
## Parameters
### surfacePos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the surface being lit (vec2 in world/screen space)
### lightPos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the light source (vec2)
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color as [r, g, b] (0-1 range)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light intensity multiplier (default: 1)
### distance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `100`
Maximum light distance (default: 100)
### decay?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Decay exponent controlling attenuation curve shape (default: 2 for quadratic)
## Returns
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Light2DResult with direction, color, and attenuation
## Example
```ts
const light = pointLight2D(fragPos, [100, 100], [1, 0.9, 0.8], 2.0, 200)
const diffuse = litDiffuse(normal, light.direction, inputColor, light.color, light.attenuation)
```
# posterize
> **posterize**(`inputColor`, `bands`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/posterize.ts:25](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/posterize.ts#L25)
Posterize color to create flat, comic-book style bands.
This is semantically equivalent to quantize but with artist-friendly naming.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### bands
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of color bands (2-16 typical)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Posterized color
## Examples
```ts
// Create comic-book style with 4 bands
posterize(texture(tex, uv()), 4)
```
```ts
// Subtle posterization with 8 bands
posterize(color, 8)
```
```ts
// Dynamic posterization with uniform
posterize(color, bandsUniform)
```
# posterizeGamma
> **posterizeGamma**(`inputColor`, `bands`, `gamma?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/posterize.ts:52](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/posterize.ts#L52)
Posterize with gamma correction for more perceptually uniform bands.
Applies gamma before quantization and inverse gamma after.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### bands
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of color bands (2-16 typical)
### gamma?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2.2`
Gamma value (default: 2.2 for sRGB)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Posterized color with gamma correction
## Examples
```ts
// Gamma-corrected posterization
posterizeGamma(color, 4)
```
```ts
// Custom gamma
posterizeGamma(color, 4, 1.8)
```
# ppuPalette
> **ppuPalette**(`inputColor`, `saturation?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:100](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L100)
Convert color to NES/Famicom PPU palette (2C02).
Maps to the closest of 54 available colors.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### saturation?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Color saturation (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color approximating NES PPU output
# pulse
> **pulse**(`inputColor`, `time`, `speed?`, `minBrightness?`, `maxBrightness?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/pulse.ts:18](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/pulse.ts#L18)
Apply pulsing glow effect that modulates brightness over time.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color (vec4)
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Pulse speed (default: 2)
### minBrightness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.8`
Minimum brightness multiplier (default: 0.8)
### maxBrightness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1.2`
Maximum brightness multiplier (default: 1.2)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Pulsing color
## Example
```ts
const pulsing = pulse(inputColor, time, 2, 0.8, 1.2)
```
# pulseGlow
> **pulseGlow**(`inputColor`, `time`, `glowColor?`, `speed?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/pulse.ts:47](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/pulse.ts#L47)
Pulsing glow that adds color rather than multiplying.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### glowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color to pulse
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Pulse speed
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Maximum glow intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with pulsing glow
# pulseHeartbeat
> **pulseHeartbeat**(`inputColor`, `time`, `speed?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/pulse.ts:74](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/pulse.ts#L74)
Heartbeat-style pulse with quick beat and pause.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Pulse intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with heartbeat pulse
# pulseRadial
> **pulseRadial**(`inputColor`, `uv`, `time`, `center?`, `speed?`, `intensity?`, `glowColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/pulse.ts:110](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/pulse.ts#L110)
Radial pulse emanating from center.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Pulse center (default: [0.5, 0.5])
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Pulse speed
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Pulse intensity
### glowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of the pulse wave
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with radial pulse
# pulseRainbow
> **pulseRainbow**(`inputColor`, `time`, `speed?`, `saturation?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/pulse.ts:146](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/pulse.ts#L146)
Color cycling pulse effect.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Color cycle speed
### saturation?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Color saturation (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with cycling hue
# quantize
> **quantize**(`inputColor`, `levels`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/quantize.ts:25](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/quantize.ts#L25)
Quantize color to discrete levels per channel.
Creates a retro/pixel art look by reducing the number of possible colors.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### levels
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of levels per channel (2-256)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Quantized color
## Examples
```ts
// 8 levels per channel (512 colors)
quantize(texture(tex, uv()), 8)
```
```ts
// Binary colors per channel (8 colors total)
quantize(color, 2)
```
```ts
// Using a uniform for dynamic control
quantize(color, levelsUniform)
```
# quantizeRGB
> **quantizeRGB**(`inputColor`, `rLevels`, `gLevels`, `bLevels`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/quantize.ts:54](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/quantize.ts#L54)
Quantize color with different levels for each RGB channel.
Useful for specific retro palettes like 3-3-2 (8-bit color).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### rLevels
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of levels for red channel
### gLevels
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of levels for green channel
### bLevels
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Number of levels for blue channel
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Quantized color
## Examples
```ts
// 8-bit color (3-3-2 format: 8R, 8G, 4B)
quantizeRGB(color, 8, 8, 4)
```
```ts
// 16-bit high color (5-6-5 format)
quantizeRGB(color, 32, 64, 32)
```
# sai2x
> **sai2x**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/eagle.ts:137](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/eagle.ts#L137)
2xSaI (2x Scale and Interpolation) algorithm.
Advanced pixel art scaler with smooth interpolation.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Source texel size
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
# sampleSprite
> **sampleSprite**(`tex`, `frame`, `options?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\> \| [`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/sprite/sampleSprite.ts:34](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/sampleSprite.ts#L34)
Sample a sprite from a texture with frame-based UV mapping.
Works with both animated sprites (pass uniform) and static sprites (pass fixed frame).
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
The sprite texture to sample
### frame
[`Vec4Input`](/three-flatland/api/nodes/src/type-aliases/vec4input/)
Frame bounds as [x, y, width, height] in UV space (0-1), or a vec4 uniform
### options?
Optional settings
#### alphaTest?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\> \| [`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Sampled color (vec4)
## Examples
```ts
// Static sprite (full texture)
const color = sampleSprite(texture, [0, 0, 1, 1])
```
```ts
// Static sprite (specific frame)
const frame = spriteSheet.getFrame('idle_0')
const color = sampleSprite(texture, [frame.x, frame.y, frame.width, frame.height])
```
```ts
// Animated sprite (frame uniform updates each tick)
const frameUniform = uniform(new Vector4(0, 0, 0.125, 0.125))
const color = sampleSprite(texture, frameUniform)
```
```ts
// With alpha discard
const color = sampleSprite(texture, frame, { alphaTest: 0.01 })
```
# saturate
> **saturate**(`inputColor`, `amount`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/saturate.ts:25](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/saturate.ts#L25)
Adjust saturation by mixing with grayscale (luminance).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### amount
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Saturation amount (0 = grayscale, 1 = original, >1 = oversaturated)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with adjusted saturation
## Examples
```ts
// Desaturate to grayscale (petrified effect)
saturate(texture(tex, uv()), 0)
```
```ts
// Boost saturation
saturate(texture(tex, uv()), 1.5)
```
# scale2x
> **scale2x**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/scale2x.ts:19](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/scale2x.ts#L19)
Scale2x (AdvMAME2x) pixel art upscaling algorithm.
Simple edge-detection based upscaling that preserves pixel art edges.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture (pixel art)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Size of one texel in the source texture
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
## Example
```ts
// For a 256x256 texture upscaled to 512x512
const upscaled = scale2x(texture, uv, [1/256, 1/256])
```
# scale3x
> **scale3x**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/scale2x.ts:100](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/scale2x.ts#L100)
Scale3x (AdvMAME3x) pixel art upscaling algorithm.
3x upscaling variant with more refined edge detection.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Source texel size
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
# scanlines
> **scanlines**(`inputColor`, `uv`, `resolution?`, `intensity?`, `offset?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/scanlines.ts:19](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/scanlines.ts#L19)
Apply CRT scanline effect.
Darkens alternating horizontal lines to simulate CRT display.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (vec4)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Vertical resolution (number of scanlines, default: 240)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Scanline darkness (0-1, default: 0.3)
### offset?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Line offset for interlacing simulation (default: 0)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with scanline effect
## Example
```ts
const crt = scanlines(inputColor, uv, 240, 0.3)
```
# scanlinesGlow
> **scanlinesGlow**(`inputColor`, `uv`, `resolution?`, `lineIntensity?`, `glowIntensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/scanlines.ts:86](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/scanlines.ts#L86)
Scanlines with bloom/glow between lines.
Simulates phosphor glow bleeding between scanlines.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Vertical resolution
### lineIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Scanline darkness
### glowIntensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Glow between lines
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with scanlines and glow
# scanlinesGrid
> **scanlinesGrid**(`inputColor`, `uv`, `resolutionX?`, `resolutionY?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/scanlines.ts:156](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/scanlines.ts#L156)
Combined horizontal and vertical scanlines (shadow mask simulation).
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolutionX?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `320`
Horizontal resolution
### resolutionY?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Vertical resolution
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Effect intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with grid pattern
# scanlinesInterlaced
> **scanlinesInterlaced**(`inputColor`, `uv`, `resolution?`, `field?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/scanlines.ts:123](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/scanlines.ts#L123)
Interlaced scanlines for authentic interlaced display simulation.
Alternates which lines are visible each frame.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Vertical resolution
### field?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Current field (0 or 1, alternate each frame)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Scanline intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with interlaced scanlines
# scanlinesSmooth
> **scanlinesSmooth**(`inputColor`, `uv`, `resolution?`, `intensity?`, `phase?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/display/scanlines.ts:53](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/scanlines.ts#L53)
Smooth scanlines with sine wave pattern.
More authentic CRT look with gradual brightness variation.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### resolution?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `240`
Vertical resolution
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.2`
Effect intensity
### phase?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Phase offset (use for animation/interlacing)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with smooth scanlines
# shadow2D
> **shadow2D**(`position`, `lightPos`, `occluderTex`, `occluderSize`, `shadowStrength?`): [`Node`](https://threejs.org/docs/)\<`"float"`\>
Defined in: [packages/nodes/src/lighting/shadows.ts:115](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/shadows.ts#L115)
Calculate hard 2D shadow from a light source.
Checks if a point is in shadow by sampling an occluder texture.
## Parameters
### position
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
World/screen position of the surface
### lightPos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the light source
### occluderTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Texture containing occluder data (alpha channel)
### occluderSize
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Size of the occluder texture in world units
### shadowStrength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.7`
Shadow intensity (default: 0.7)
## Returns
[`Node`](https://threejs.org/docs/)\<`"float"`\>
Shadow factor (0 = full shadow, 1 = no shadow)
## Example
```ts
const shadow = shadow2D(fragPos, lightPos, occluderMap, [512, 512])
finalColor = finalColor.mul(shadow)
```
# shadowDrop
> **shadowDrop**(`spriteTex`, `uv`, `shadowOffset?`, `shadowColor?`, `shadowAlpha?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/shadows.ts:22](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/shadows.ts#L22)
Create a drop shadow effect.
Samples the sprite's alpha at an offset position to create shadow.
## Parameters
### spriteTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source sprite texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Current UV coordinates
### shadowOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Shadow offset in UV space (default: [0.02, -0.02])
### shadowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Shadow color (default: [0, 0, 0])
### shadowAlpha?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Shadow opacity (default: 0.5)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Shadow color with alpha (vec4), composite with original
## Example
```ts
// Create shadow behind sprite
const shadow = shadowDrop(texture, uv, [0.03, -0.03], [0, 0, 0], 0.4)
// Mix: show shadow where sprite alpha is 0, original where alpha is 1
```
# shadowDropSoft
> **shadowDropSoft**(`spriteTex`, `uv`, `shadowOffset?`, `shadowColor?`, `shadowAlpha?`, `softness?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/lighting/shadows.ts:56](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/shadows.ts#L56)
Create a soft drop shadow with blur.
Samples multiple offset positions to create a softer shadow.
## Parameters
### spriteTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source sprite texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Current UV coordinates
### shadowOffset?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Shadow offset in UV space
### shadowColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Shadow color
### shadowAlpha?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Shadow opacity
### softness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Blur amount in UV space (default: 0.01)
### samples?
`number` = `4`
Number of blur samples (default: 4)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Soft shadow color with alpha
# shadowSDF2D
> **shadowSDF2D**(`surfaceWorldPos`, `lightWorldPos`, `sdfTexture`, `worldSize`, `worldOffset`, `options?`): [`Node`](https://threejs.org/docs/)\<`"float"`\>
Defined in: [packages/nodes/src/lighting/shadows.ts:271](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/shadows.ts#L271)
Sphere-trace a 2D hard shadow ray through an SDF texture.
Walks along the line from the shaded surface point toward the light,
sampling the SDF at each step to advance by the guaranteed-clear
distance. Binary result: `0` if the ray hits an occluder along the
way, `1` if it reaches the light cleanly. Soft shadow edges come
from (a) the separable gaussian blur pass applied in `SDFGenerator`
and (b) the IQ soft-shadow accumulation along the trace — primarily,
not from texture filtering. The SDF sample filter is selectable via
`shadowFilter` (`auto|nearest|linear`): nearest for crisp / pixel-
snapped shadows (avoids the eps-threshold halo), linear for smoother
non-snapped edges. `auto` picks nearest when shadow pixel-snap is on,
linear otherwise. Either way the blur + penumbra math carry the bulk
of the softness.
The classic IQ penumbra term `min(k · h / t)` was removed because
it accumulates at every step of the walk, which in closed 2D scenes
(dungeons, corridors — casters scattered everywhere) produces a
uniform global darkening: every ray walks near *something*, so
`h/t` always drops below 1 somewhere, `shadow` always ends below 1,
and `shadowStrength` linearly amplifies that scene-wide. The
`softness` option is retained for API stability (now ignored); a
future PCSS-style two-phase trace could reintroduce real
distance-aware penumbra widening without the false-proximity issue.
The SDF texture is assumed to be produced by `SDFGenerator` and
encodes SIGNED **world-space** distance on the `.r` channel — negative
inside occluders, positive outside. Signed distance lets the trace
detect "stepped into an occluder" mid-walk without needing the
hardcoded caster-escape offset the unsigned variant required. World-
space distances keep the sphere-trace isotropic on non-square
viewports. `worldSize` / `worldOffset` are still consumed here to
transform the fragment/ray world position into the SDF's UV space for
sampling.
## Parameters
### surfaceWorldPos
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
World-space position of the shaded fragment.
### lightWorldPos
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
World-space position of the light.
### sdfTexture
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
SDF texture captured at build time. Must come
from `SDFGenerator` (UV-space distances in .r).
### worldSize
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Camera frustum size (Node — uniform, updated
each frame from the camera bounds).
### worldOffset
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Camera frustum offset (Node — uniform).
### options?
#### eps?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
World-space hit threshold. Default 0.5.
#### fragmentCastsShadow?
[`Node`](https://threejs.org/docs/)\<`"bool"`\>
When provided, gates the `nearCaster` escape path: the ray only
skips past an occluder it's sitting on if THIS fragment is itself
a shadow caster. Without this gate, a floor fragment that happens
to lie under a sprite's rasterized silhouette (seeded in the SDF)
would incorrectly escape and render as lit — leaving a bright
alpha-blended halo wherever a sprite's anti-aliased edge overlaps
the floor. Pass `readCastShadowFlag()` here from the caller's
light shader.
#### maxShadowDistance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Maximum world-space distance from the receiver at which shadow
still applies. A ray that hits an occluder at `t = t_hit` has
its shadow scaled by `1 - t_hit / maxShadowDistance`, clamped to
[0, 1]. Default 0 means no distance falloff (shadow is binary at
every distance). Set >0 to hide point-light cone-fan artifacts
far from the caster — close-range shadows stay solid, long-range
shadows fade to lit.
#### softness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Retained for API stability; currently ignored.
Soft edges come from SDF blur + linear sampling,
not per-ray integration. Will re-enable once a
PCSS-style trace lands.
#### startOffset?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
World-space distance to push the ray origin forward when the
fragment itself sits inside a caster silhouette (signed SDF < 0).
Must clear the caster's radius — too small and the first samples
land inside the caster (self-shadow) or in the Voronoi-seam zone
near the silhouette (shadow-edge ringing). Default 40 world units
matches the old unsigned-SDF escape calibration; scenes with
smaller/larger casters should tune accordingly.
#### steps?
`number`
Compile-time loop count. Default 32.
## Returns
[`Node`](https://threejs.org/docs/)\<`"float"`\>
Node<'float'> in [0, 1]. 0 = fully shadowed, 1 = fully lit.
# shadowSoft2D
> **shadowSoft2D**(`position`, `lightPos`, `occluderTex`, `occluderSize`, `lightRadius?`, `shadowStrength?`): [`Node`](https://threejs.org/docs/)\<`"float"`\>
Defined in: [packages/nodes/src/lighting/shadows.ts:157](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/shadows.ts#L157)
Calculate soft 2D shadow with penumbra.
Samples multiple rays for a softer shadow edge.
## Parameters
### position
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
World/screen position of the surface
### lightPos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the light source
### occluderTex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Texture containing occluder data
### occluderSize
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Size of the occluder texture in world units
### lightRadius?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Radius of the light source for soft shadows
### shadowStrength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.7`
Shadow intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"float"`\>
Soft shadow factor
# shimmer
> **shimmer**(`inputColor`, `uv`, `time`, `angle?`, `speed?`, `intensity?`, `shimmerColor?`, `width?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/shimmer.ts:22](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/shimmer.ts#L22)
Add shimmer/shine effect - a moving highlight across the surface.
Creates a metallic or glossy appearance.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color (vec4)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### angle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.785`
Shimmer angle in radians (default: 0.785 = 45°)
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed (default: 1)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Shimmer brightness (default: 0.5)
### shimmerColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of the shimmer highlight
### width?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Width of shimmer band (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with shimmer effect
## Example
```ts
const shiny = shimmer(inputColor, uv, time, Math.PI/4, 1, 0.5, [1, 1, 1])
```
# shimmerHolographic
> **shimmerHolographic**(`inputColor`, `uv`, `time`, `speed?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/shimmer.ts:114](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/shimmer.ts#L114)
Holographic shimmer with rainbow effect.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.4`
Effect intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with holographic shimmer
# shimmerMetallic
> **shimmerMetallic**(`inputColor`, `uv`, `time?`, `intensity?`, `shineColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/shimmer.ts:155](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/shimmer.ts#L155)
Metallic shine effect based on viewing angle simulation.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time (for subtle movement)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Shine intensity
### shineColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of metallic highlight
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with metallic shine
# shimmerWave
> **shimmerWave**(`inputColor`, `uv`, `time`, `waves?`, `speed?`, `intensity?`, `shimmerColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/shimmer.ts:71](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/shimmer.ts#L71)
Wave shimmer effect - multiple shimmering waves.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### waves?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `3`
Number of shimmer waves (default: 3)
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Shimmer intensity
### shimmerColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Shimmer color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with wave shimmer
# signalInterference
> **signalInterference**(`inputColor`, `uv`, `time`, `barHeight?`, `intensity?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:226](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L226)
Signal interference bars.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### barHeight?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Height of interference bars (default: 0.1)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Interference intensity
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Bar movement speed
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with interference
# snesPalette
> **snesPalette**(`inputColor`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:190](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L190)
SNES/Super Famicom 15-bit palette.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color quantized to SNES palette
# sparkle
> **sparkle**(`inputColor`, `uv`, `time`, `density?`, `intensity?`, `sparkleColor?`, `speed?`, `threshold?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/sparkle.ts:30](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/sparkle.ts#L30)
Add sparkle/glitter effect to a color.
Creates randomly appearing bright spots that twinkle over time.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color (vec4)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### density?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `50`
Sparkle density (higher = more sparkles, default: 50)
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
Sparkle brightness (default: 2)
### sparkleColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of sparkles (default: white)
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `3`
Animation speed (default: 3)
### threshold?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.97`
Sparkle appearance threshold (default: 0.97)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with sparkle effect
## Example
```ts
const sparkly = sparkle(inputColor, uv, time, 40, 2, [1, 1, 1])
```
# sparkleRainbow
> **sparkleRainbow**(`inputColor`, `uv`, `time`, `density?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/sparkle.ts:148](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/sparkle.ts#L148)
Rainbow sparkle effect with color cycling.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### density?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `40`
Sparkle density
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1.5`
Sparkle brightness
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with rainbow sparkle effect
# sparkleStar
> **sparkleStar**(`inputColor`, `uv`, `time`, `density?`, `intensity?`, `sparkleColor?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/sparkle.ts:90](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/sparkle.ts#L90)
Animated star sparkle with 4-point star shape.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### density?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `30`
Sparkle density
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1.5`
Sparkle brightness
### sparkleColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Color of sparkles
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with star sparkle effect
# speedLines
> **speedLines**(`inputColor`, `uv`, `center?`, `density?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/blurMotion.ts:177](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/blurMotion.ts#L177)
Directional speed lines effect.
Creates manga/anime style motion lines.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Base color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Focus point
### density?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `50`
Line density
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation speed (use time input)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with speed lines
# spotLight2D
> **spotLight2D**(`surfacePos`, `lightPos`, `lightDir`, `lightColor?`, `intensity?`, `distance?`, `innerAngle?`, `outerAngle?`): [`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Defined in: [packages/nodes/src/lighting/lights.ts:83](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L83)
Calculate 2D spot light contribution with cone falloff.
## Parameters
### surfacePos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the surface being lit
### lightPos
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Position of the light source
### lightDir
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Direction the spotlight is pointing (normalized vec2)
### lightColor?
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/) = `...`
Light color
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Light intensity
### distance?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `100`
Maximum light distance
### innerAngle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.3`
Inner cone angle in radians (full intensity)
### outerAngle?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.6`
Outer cone angle in radians (falloff to zero)
## Returns
[`Light2DResult`](/three-flatland/api/nodes/src/interfaces/light2dresult/)
Light2DResult with cone attenuation applied
## Example
```ts
const spot = spotLight2D(fragPos, [100, 100], [0, -1], [1, 1, 0.9], 1.5, 150, 0.3, 0.6)
```
# spriteUV
> **spriteUV**(`frame`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/sampleSprite.ts:91](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/sampleSprite.ts#L91)
Get the UV coordinates for a sprite frame.
Useful when you need the UV separately (e.g., for outline effects that sample neighbors).
## Parameters
### frame
[`Vec4Input`](/three-flatland/api/nodes/src/type-aliases/vec4input/)
Frame bounds as [x, y, width, height] in UV space (0-1), or a vec4 uniform
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Transformed UV coordinates for the frame
## Example
```ts
const frameUV = spriteUV(frameUniform)
const color = texture(tex, frameUV)
return outline8(color, frameUV, tex, { color: [0, 1, 0, 1] })
```
# staticNoise
> **staticNoise**(`inputColor`, `uv`, `time`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:160](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L160)
TV static noise effect.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color (can mix with static)
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Static intensity (0 = no static, 1 = full static)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with static noise
# superEagle
> **superEagle**(`tex`, `uv`, `texelSize?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/upscale/eagle.ts:85](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/upscale/eagle.ts#L85)
SuperEagle - enhanced Eagle algorithm.
Better diagonal handling and smoother results.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### texelSize?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Source texel size
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Upscaled color
# tint
> **tint**(`inputColor`, `tintColor`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/tint.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/tint.ts#L21)
Apply a color tint by multiplying with the input color.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### tintColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Tint color as [r, g, b] (0-1 range) or TSL node
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Tint strength (0 = no tint, 1 = full tint, default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Tinted color
## Examples
```ts
// Apply red tint
tint(texture(tex, uv()), [1, 0, 0])
```
```ts
// Partial tint with uniform
tint(texture(tex, uv()), tintColorUniform, 0.5)
```
# tintAdditive
> **tintAdditive**(`inputColor`, `addColor`, `strength?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/color/tint.ts:49](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/color/tint.ts#L49)
Apply an additive color tint (adds color rather than multiplying).
Useful for "flash" effects like damage feedback.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
The input color (vec4 with alpha)
### addColor
[`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Color to add as [r, g, b] (0-1 range) or TSL node
### strength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Effect strength (0 = no effect, 1 = full effect)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with additive tint
## Example
```ts
// Flash white on hit
tintAdditive(texture(tex, uv()), [1, 1, 1], hitFlashUniform)
```
# trail
> **trail**(`tex`, `uv`, `direction`, `length?`, `samples?`, `falloff?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/trail.ts:22](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/trail.ts#L22)
Create motion trail effect by sampling previous positions.
Samples the texture at offset positions to create a trailing effect.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Current UV coordinates
### direction
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Trail direction (normalized vec2 or [x, y])
### length?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Trail length in UV space (default: 0.1)
### samples?
`number` = `4`
Number of trail samples (default: 4)
### falloff?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
How quickly trail fades (default: 2)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with motion trail
## Example
```ts
// Horizontal motion trail
const trailed = trail(texture, uv, [1, 0], 0.1, 4)
```
# trailAdditive
> **trailAdditive**(`tex`, `uv`, `direction`, `length?`, `samples?`, `intensity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/trail.ts:64](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/trail.ts#L64)
Motion trail with additive blending for glowing trails.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Trail direction
### length?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Trail length
### samples?
`number` = `4`
Number of samples
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Trail intensity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with additive trail
# trailBlur
> **trailBlur**(`tex`, `uv`, `direction`, `length?`, `samples?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/trail.ts:101](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/trail.ts#L101)
Speed lines / motion blur in a direction.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### direction
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Motion direction
### length?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.05`
Blur length
### samples?
`number` = `8`
Number of blur samples
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Motion-blurred color
# trailVelocity
> **trailVelocity**(`tex`, `uv`, `velocity`, `maxLength?`, `samples?`, `opacity?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/vfx/trail.ts:141](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/vfx/trail.ts#L141)
Create echo/ghost trail using velocity-based offset.
## Parameters
### tex
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### velocity
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Current velocity (determines direction and intensity)
### maxLength?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.15`
Maximum trail length
### samples?
`number` = `4`
Number of echo samples
### opacity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.6`
Trail opacity
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with velocity-based trail
# uvFlip
> **uvFlip**(`inputUV`, `flipX?`, `flipY?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/uvFlip.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/uvFlip.ts#L21)
Flip UV coordinates horizontally and/or vertically.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### flipX?
`boolean` \| [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Whether to flip horizontally (true/1 = flip, false/0 = normal)
### flipY?
`boolean` \| [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Whether to flip vertically (true/1 = flip, false/0 = normal)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Flipped UV coordinates
## Examples
```ts
// Flip horizontally
uvFlip(uv(), true, false)
```
```ts
// Flip based on uniform
uvFlip(uv(), flipXUniform, flipYUniform)
```
# uvOffset
> **uvOffset**(`inputUV`, `offset`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/uvOffset.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/uvOffset.ts#L20)
Offset UV coordinates by a given amount.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### offset
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Offset amount as [x, y] or vec2 node
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Offset UV coordinates
## Examples
```ts
// Offset UV by 0.1 in both directions
uvOffset(uv(), [0.1, 0.1])
```
```ts
// Animate UV offset with uniform
uvOffset(uv(), offsetUniform)
```
# uvRotate
> **uvRotate**(`inputUV`, `angle`, `pivot?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/uvRotate.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/uvRotate.ts#L21)
Rotate UV coordinates around a pivot point.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### angle
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Rotation angle in radians (or float node)
### pivot?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Pivot point for rotation (default: [0.5, 0.5] = center)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Rotated UV coordinates
## Examples
```ts
// Rotate UV by 45 degrees around center
uvRotate(uv(), Math.PI / 4)
```
```ts
// Animate rotation with uniform
uvRotate(uv(), angleUniform, [0.5, 0.5])
```
# uvScale
> **uvScale**(`inputUV`, `scale`, `pivot?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/sprite/uvScale.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/uvScale.ts#L21)
Scale UV coordinates around a pivot point.
## Parameters
### inputUV
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
The UV coordinates to transform
### scale
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/)
Scale factor as [x, y] or vec2 node
### pivot?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Pivot point for scaling (default: [0.5, 0.5] = center)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Scaled UV coordinates
## Examples
```ts
// Scale UV by 2x around center
uvScale(uv(), [2, 2])
```
```ts
// Scale with uniform for animation
uvScale(uv(), scaleUniform, [0.5, 0.5])
```
# vbPalette
> **vbPalette**(`inputColor`, `contrast?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/retro/consolePalettes.ts:144](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/retro/consolePalettes.ts#L144)
Convert color to Virtual Boy palette.
Red and black only, 4 shades.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### contrast?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Contrast adjustment
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color mapped to Virtual Boy palette
# vhsDistortion
> **vhsDistortion**(`tex`, `uv`, `time`, `intensity?`, `noiseAmount?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/analog/videoArtifacts.ts:117](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/analog/videoArtifacts.ts#L117)
VHS tape distortion effect.
Simulates tracking errors and tape degradation.
## Parameters
### tex
[`TextureNode`](https://threejs.org/docs/)\<`"vec4"`\>
Source texture
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### time
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Animation time
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Distortion intensity (default: 0.02)
### noiseAmount?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.1`
Noise visibility (default: 0.1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with VHS distortion
# vignette
> **vignette**(`inputColor`, `uv`, `intensity?`, `softness?`, `roundness?`): [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/blur/bloom.ts:199](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/blur/bloom.ts#L199)
Vignette effect - darkens edges of the screen.
## Parameters
### inputColor
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Input color
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
UV coordinates
### intensity?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Vignette strength (default: 0.5)
### softness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.5`
Edge softness (default: 0.5)
### roundness?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Vignette shape roundness (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Color with vignette
# waveHorizontal
> **waveHorizontal**(`uv`, `amplitude?`, `frequency?`, `time?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/wave.ts:20](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/wave.ts#L20)
Apply horizontal wave distortion to UV coordinates.
Creates a wavy effect like looking through water or heat haze.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### amplitude?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Wave amplitude in UV space (default: 0.02)
### frequency?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Wave frequency (default: 10)
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time for moving waves
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed multiplier (default: 1)
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const distortedUV = waveHorizontal(uv, 0.02, 10, time)
const color = texture(tex, distortedUV)
```
# waveRadial
> **waveRadial**(`uv`, `center?`, `amplitude?`, `frequency?`, `time?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/wave.ts:81](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/wave.ts#L81)
Apply radial wave distortion emanating from center.
Creates a pulsing distortion effect.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point of the wave effect (default: [0.5, 0.5])
### amplitude?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Wave amplitude
### frequency?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Wave frequency
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
const distortedUV = waveRadial(uv, [0.5, 0.5], 0.03, 15, time)
```
# waveRipple
> **waveRipple**(`uv`, `center?`, `amplitude?`, `frequency?`, `time?`, `decay?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/wave.ts:123](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/wave.ts#L123)
Apply ripple distortion from a point (like a droplet in water).
Creates expanding circular waves that fade with distance.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### center?
[`Vec2Input`](/three-flatland/api/nodes/src/type-aliases/vec2input/) = `...`
Center point of the ripple
### amplitude?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.03`
Wave amplitude
### frequency?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `20`
Wave frequency
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time (controls ripple expansion)
### decay?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `2`
How quickly ripples fade with distance (default: 2)
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
## Example
```ts
// Ripple from click position
const distortedUV = waveRipple(uv, clickPos, 0.05, 20, time, 3)
```
# waveVertical
> **waveVertical**(`uv`, `amplitude?`, `frequency?`, `time?`, `speed?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/wave.ts:48](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/wave.ts#L48)
Apply vertical wave distortion to UV coordinates.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### amplitude?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.02`
Wave amplitude in UV space
### frequency?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `10`
Wave frequency
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
### speed?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `1`
Animation speed multiplier
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Distorted UV coordinates
# waveWater
> **waveWater**(`uv`, `amplitude?`, `time?`): [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/distortion/wave.ts:159](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/distortion/wave.ts#L159)
Combine multiple wave effects for complex water-like distortion.
## Parameters
### uv
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Input UV coordinates
### amplitude?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0.01`
Overall amplitude
### time?
[`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/) = `0`
Animation time
## Returns
[`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Complex wave-distorted UV coordinates
# CRTOptions
Defined in: [packages/nodes/src/display/crtEffects.ts:159](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L159)
Complete CRT effect combining curvature, scanlines, and mask.
## Param
Source texture
## Param
UV coordinates
## Param
CRT effect options
## Properties
### bloomIntensity?
> `optional` **bloomIntensity?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:169](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L169)
Phosphor bloom intensity (default: 0.2)
***
### colorBleed?
> `optional` **colorBleed?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:171](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L171)
Color bleed amount (default: 0.001)
***
### curvature?
> `optional` **curvature?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:161](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L161)
Barrel curvature amount (default: 0.1)
***
### scanlineIntensity?
> `optional` **scanlineIntensity?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:163](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L163)
Scanline intensity (default: 0.2)
***
### scanlineRes?
> `optional` **scanlineRes?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:165](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L165)
Scanline resolution (default: 240)
***
### vignetteIntensity?
> `optional` **vignetteIntensity?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/display/crtEffects.ts:167](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/display/crtEffects.ts#L167)
Vignette intensity (default: 0.3)
# DissolveOptions
Defined in: [packages/nodes/src/alpha/dissolve.ts:6](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L6)
## Properties
### edgeColor?
> `optional` **edgeColor?**: [`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Defined in: [packages/nodes/src/alpha/dissolve.ts:12](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L12)
Edge glow color as [r, g, b] (default: [1, 0.5, 0] = orange)
***
### edgeWidth?
> `optional` **edgeWidth?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/alpha/dissolve.ts:14](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L14)
Width of the glowing edge (default: 0.1)
***
### noiseScale?
> `optional` **noiseScale?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/alpha/dissolve.ts:16](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L16)
Scale of noise UV (default: 1)
***
### noiseTex
> **noiseTex**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)
Defined in: [packages/nodes/src/alpha/dissolve.ts:10](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L10)
Noise texture for dissolve pattern
***
### progress
> **progress**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/alpha/dissolve.ts:8](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/alpha/dissolve.ts#L8)
Dissolve progress (0 = fully visible, 1 = fully dissolved)
# Light2DResult
Defined in: [packages/nodes/src/lighting/lights.ts:9](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L9)
Light data structure returned by light calculation nodes.
Contains direction, intensity, and attenuation for use in lighting calculations.
## Properties
### attenuation
> **attenuation**: [`Node`](https://threejs.org/docs/)\<`"float"`\>
Defined in: [packages/nodes/src/lighting/lights.ts:15](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L15)
Distance attenuation factor (0-1)
***
### color
> **color**: [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/lights.ts:13](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L13)
Light color multiplied by intensity
***
### direction
> **direction**: [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/lighting/lights.ts:11](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lights.ts#L11)
Direction from surface to light (normalized vec3)
# LitSpriteOptions
Defined in: [packages/nodes/src/lighting/lit.ts:263](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L263)
Combined sprite lighting with diffuse, specular, and optional rim.
Convenience function that combines common lighting components.
## Param
Surface normal
## Param
Base surface color
## Param
Light result from pointLight2D, directionalLight2D, etc.
## Param
Ambient light result
## Param
Additional lighting options
## Example
```ts
const lit = litSprite(normal, inputColor, pointLight, ambient, {
specular: true,
shininess: 32,
rim: true,
rimColor: [0.5, 0.8, 1]
})
```
## Properties
### rim?
> `optional` **rim?**: `boolean`
Defined in: [packages/nodes/src/lighting/lit.ts:271](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L271)
Enable rim lighting
***
### rimColor?
> `optional` **rimColor?**: [`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Defined in: [packages/nodes/src/lighting/lit.ts:273](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L273)
Rim light color
***
### rimPower?
> `optional` **rimPower?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/lighting/lit.ts:275](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L275)
Rim power (default: 2)
***
### rimStrength?
> `optional` **rimStrength?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/lighting/lit.ts:277](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L277)
Rim strength (default: 1)
***
### shininess?
> `optional` **shininess?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/lighting/lit.ts:267](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L267)
Specular shininess (default: 32)
***
### specular?
> `optional` **specular?**: `boolean`
Defined in: [packages/nodes/src/lighting/lit.ts:265](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L265)
Enable specular highlights
***
### specularStrength?
> `optional` **specularStrength?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/lighting/lit.ts:269](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L269)
Specular strength (default: 0.5)
***
### viewDir?
> `optional` **viewDir?**: [`Vec3Input`](/three-flatland/api/nodes/src/type-aliases/vec3input/)
Defined in: [packages/nodes/src/lighting/lit.ts:279](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/lighting/lit.ts#L279)
View direction for specular/rim (default: [0, 0, 1])
# OutlineOptions
Defined in: [packages/nodes/src/sprite/outline.ts:6](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L6)
## Properties
### color?
> `optional` **color?**: [`Vec4Input`](/three-flatland/api/nodes/src/type-aliases/vec4input/)
Defined in: [packages/nodes/src/sprite/outline.ts:8](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L8)
Outline color as [r, g, b, a] (0-1 range) or vec4 node
***
### textureSize?
> `optional` **textureSize?**: [`Node`](https://threejs.org/docs/)\<`"vec2"`\> \| \[`number`, `number`\]
Defined in: [packages/nodes/src/sprite/outline.ts:12](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L12)
Texture size for proper UV offset calculation as [width, height]
***
### thickness?
> `optional` **thickness?**: [`FloatInput`](/three-flatland/api/nodes/src/type-aliases/floatinput/)
Defined in: [packages/nodes/src/sprite/outline.ts:10](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/sprite/outline.ts#L10)
Outline thickness in UV space (default: 0.01)
# ColorInput
> **ColorInput** = `number` \| \[`number`, `number`, `number`\] \| [`Node`](https://threejs.org/docs/)\<`"color"`\> \| [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/types.ts:26](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/types.ts#L26)
Color input type - accepts hex, RGB tuple, or color/vec3 Node
# FloatInput
> **FloatInput** = `number` \| [`Node`](https://threejs.org/docs/)\<`"float"`\>
Defined in: [packages/nodes/src/types.ts:6](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/types.ts#L6)
Input that can be either a literal number or a float Node.
# Vec2Input
> **Vec2Input** = \[`number`, `number`\] \| [`Node`](https://threejs.org/docs/)\<`"vec2"`\>
Defined in: [packages/nodes/src/types.ts:11](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/types.ts#L11)
Vec2 input type - accepts tuple or vec2 Node
# Vec3Input
> **Vec3Input** = \[`number`, `number`, `number`\] \| [`Node`](https://threejs.org/docs/)\<`"vec3"`\>
Defined in: [packages/nodes/src/types.ts:16](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/types.ts#L16)
Vec3 input type - accepts tuple or vec3 Node
# Vec4Input
> **Vec4Input** = \[`number`, `number`, `number`, `number`\] \| [`Node`](https://threejs.org/docs/)\<`"vec4"`\>
Defined in: [packages/nodes/src/types.ts:21](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/nodes/src/types.ts#L21)
Vec4 input type - accepts tuple or vec4 Node
# presets/src
## Variables
- [DefaultLightEffect](/three-flatland/api/presets/src/variables/defaultlighteffect/)
- [NormalMapProvider](/three-flatland/api/presets/src/variables/normalmapprovider/)
# DefaultLightEffect
> `const` **DefaultLightEffect**: `DefaultLightEffectClass`
Defined in: [packages/presets/src/lighting/DefaultLightEffect.ts:493](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/presets/src/lighting/DefaultLightEffect.ts#L493)
# NormalMapProvider
> `const` **NormalMapProvider**: [`MaterialEffectClass`](/three-flatland/api/three-flatland/src/type-aliases/materialeffectclass/)\<\{ `normalMap`: () => [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`; \}\>
Defined in: [packages/presets/src/lighting/NormalMapProvider.ts:36](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/presets/src/lighting/NormalMapProvider.ts#L36)
Provides the 'normal' and 'elevation' channels from a pre-baked
normal atlas.
Atlas encoding (see `@three-flatland/normals/bakeNormalMap`):
R = nx ∈ [-1, 1] → mapped from [0, 255]
G = ny ∈ [-1, 1] → mapped from [0, 255]
B = elevation ∈ [0, 1] → mapped from [0, 255]
A = source alpha
The provider reconstructs `nz = sqrt(max(0, 1 − nx² − ny²))` at
runtime — outward-facing tangent-space convention means nz ≥ 0 always,
so the sign is implicit and one texture channel is freed for elevation.
Instance-flip correction: sampled `normal.xy` is multiplied by the
existing `instanceFlip` attribute so a `flipX`/`flipY` sprite responds
to lights from the geometrically-correct side.
Elevation drives `DefaultLightEffect`'s per-fragment light direction
(`L.z = lightHeight − elevation`). Different normalMap textures
produce different materials and therefore different batches.
## Example
```typescript
import { NormalMapProvider } from '@three-flatland/presets'
const provider = new NormalMapProvider()
provider.normalMap = myNormalMapTexture
sprite.addEffect(provider)
```
# three-flatland/src
## Classes
- [AnimatedSprite2D](/three-flatland/api/three-flatland/src/classes/animatedsprite2d/)
- [AnimationController](/three-flatland/api/three-flatland/src/classes/animationcontroller/)
- [EffectMaterial](/three-flatland/api/three-flatland/src/classes/effectmaterial/)
- [Flatland](/three-flatland/api/three-flatland/src/classes/flatland/)
- [ForwardPlusLighting](/three-flatland/api/three-flatland/src/classes/forwardpluslighting/)
- [GlobalUniforms](/three-flatland/api/three-flatland/src/classes/globaluniforms/)
- [Layer](/three-flatland/api/three-flatland/src/classes/layer/)
- [LDtkLoader](/three-flatland/api/three-flatland/src/classes/ldtkloader/)
- [Light2D](/three-flatland/api/three-flatland/src/classes/light2d/)
- [LightEffect](/three-flatland/api/three-flatland/src/classes/lighteffect/)
- [MaterialEffect](/three-flatland/api/three-flatland/src/classes/materialeffect/)
- [PassEffect](/three-flatland/api/three-flatland/src/classes/passeffect/)
- [Sprite2D](/three-flatland/api/three-flatland/src/classes/sprite2d/)
- [Sprite2DMaterial](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/)
- [SpriteGroup](/three-flatland/api/three-flatland/src/classes/spritegroup/)
- [SpriteSheetLoader](/three-flatland/api/three-flatland/src/classes/spritesheetloader/)
- [TextureConfig](/three-flatland/api/three-flatland/src/classes/textureconfig/)
- [TextureLoader](/three-flatland/api/three-flatland/src/classes/textureloader/)
- [TiledLoader](/three-flatland/api/three-flatland/src/classes/tiledloader/)
- [TileLayer](/three-flatland/api/three-flatland/src/classes/tilelayer/)
- [TileMap2D](/three-flatland/api/three-flatland/src/classes/tilemap2d/)
- [Tileset](/three-flatland/api/three-flatland/src/classes/tileset/)
## Interfaces
- [AnimatedSprite2DOptions](/three-flatland/api/three-flatland/src/interfaces/animatedsprite2doptions/)
- [Animation](/three-flatland/api/three-flatland/src/interfaces/animation/)
- [AnimationFrame](/three-flatland/api/three-flatland/src/interfaces/animationframe/)
- [AnimationSetDefinition](/three-flatland/api/three-flatland/src/interfaces/animationsetdefinition/)
- [AnimationState](/three-flatland/api/three-flatland/src/interfaces/animationstate/)
- [BatchKey](/three-flatland/api/three-flatland/src/interfaces/batchkey/)
- [ChannelNodeContext](/three-flatland/api/three-flatland/src/interfaces/channelnodecontext/)
- [ChannelNodeMap](/three-flatland/api/three-flatland/src/interfaces/channelnodemap/)
- [ChunkCoord](/three-flatland/api/three-flatland/src/interfaces/chunkcoord/)
- [ColorTransformContext](/three-flatland/api/three-flatland/src/interfaces/colortransformcontext/)
- [DevtoolsProviderHandle](/three-flatland/api/three-flatland/src/interfaces/devtoolsproviderhandle/)
- [EffectField](/three-flatland/api/three-flatland/src/interfaces/effectfield/)
- [EffectMaterialOptions](/three-flatland/api/three-flatland/src/interfaces/effectmaterialoptions/)
- [EffectNodeContext](/three-flatland/api/three-flatland/src/interfaces/effectnodecontext/)
- [FlatlandOptions](/three-flatland/api/three-flatland/src/interfaces/flatlandoptions/)
- [InstanceAttributeConfig](/three-flatland/api/three-flatland/src/interfaces/instanceattributeconfig/)
- [LayerConfig](/three-flatland/api/three-flatland/src/interfaces/layerconfig/)
- [LDtkLoaderOptions](/three-flatland/api/three-flatland/src/interfaces/ldtkloaderoptions/)
- [Light2DOptions](/three-flatland/api/three-flatland/src/interfaces/light2doptions/)
- [Light2DUniforms](/three-flatland/api/three-flatland/src/interfaces/light2duniforms/)
- [LightEffectBuildContext](/three-flatland/api/three-flatland/src/interfaces/lighteffectbuildcontext/)
- [LightEffectRuntimeContext](/three-flatland/api/three-flatland/src/interfaces/lighteffectruntimecontext/)
- [NormalRegion](/three-flatland/api/three-flatland/src/interfaces/normalregion/)
- [NormalSourceDescriptor](/three-flatland/api/three-flatland/src/interfaces/normalsourcedescriptor/)
- [ObjectLayerData](/three-flatland/api/three-flatland/src/interfaces/objectlayerdata/)
- [OcclusionPassOptions](/three-flatland/api/three-flatland/src/interfaces/occlusionpassoptions/)
- [PassEffectContext](/three-flatland/api/three-flatland/src/interfaces/passeffectcontext/)
- [PlayOptions](/three-flatland/api/three-flatland/src/interfaces/playoptions/)
- [RenderStats](/three-flatland/api/three-flatland/src/interfaces/renderstats/)
- [Sprite2DMaterialOptions](/three-flatland/api/three-flatland/src/interfaces/sprite2dmaterialoptions/)
- [Sprite2DOptions](/three-flatland/api/three-flatland/src/interfaces/sprite2doptions/)
- [SpriteFrame](/three-flatland/api/three-flatland/src/interfaces/spriteframe/)
- [SpriteFrameRect](/three-flatland/api/three-flatland/src/interfaces/spriteframerect/)
- [SpriteGroupOptions](/three-flatland/api/three-flatland/src/interfaces/spritegroupoptions/)
- [SpriteSheet](/three-flatland/api/three-flatland/src/interfaces/spritesheet/)
- [SpriteSheetJSONArray](/three-flatland/api/three-flatland/src/interfaces/spritesheetjsonarray/)
- [SpriteSheetJSONHash](/three-flatland/api/three-flatland/src/interfaces/spritesheetjsonhash/)
- [SpriteSheetLoaderOptions](/three-flatland/api/three-flatland/src/interfaces/spritesheetloaderoptions/)
- [TextureLoaderOptions](/three-flatland/api/three-flatland/src/interfaces/textureloaderoptions/)
- [TextureOptions](/three-flatland/api/three-flatland/src/interfaces/textureoptions/)
- [TileAnimationFrame](/three-flatland/api/three-flatland/src/interfaces/tileanimationframe/)
- [TileDefinition](/three-flatland/api/three-flatland/src/interfaces/tiledefinition/)
- [TiledLoaderOptions](/three-flatland/api/three-flatland/src/interfaces/tiledloaderoptions/)
- [TileInstance](/three-flatland/api/three-flatland/src/interfaces/tileinstance/)
- [TileLayerData](/three-flatland/api/three-flatland/src/interfaces/tilelayerdata/)
- [TileLayerOptions](/three-flatland/api/three-flatland/src/interfaces/tilelayeroptions/)
- [TileMap2DOptions](/three-flatland/api/three-flatland/src/interfaces/tilemap2doptions/)
- [TileMapData](/three-flatland/api/three-flatland/src/interfaces/tilemapdata/)
- [TileMapObject](/three-flatland/api/three-flatland/src/interfaces/tilemapobject/)
- [TileNormalCustomData](/three-flatland/api/three-flatland/src/interfaces/tilenormalcustomdata/)
- [TilesetCell](/three-flatland/api/three-flatland/src/interfaces/tilesetcell/)
- [TilesetData](/three-flatland/api/three-flatland/src/interfaces/tilesetdata/)
## Type Aliases
- [BlendMode](/three-flatland/api/three-flatland/src/type-aliases/blendmode/)
- [ChannelName](/three-flatland/api/three-flatland/src/type-aliases/channelname/)
- [CollisionShape](/three-flatland/api/three-flatland/src/type-aliases/collisionshape/)
- [ColorTransformFn](/three-flatland/api/three-flatland/src/type-aliases/colortransformfn/)
- [EffectConstants](/three-flatland/api/three-flatland/src/type-aliases/effectconstants/)
- [EffectSchema](/three-flatland/api/three-flatland/src/type-aliases/effectschema/)
- [EffectSchemaValue](/three-flatland/api/three-flatland/src/type-aliases/effectschemavalue/)
- [EffectValues](/three-flatland/api/three-flatland/src/type-aliases/effectvalues/)
- [InstanceAttributeType](/three-flatland/api/three-flatland/src/type-aliases/instanceattributetype/)
- [LayerName](/three-flatland/api/three-flatland/src/type-aliases/layername/)
- [LayerType](/three-flatland/api/three-flatland/src/type-aliases/layertype/)
- [LayerValue](/three-flatland/api/three-flatland/src/type-aliases/layervalue/)
- [Light2DType](/three-flatland/api/three-flatland/src/type-aliases/light2dtype/)
- [LightEffectClass](/three-flatland/api/three-flatland/src/type-aliases/lighteffectclass/)
- [MaterialEffectClass](/three-flatland/api/three-flatland/src/type-aliases/materialeffectclass/)
- [NormalBump](/three-flatland/api/three-flatland/src/type-aliases/normalbump/)
- [NormalDirection](/three-flatland/api/three-flatland/src/type-aliases/normaldirection/)
- [ObservableStrategy](/three-flatland/api/three-flatland/src/type-aliases/observablestrategy/)
- [PassEffectClass](/three-flatland/api/three-flatland/src/type-aliases/passeffectclass/)
- [PassEffectFn](/three-flatland/api/three-flatland/src/type-aliases/passeffectfn/)
- [Snapshot](/three-flatland/api/three-flatland/src/type-aliases/snapshot/)
- [SortMode](/three-flatland/api/three-flatland/src/type-aliases/sortmode/)
- [SpriteSortFunction](/three-flatland/api/three-flatland/src/type-aliases/spritesortfunction/)
- [TexturePreset](/three-flatland/api/three-flatland/src/type-aliases/texturepreset/)
- [TileLookupFn](/three-flatland/api/three-flatland/src/type-aliases/tilelookupfn/)
- [UniformKeys](/three-flatland/api/three-flatland/src/type-aliases/uniformkeys/)
- [WithRequiredChannels](/three-flatland/api/three-flatland/src/type-aliases/withrequiredchannels/)
## Variables
- [channelDefaults](/three-flatland/api/three-flatland/src/variables/channeldefaults/)
- [DEFAULT\_BATCH\_SIZE](/three-flatland/api/three-flatland/src/variables/default_batch_size/)
- [EFFECT\_BIT\_OFFSET](/three-flatland/api/three-flatland/src/variables/effect_bit_offset/)
- [Layers](/three-flatland/api/three-flatland/src/variables/layers/)
- [LIT\_FLAG\_MASK](/three-flatland/api/three-flatland/src/variables/lit_flag_mask/)
- [MAX\_LIGHTS\_PER\_TILE](/three-flatland/api/three-flatland/src/variables/max_lights_per_tile/)
- [observable](/three-flatland/api/three-flatland/src/variables/observable/)
- [RECEIVE\_SHADOWS\_MASK](/three-flatland/api/three-flatland/src/variables/receive_shadows_mask/)
- [TEXTURE\_PRESETS](/three-flatland/api/three-flatland/src/variables/texture_presets/)
- [TILE\_SIZE](/three-flatland/api/three-flatland/src/variables/tile_size/)
- [VERSION](/three-flatland/api/three-flatland/src/variables/version/)
## Functions
- [applyHierarchicalPresets](/three-flatland/api/three-flatland/src/functions/applyhierarchicalpresets/)
- [applyTextureOptions](/three-flatland/api/three-flatland/src/functions/applytextureoptions/)
- [computeTier](/three-flatland/api/three-flatland/src/functions/computetier/)
- [concatAnimations](/three-flatland/api/three-flatland/src/functions/concatanimations/)
- [createAnimation](/three-flatland/api/three-flatland/src/functions/createanimation/)
- [createAnimationFromPattern](/three-flatland/api/three-flatland/src/functions/createanimationfrompattern/)
- [createAnimationsFromNaming](/three-flatland/api/three-flatland/src/functions/createanimationsfromnaming/)
- [createDevtoolsProvider](/three-flatland/api/three-flatland/src/functions/createdevtoolsprovider/)
- [createLightEffect](/three-flatland/api/three-flatland/src/functions/createlighteffect/)
- [createMaterialEffect](/three-flatland/api/three-flatland/src/functions/creatematerialeffect/)
- [createPassEffect](/three-flatland/api/three-flatland/src/functions/createpasseffect/)
- [decodeSortKey](/three-flatland/api/three-flatland/src/functions/decodesortkey/)
- [encodeSortKey](/three-flatland/api/three-flatland/src/functions/encodesortkey/)
- [framesToRegions](/three-flatland/api/three-flatland/src/functions/framestoregions/)
- [getPackedComponent](/three-flatland/api/three-flatland/src/functions/getpackedcomponent/)
- [isDevtoolsActive](/three-flatland/api/three-flatland/src/functions/isdevtoolsactive/)
- [isLight2D](/three-flatland/api/three-flatland/src/functions/islight2d/)
- [readCastShadowFlag](/three-flatland/api/three-flatland/src/functions/readcastshadowflag/)
- [readEnableBits](/three-flatland/api/three-flatland/src/functions/readenablebits/)
- [readFlip](/three-flatland/api/three-flatland/src/functions/readflip/)
- [readLitFlag](/three-flatland/api/three-flatland/src/functions/readlitflag/)
- [readReceiveShadowsFlag](/three-flatland/api/three-flatland/src/functions/readreceiveshadowsflag/)
- [readShadowRadius](/three-flatland/api/three-flatland/src/functions/readshadowradius/)
- [readSystemFlags](/three-flatland/api/three-flatland/src/functions/readsystemflags/)
- [registerDebugArray](/three-flatland/api/three-flatland/src/functions/registerdebugarray/)
- [registerDebugTexture](/three-flatland/api/three-flatland/src/functions/registerdebugtexture/)
- [resolveTextureOptions](/three-flatland/api/three-flatland/src/functions/resolvetextureoptions/)
- [reverseAnimation](/three-flatland/api/three-flatland/src/functions/reverseanimation/)
- [shallowEqual](/three-flatland/api/three-flatland/src/functions/shallowequal/)
- [tilesetToRegions](/three-flatland/api/three-flatland/src/functions/tilesettoregions/)
- [tileToRegions](/three-flatland/api/three-flatland/src/functions/tiletoregions/)
- [touchDebugArray](/three-flatland/api/three-flatland/src/functions/touchdebugarray/)
- [touchDebugTexture](/three-flatland/api/three-flatland/src/functions/touchdebugtexture/)
- [unregisterDebugArray](/three-flatland/api/three-flatland/src/functions/unregisterdebugarray/)
- [unregisterDebugTexture](/three-flatland/api/three-flatland/src/functions/unregisterdebugtexture/)
- [uvToWorld](/three-flatland/api/three-flatland/src/functions/uvtoworld/)
- [wholeTextureRegion](/three-flatland/api/three-flatland/src/functions/wholetextureregion/)
- [worldToUV](/three-flatland/api/three-flatland/src/functions/worldtouv/)
- [wrapWithLightFlags](/three-flatland/api/three-flatland/src/functions/wrapwithlightflags/)
# AnimatedSprite2D
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:66](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L66)
A 2D sprite with animation support.
## Example
```typescript
const player = new AnimatedSprite2D({
spriteSheet: sheet,
animationSet: {
animations: {
idle: { frames: ['player_idle_0', 'player_idle_1'], fps: 8 },
walk: { frames: ['player_walk_0', 'player_walk_1', 'player_walk_2'], fps: 12 },
}
},
animation: 'idle',
});
// In update loop
player.update(deltaMs);
// Change animation
player.play('walk');
```
## Extends
- [`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/)
## Constructors
### Constructor
> **new AnimatedSprite2D**(`options?`): `AnimatedSprite2D`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:77](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L77)
Create a new AnimatedSprite2D.
Can be called with no arguments for R3F compatibility - set spriteSheet via property.
#### Parameters
##### options?
[`AnimatedSprite2DOptions`](/three-flatland/api/three-flatland/src/interfaces/animatedsprite2doptions/)
#### Returns
`AnimatedSprite2D`
#### Overrides
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`constructor`](/three-flatland/api/three-flatland/src/classes/sprite2d/#constructor)
## Properties
### \_idx
> **\_idx**: `number` = `0`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:287](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L287)
Index into the backing arrays (0 when standalone, eid when enrolled).
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`_idx`](/three-flatland/api/three-flatland/src/classes/sprite2d/#_idx)
***
### animations
> **animations**: [`AnimationClip`](https://threejs.org/docs/)[]
Defined in: [three.js/core/Object3D:animations](https://threejs.org/docs/#api/en/core/Object3D.animations)
Array with object's animation clips.
#### Default Value
`[]`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`animations`](/three-flatland/api/three-flatland/src/classes/sprite2d/#animations)
***
### castShadow
> **castShadow**: `boolean`
Defined in: [three.js/core/Object3D:castShadow](https://threejs.org/docs/#api/en/core/Object3D.castShadow)
Whether the object gets rendered into shadow map.
#### Default Value
`false`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`castShadow`](/three-flatland/api/three-flatland/src/classes/sprite2d/#castshadow)
***
### children
> **children**: [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
Defined in: [three.js/core/Object3D:children](https://threejs.org/docs/#api/en/core/Object3D.children)
Array with object's children.
#### See
THREE.Object3DGroup \| Group for info on manually grouping objects.
#### Default Value
`[]`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`children`](/three-flatland/api/three-flatland/src/classes/sprite2d/#children)
***
### controller
> `readonly` **controller**: [`AnimationController`](/three-flatland/api/three-flatland/src/classes/animationcontroller/)
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:68](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L68)
Animation controller
***
### count
> **count**: `number`
Defined in: [three.js/objects/Mesh:count](https://threejs.org/docs/#api/en/objects/Mesh.count)
The number of instances of this mesh.
Can only be used with WebGPURenderer.
#### Default
```ts
1
```
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`count`](/three-flatland/api/three-flatland/src/classes/sprite2d/#count)
***
### customDepthMaterial?
> `optional` **customDepthMaterial?**: [`Material`](https://threejs.org/docs/#api/en/materials/Material)
Defined in: [three.js/core/Object3D:customDepthMaterial](https://threejs.org/docs/#api/en/core/Object3D.customDepthMaterial)
Custom depth material to be used when rendering to the depth map.
#### Remarks
Can only be used in context of meshes.
When shadow-casting with a THREE.DirectionalLight \| DirectionalLight or THREE.SpotLight \| SpotLight,
if you are modifying vertex positions in the vertex shader you must specify a customDepthMaterial for proper shadows.
#### Default Value
`undefined`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`customDepthMaterial`](/three-flatland/api/three-flatland/src/classes/sprite2d/#customdepthmaterial)
***
### customDistanceMaterial?
> `optional` **customDistanceMaterial?**: [`Material`](https://threejs.org/docs/#api/en/materials/Material)
Defined in: [three.js/core/Object3D:customDistanceMaterial](https://threejs.org/docs/#api/en/core/Object3D.customDistanceMaterial)
Same as [customDepthMaterial](/three-flatland/api/three-flatland/src/classes/flatland/#customdepthmaterial), but used with THREE.Object3DPointLight \| PointLight.
#### Default Value
`undefined`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`customDistanceMaterial`](/three-flatland/api/three-flatland/src/classes/sprite2d/#customdistancematerial)
***
### frustumCulled
> **frustumCulled**: `boolean`
Defined in: [three.js/core/Object3D:frustumCulled](https://threejs.org/docs/#api/en/core/Object3D.frustumCulled)
When this is set, it checks every frame if the object is in the frustum of the camera before rendering the object.
If set to `false` the object gets rendered every frame even if it is not in the frustum of the camera.
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`frustumCulled`](/three-flatland/api/three-flatland/src/classes/sprite2d/#frustumculled)
***
### geometry
> **geometry**: [`PlaneGeometry`](https://threejs.org/docs/#api/en/geometries/PlaneGeometry)
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:81](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L81)
An instance of THREE.BufferGeometry \| BufferGeometry (or derived classes), defining the object's structure.
#### Default Value
THREE.BufferGeometry \| \`new THREE.BufferGeometry()\`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`geometry`](/three-flatland/api/three-flatland/src/classes/sprite2d/#geometry)
***
### id
> `readonly` **id**: `number`
Defined in: [three.js/core/Object3D:id](https://threejs.org/docs/#api/en/core/Object3D.id)
Unique number for this [Object3D](https://threejs.org/docs/#api/en/core/Object3D) instance.
#### Remarks
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
Expects a `Integer`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`id`](/three-flatland/api/three-flatland/src/classes/sprite2d/#id)
***
### isMesh
> `readonly` **isMesh**: `true`
Defined in: [three.js/objects/Mesh:isMesh](https://threejs.org/docs/#api/en/objects/Mesh.isMesh)
Read-only flag to check if a given object is of type [Mesh](https://threejs.org/docs/#api/en/objects/Mesh).
#### Remarks
This is a _constant_ value
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`isMesh`](/three-flatland/api/three-flatland/src/classes/sprite2d/#ismesh)
***
### isObject3D
> `readonly` **isObject3D**: `true`
Defined in: [three.js/core/Object3D:isObject3D](https://threejs.org/docs/#api/en/core/Object3D.isObject3D)
Flag to check if a given object is of type [Object3D](https://threejs.org/docs/#api/en/core/Object3D).
#### Remarks
This is a _constant_ value
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`isObject3D`](/three-flatland/api/three-flatland/src/classes/sprite2d/#isobject3d)
***
### layers
> **layers**: [`Layers`](https://threejs.org/docs/#api/en/core/Layers)
Defined in: [three.js/core/Object3D:layers](https://threejs.org/docs/#api/en/core/Object3D.layers)
The layer membership of the object.
#### Remarks
The object is only visible if it has at least one layer in common with the THREE.Object3DCamera \| Camera in use.
This property can also be used to filter out unwanted objects in ray-intersection tests when using THREE.Raycaster \| Raycaster.
#### Default Value
`new THREE.Layers()`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`layers`](/three-flatland/api/three-flatland/src/classes/sprite2d/#layers)
***
### material
> **material**: [`Sprite2DMaterial`](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/)
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:82](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L82)
An instance of material derived from the THREE.Material \| Material base class or an array of materials, defining the object's appearance.
#### Default Value
THREE.MeshBasicMaterial \| \`new THREE.MeshBasicMaterial()\`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`material`](/three-flatland/api/three-flatland/src/classes/sprite2d/#material)
***
### matrix
> **matrix**: [`Matrix4`](https://threejs.org/docs/#api/en/math/Matrix4)
Defined in: [three.js/core/Object3D:matrix](https://threejs.org/docs/#api/en/core/Object3D.matrix)
The local transform matrix.
#### Default Value
`new THREE.Matrix4()`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`matrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#matrix)
***
### matrixAutoUpdate
> **matrixAutoUpdate**: `boolean`
Defined in: [three.js/core/Object3D:matrixAutoUpdate](https://threejs.org/docs/#api/en/core/Object3D.matrixAutoUpdate)
When this is set, it calculates the matrix of position, (rotation or quaternion) and
scale every frame and also recalculates the matrixWorld property.
#### Default Value
[DEFAULT\_MATRIX\_AUTO\_UPDATE](/three-flatland/api/three-flatland/src/classes/flatland/#default_matrix_auto_update) - that is `(true)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`matrixAutoUpdate`](/three-flatland/api/three-flatland/src/classes/sprite2d/#matrixautoupdate)
***
### matrixWorld
> **matrixWorld**: [`Matrix4`](https://threejs.org/docs/#api/en/math/Matrix4)
Defined in: [three.js/core/Object3D:matrixWorld](https://threejs.org/docs/#api/en/core/Object3D.matrixWorld)
The global transform of the object.
#### Remarks
If the [Object3D](https://threejs.org/docs/#api/en/core/Object3D) has no parent, then it's identical to the local transform THREE.Object3D.matrix \| .matrix.
#### Default Value
`new THREE.Matrix4()`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`matrixWorld`](/three-flatland/api/three-flatland/src/classes/sprite2d/#matrixworld)
***
### matrixWorldAutoUpdate
> **matrixWorldAutoUpdate**: `boolean`
Defined in: [three.js/core/Object3D:matrixWorldAutoUpdate](https://threejs.org/docs/#api/en/core/Object3D.matrixWorldAutoUpdate)
If set, then the renderer checks every frame if the object and its children need matrix updates.
When it isn't, then you have to maintain all matrices in the object and its children yourself.
#### Default Value
[DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE](/three-flatland/api/three-flatland/src/classes/flatland/#default_matrix_world_auto_update) - that is `(true)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`matrixWorldAutoUpdate`](/three-flatland/api/three-flatland/src/classes/sprite2d/#matrixworldautoupdate)
***
### matrixWorldNeedsUpdate
> **matrixWorldNeedsUpdate**: `boolean`
Defined in: [three.js/core/Object3D:matrixWorldNeedsUpdate](https://threejs.org/docs/#api/en/core/Object3D.matrixWorldNeedsUpdate)
When this is set, it calculates the matrixWorld in that frame and resets this property to false.
#### Default Value
`false`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`matrixWorldNeedsUpdate`](/three-flatland/api/three-flatland/src/classes/sprite2d/#matrixworldneedsupdate)
***
### modelViewMatrix
> `readonly` **modelViewMatrix**: [`Matrix4`](https://threejs.org/docs/#api/en/math/Matrix4)
Defined in: [three.js/core/Object3D:modelViewMatrix](https://threejs.org/docs/#api/en/core/Object3D.modelViewMatrix)
#### Default Value
`new THREE.Matrix4()`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`modelViewMatrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#modelviewmatrix)
***
### morphTargetDictionary?
> `optional` **morphTargetDictionary?**: `object`
Defined in: [three.js/objects/Mesh:morphTargetDictionary](https://threejs.org/docs/#api/en/objects/Mesh.morphTargetDictionary)
A dictionary of morphTargets based on the `morphTarget.name` property.
#### Index Signature
\[`key`: `string`\]: `number`
#### Default Value
`undefined`, _but rebuilt by [.updateMorphTargets()](https://threejs.org/docs/)._
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`morphTargetDictionary`](/three-flatland/api/three-flatland/src/classes/sprite2d/#morphtargetdictionary)
***
### morphTargetInfluences?
> `optional` **morphTargetInfluences?**: `number`[]
Defined in: [three.js/objects/Mesh:morphTargetInfluences](https://threejs.org/docs/#api/en/objects/Mesh.morphTargetInfluences)
An array of weights typically from `0-1` that specify how much of the morph is applied.
#### Default Value
`undefined`, _but reset to a blank array by [.updateMorphTargets()](https://threejs.org/docs/)._
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`morphTargetInfluences`](/three-flatland/api/three-flatland/src/classes/sprite2d/#morphtargetinfluences)
***
### name
> **name**: `string`
Defined in: [three.js/core/Object3D:name](https://threejs.org/docs/#api/en/core/Object3D.name)
Optional name of the object
#### Remarks
_(doesn't need to be unique)_.
#### Default Value
`""`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`name`](/three-flatland/api/three-flatland/src/classes/sprite2d/#name)
***
### normalMatrix
> `readonly` **normalMatrix**: [`Matrix3`](https://threejs.org/docs/#api/en/math/Matrix3)
Defined in: [three.js/core/Object3D:normalMatrix](https://threejs.org/docs/#api/en/core/Object3D.normalMatrix)
#### Default Value
`new THREE.Matrix3()`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`normalMatrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#normalmatrix)
***
### occlusionTest?
> `optional` **occlusionTest?**: `boolean`
Defined in: [three.js/renderers/common/Backend:occlusionTest](https://threejs.org/docs/#api/en/renderers/common/Backend.occlusionTest)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`occlusionTest`](/three-flatland/api/three-flatland/src/classes/sprite2d/#occlusiontest)
***
### parent
> **parent**: [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `null`
Defined in: [three.js/core/Object3D:parent](https://threejs.org/docs/#api/en/core/Object3D.parent)
Object's parent in the [scene graph](https://en.wikipedia.org/wiki/Scene_graph).
#### Remarks
An object can have at most one parent.
#### Default Value
`null`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`parent`](/three-flatland/api/three-flatland/src/classes/sprite2d/#parent)
***
### pivot
> **pivot**: [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3) \| `null`
Defined in: [three.js/core/Object3D:pivot](https://threejs.org/docs/#api/en/core/Object3D.pivot)
The pivot point for rotation and scale transformations.
When set, rotation and scale are applied around this point
instead of the object's origin.
#### Default
```ts
null
```
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`pivot`](/three-flatland/api/three-flatland/src/classes/sprite2d/#pivot)
***
### pixelPerfect
> **pixelPerfect**: `boolean` = `false`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:106](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L106)
Pixel-perfect mode
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`pixelPerfect`](/three-flatland/api/three-flatland/src/classes/sprite2d/#pixelperfect)
***
### position
> `readonly` **position**: [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:position](https://threejs.org/docs/#api/en/core/Object3D.position)
Object's local position.
#### Default Value
`new THREE.Vector3()` - that is `(0, 0, 0)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`position`](/three-flatland/api/three-flatland/src/classes/sprite2d/#position)
***
### quaternion
> `readonly` **quaternion**: [`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
Defined in: [three.js/core/Object3D:quaternion](https://threejs.org/docs/#api/en/core/Object3D.quaternion)
Object's local rotation as a THREE.Quaternion \| Quaternion.
#### Default Value
`new THREE.Quaternion()` - that is `(0, 0, 0, 1)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`quaternion`](/three-flatland/api/three-flatland/src/classes/sprite2d/#quaternion)
***
### receiveShadow
> **receiveShadow**: `boolean`
Defined in: [three.js/core/Object3D:receiveShadow](https://threejs.org/docs/#api/en/core/Object3D.receiveShadow)
Whether the material receives shadows.
#### Default Value
`false`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`receiveShadow`](/three-flatland/api/three-flatland/src/classes/sprite2d/#receiveshadow)
***
### renderOrder
> **renderOrder**: `number`
Defined in: [three.js/core/Object3D:renderOrder](https://threejs.org/docs/#api/en/core/Object3D.renderOrder)
This value allows the default rendering order of [scene graph](https://en.wikipedia.org/wiki/Scene_graph)
objects to be overridden although opaque and transparent objects remain sorted independently.
#### Remarks
When this property is set for an instance of [Group](https://threejs.org/docs/#api/en/objects/Group), all descendants objects will be sorted and rendered together.
Sorting is from lowest to highest renderOrder.
#### Default Value
`0`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`renderOrder`](/three-flatland/api/three-flatland/src/classes/sprite2d/#renderorder)
***
### rotation
> `readonly` **rotation**: [`Euler`](https://threejs.org/docs/#api/en/math/Euler)
Defined in: [three.js/core/Object3D:rotation](https://threejs.org/docs/#api/en/core/Object3D.rotation)
Object's local rotation ([Euler angles](https://en.wikipedia.org/wiki/Euler_angles)), in radians.
#### Default Value
`new THREE.Euler()` - that is `(0, 0, 0, Euler.DEFAULT_ORDER)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotation`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotation)
***
### scale
> `readonly` **scale**: [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:scale](https://threejs.org/docs/#api/en/core/Object3D.scale)
The object's local scale.
#### Default Value
`new THREE.Vector3( 1, 1, 1 )`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`scale`](/three-flatland/api/three-flatland/src/classes/sprite2d/#scale)
***
### static
> **static**: `boolean`
Defined in: [three.js/core/Object3D:static](https://threejs.org/docs/#api/en/core/Object3D.static)
Whether the 3D object is supposed to be static or not. If set to `true`, it means
the 3D object is not going to be changed after the initial renderer. This includes
geometry and material settings. A static 3D object can be processed by the renderer
slightly faster since certain state checks can be bypassed.
Only relevant in context of WebGPURenderer.
#### Default
```ts
false
```
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`static`](/three-flatland/api/three-flatland/src/classes/sprite2d/#static)
***
### type
> `readonly` **type**: `string`
Defined in: [three.js/objects/Mesh:type](https://threejs.org/docs/#api/en/objects/Mesh.type)
#### Default Value
`Mesh`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`type`](/three-flatland/api/three-flatland/src/classes/sprite2d/#type)
***
### up
> **up**: [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:up](https://threejs.org/docs/#api/en/core/Object3D.up)
This is used by the [lookAt](https://threejs.org/docs/) method, for example, to determine the orientation of the result.
#### Default Value
[Object3D.DEFAULT\_UP](/three-flatland/api/three-flatland/src/classes/flatland/#default_up) - that is `(0, 1, 0)`.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`up`](/three-flatland/api/three-flatland/src/classes/sprite2d/#up)
***
### userData
> **userData**: `Record`\<`string`, `any`\>
Defined in: [three.js/core/Object3D:userData](https://threejs.org/docs/#api/en/core/Object3D.userData)
An object that can be used to store custom data about the [Object3D](https://threejs.org/docs/#api/en/core/Object3D).
#### Remarks
It should not hold references to _functions_ as these **will not** be cloned.
#### Default
`{}`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`userData`](/three-flatland/api/three-flatland/src/classes/sprite2d/#userdata)
***
### uuid
> **uuid**: `string`
Defined in: [three.js/core/Object3D:uuid](https://threejs.org/docs/#api/en/core/Object3D.uuid)
[UUID](http://en.wikipedia.org/wiki/Universally_unique_identifier) of this object instance.
#### Remarks
This gets automatically assigned and shouldn't be edited.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`uuid`](/three-flatland/api/three-flatland/src/classes/sprite2d/#uuid)
***
### visible
> **visible**: `boolean`
Defined in: [three.js/core/Object3D:visible](https://threejs.org/docs/#api/en/core/Object3D.visible)
Object gets rendered if `true`.
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`visible`](/three-flatland/api/three-flatland/src/classes/sprite2d/#visible)
***
### DEFAULT\_MATRIX\_AUTO\_UPDATE
> `static` **DEFAULT\_MATRIX\_AUTO\_UPDATE**: `boolean`
Defined in: [three.js/core/Object3D:DEFAULT_MATRIX_AUTO_UPDATE](https://threejs.org/docs/#api/en/core/Object3D.DEFAULT_MATRIX_AUTO_UPDATE)
The default setting for [matrixAutoUpdate](/three-flatland/api/three-flatland/src/classes/flatland/#matrixautoupdate) for newly created Object3Ds.
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`DEFAULT_MATRIX_AUTO_UPDATE`](/three-flatland/api/three-flatland/src/classes/sprite2d/#default_matrix_auto_update)
***
### DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE
> `static` **DEFAULT\_MATRIX\_WORLD\_AUTO\_UPDATE**: `boolean`
Defined in: [three.js/core/Object3D:DEFAULT_MATRIX_WORLD_AUTO_UPDATE](https://threejs.org/docs/#api/en/core/Object3D.DEFAULT_MATRIX_WORLD_AUTO_UPDATE)
The default setting for [matrixWorldAutoUpdate](/three-flatland/api/three-flatland/src/classes/flatland/#matrixworldautoupdate) for newly created Object3Ds.
#### Default Value
`true`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`DEFAULT_MATRIX_WORLD_AUTO_UPDATE`](/three-flatland/api/three-flatland/src/classes/sprite2d/#default_matrix_world_auto_update)
***
### DEFAULT\_UP
> `static` **DEFAULT\_UP**: [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:DEFAULT_UP](https://threejs.org/docs/#api/en/core/Object3D.DEFAULT_UP)
The default [up](/three-flatland/api/three-flatland/src/classes/flatland/#up) direction for objects, also used as the default position for THREE.DirectionalLight \| DirectionalLight,
THREE.HemisphereLight \| HemisphereLight and THREE.Spotlight \| Spotlight (which creates lights shining from the top down).
#### Default Value
`new THREE.Vector3( 0, 1, 0)`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`DEFAULT_UP`](/three-flatland/api/three-flatland/src/classes/sprite2d/#default_up)
## Accessors
### alpha
#### Get Signature
> **get** **alpha**(): `number`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:793](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L793)
Get alpha/opacity.
##### Returns
`number`
#### Set Signature
> **set** **alpha**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:800](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L800)
Set alpha/opacity (0-1).
##### Parameters
###### value
`number`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`alpha`](/three-flatland/api/three-flatland/src/classes/sprite2d/#alpha)
***
### anchor
#### Get Signature
> **get** **anchor**(): [`Vector2`](https://threejs.org/docs/#api/en/math/Vector2)
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:739](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L739)
Get the anchor point. Returns the stored Vector2 (like Object3D.position).
##### Returns
[`Vector2`](https://threejs.org/docs/#api/en/math/Vector2)
#### Set Signature
> **set** **anchor**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:746](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L746)
Set the anchor point. Accepts [x, y] array or Vector2.
##### Parameters
###### value
\[`number`, `number`\] \| [`Vector2`](https://threejs.org/docs/#api/en/math/Vector2)
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`anchor`](/three-flatland/api/three-flatland/src/classes/sprite2d/#anchor)
***
### animation
#### Set Signature
> **set** **animation**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:162](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L162)
Set the current animation by name (R3F compatible).
Plays the animation if found.
##### Parameters
###### value
`string` \| `null`
##### Returns
`void`
***
### animationSet
#### Set Signature
> **set** **animationSet**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:152](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L152)
Set animation set definition (R3F compatible).
Loads animations from the definition.
##### Parameters
###### value
[`AnimationSetDefinition`](/three-flatland/api/three-flatland/src/interfaces/animationsetdefinition/) \| `null`
##### Returns
`void`
***
### castsShadow
#### Get Signature
> **get** **castsShadow**(): `boolean`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:219](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L219)
Whether this sprite contributes its silhouette to the shadow-caster
occlusion pre-pass. Stored as bit 2 of `_systemFlags`. Default: `false`
— most sprites don't cast; opt in by setting to `true`.
Consumed by the occlusion pre-pass shader, which masks the sprite's
alpha by this bit before the SDF seed. Flipping it takes effect on
the next frame with zero CPU rebuild (same model as `receiveShadows`).
##### Returns
`boolean`
#### Set Signature
> **set** **castsShadow**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:223](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L223)
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`castsShadow`](/three-flatland/api/three-flatland/src/classes/sprite2d/#castsshadow)
***
### currentAnimation
#### Get Signature
> **get** **currentAnimation**(): `string` \| `null`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:333](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L333)
Get current animation name.
##### Returns
`string` \| `null`
***
### flipX
#### Get Signature
> **get** **flipX**(): `boolean`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:819](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L819)
Get flipX state.
##### Returns
`boolean`
#### Set Signature
> **set** **flipX**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:826](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L826)
Set flipX state.
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`flipX`](/three-flatland/api/three-flatland/src/classes/sprite2d/#flipx)
***
### flipY
#### Get Signature
> **get** **flipY**(): `boolean`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:841](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L841)
Get flipY state.
##### Returns
`boolean`
#### Set Signature
> **set** **flipY**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:848](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L848)
Set flipY state.
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`flipY`](/three-flatland/api/three-flatland/src/classes/sprite2d/#flipy)
***
### frame
#### Get Signature
> **get** **frame**(): [`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/) \| `null`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:691](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L691)
Get the current frame.
##### Returns
[`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/) \| `null`
#### Set Signature
> **set** **frame**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:698](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L698)
Set the current frame (R3F prop compatibility).
##### Parameters
###### value
[`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/) \| `null`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`frame`](/three-flatland/api/three-flatland/src/classes/sprite2d/#frame)
***
### height
#### Get Signature
> **get** **height**(): `number`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:940](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L940)
Get the height of the sprite in world units.
##### Returns
`number`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`height`](/three-flatland/api/three-flatland/src/classes/sprite2d/#height)
***
### layer
#### Get Signature
> **get** **layer**(): `number`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:880](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L880)
Get render layer (primary sort key).
##### Returns
`number`
#### Set Signature
> **set** **layer**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:887](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L887)
Set render layer (primary sort key).
##### Parameters
###### value
`number`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`layer`](/three-flatland/api/three-flatland/src/classes/sprite2d/#layer)
***
### lit
#### Get Signature
> **get** **lit**(): `boolean`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:114](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L114)
Whether this sprite receives lighting from Flatland's LightEffect.
Stored as bit 0 of `_systemFlags` so lit/unlit sprites with the same
texture share the same material and batch together.
Default: `true` — set `lit = false` to opt out.
##### Returns
`boolean`
#### Set Signature
> **set** **lit**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:118](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L118)
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`lit`](/three-flatland/api/three-flatland/src/classes/sprite2d/#lit)
***
### receiveShadows
#### Get Signature
> **get** **receiveShadows**(): `boolean`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:141](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L141)
Whether this sprite receives shadows from the SDF shadow pipeline.
Stored as bit 1 of `_systemFlags`.
Default: `true` — set `receiveShadows = false` to opt out.
##### Returns
`boolean`
#### Set Signature
> **set** **receiveShadows**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:145](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L145)
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`receiveShadows`](/three-flatland/api/three-flatland/src/classes/sprite2d/#receiveshadows)
***
### shadowRadius
#### Get Signature
> **get** **shadowRadius**(): `number` \| `undefined`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:193](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L193)
Per-sprite occluder radius (world units) consumed by shadow-casting
LightEffects — e.g. DefaultLightEffect's SDF sphere-tracer
uses it as the self-silhouette escape distance so a tracer launched
from inside the caster steps out cleanly.
Returns `undefined` while in auto-resolve mode (default), in which
case `transformSyncSystem` writes `max(|scale.x|, |scale.y|)` into
the per-instance attribute each frame — covering animation frames
and runtime scale changes without manual updates. Assign a number
to override (useful when the visible body is tighter than the
quad's bounds, or when an off-center anchor pushes the silhouette).
Assign `undefined` to return to auto-resolve.
##### Returns
`number` \| `undefined`
#### Set Signature
> **set** **shadowRadius**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:197](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L197)
##### Parameters
###### value
`number` \| `undefined`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`shadowRadius`](/three-flatland/api/three-flatland/src/classes/sprite2d/#shadowradius)
***
### speed
#### Get Signature
> **get** **speed**(): `number`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:340](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L340)
Get playback speed.
##### Returns
`number`
#### Set Signature
> **set** **speed**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:347](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L347)
Set playback speed.
##### Parameters
###### value
`number`
##### Returns
`void`
***
### spriteSheet
#### Get Signature
> **get** **spriteSheet**(): [`SpriteSheet`](/three-flatland/api/three-flatland/src/interfaces/spritesheet/) \| `null`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:129](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L129)
Get the spritesheet.
##### Returns
[`SpriteSheet`](/three-flatland/api/three-flatland/src/interfaces/spritesheet/) \| `null`
#### Set Signature
> **set** **spriteSheet**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:136](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L136)
Set a new spritesheet.
##### Parameters
###### value
[`SpriteSheet`](/three-flatland/api/three-flatland/src/interfaces/spritesheet/) \| `null`
##### Returns
`void`
***
### texture
#### Get Signature
> **get** **texture**(): [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:605](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L605)
Get the current texture.
##### Returns
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
#### Set Signature
> **set** **texture**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:612](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L612)
Set a new texture.
##### Parameters
###### value
[`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`texture`](/three-flatland/api/three-flatland/src/classes/sprite2d/#texture)
***
### tint
#### Get Signature
> **get** **tint**(): [`Color`](https://threejs.org/docs/#api/en/math/Color)
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:772](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L772)
Get tint color. Returns a stored Color reference (like Material.color).
Mutating the returned Color triggers ECS sync via onChange callback.
##### Returns
[`Color`](https://threejs.org/docs/#api/en/math/Color)
#### Set Signature
> **set** **tint**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:779](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L779)
Set tint color. Accepts Color, hex string, hex number, or [r, g, b] array (0-1).
##### Parameters
###### value
`string` \| `number` \| \[`number`, `number`, `number`\] \| [`Color`](https://threejs.org/docs/#api/en/math/Color)
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`tint`](/three-flatland/api/three-flatland/src/classes/sprite2d/#tint)
***
### width
#### Get Signature
> **get** **width**(): `number`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:933](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L933)
Get the width of the sprite in world units.
##### Returns
`number`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`width`](/three-flatland/api/three-flatland/src/classes/sprite2d/#width)
***
### zIndex
#### Get Signature
> **get** **zIndex**(): `number`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:897](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L897)
Get z-index within layer (secondary sort key).
##### Returns
`number`
#### Set Signature
> **set** **zIndex**(`value`): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:919](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L919)
Set z-index within layer (secondary sort key).
Hot path. Every moving sprite in a y-sorted scene calls this every
frame, so the cost has to stay near-zero per call.
The raw SoA write is unconditional — `transformSyncSystem` reads
`_zIndexArr` directly and bakes the value into the instance matrix
for the GPU depth test. That alone is enough for alphaTest+depthWrite
materials (GPU resolves order via the baked-in Z, no CPU sort needed).
For non-gated materials, we flip the batch's `_sortDirty` flag so
`batchSortSystem` knows to re-sort this batch on its next pass. This
replaced the prior `Changed(SpriteZIndex)` channel — Koota's change
tracker enumerated every flip every frame even when the gate trivially
skipped the sort, costing ~7ms/frame in a 12k-sprite demo. The
per-batch boolean costs one ref read + one write.
##### Parameters
###### value
`number`
##### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`zIndex`](/three-flatland/api/three-flatland/src/classes/sprite2d/#zindex)
## Methods
### \_setupInstanceAttributes()
> **\_setupInstanceAttributes**(): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:1003](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L1003)
Set up instance attributes on the geometry for single-sprite rendering.
Uses one interleaved buffer (mirroring SpriteBatch) so batched and
standalone paths share the same shader attribute shape. Also
allocates buffers for custom attributes from the material's schema
(pure effect data — `effectBuf0`, `effectBuf1`, ...).
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`_setupInstanceAttributes`](/three-flatland/api/three-flatland/src/classes/sprite2d/#_setupinstanceattributes)
***
### add()
> **add**(...`object`): `this`
Defined in: [three.js/core/Object3D:add](https://threejs.org/docs/#api/en/core/Object3D.add)
Adds another [Object3D](https://threejs.org/docs/#api/en/core/Object3D) as child of this [Object3D](https://threejs.org/docs/#api/en/core/Object3D).
#### Parameters
##### object
...[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
#### Returns
`this`
#### Remarks
An arbitrary number of objects may be added
Any current parent on an object passed in here will be removed, since an [Object3D](https://threejs.org/docs/#api/en/core/Object3D) can have at most one parent.
#### See
- [attach](https://threejs.org/docs/)
- THREE.Group \| Group for info on manually grouping objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`add`](/three-flatland/api/three-flatland/src/classes/sprite2d/#add)
***
### addAnimation()
> **addAnimation**(`animation`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:211](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L211)
Add an animation.
#### Parameters
##### animation
[`Animation`](/three-flatland/api/three-flatland/src/interfaces/animation/)
#### Returns
`this`
***
### addAnimationFromFrames()
> **addAnimationFromFrames**(`name`, `frameNames`, `options?`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:219](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L219)
Add animation from frame names.
#### Parameters
##### name
`string`
##### frameNames
`string`[]
##### options?
###### fps?
`number`
###### loop?
`boolean`
###### pingPong?
`boolean`
#### Returns
`this`
***
### addEffect()
> **addEffect**(`effect`): `this`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:1105](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L1105)
Add an effect instance to this sprite.
Auto-registers the effect type on the material if not already registered.
Sets the enable bit and writes effect data to packed buffers.
#### Parameters
##### effect
[`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)
#### Returns
`this`
#### Example
```typescript
const dissolve = new DissolveEffect()
dissolve.progress = 0.5
sprite.addEffect(dissolve)
```
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`addEffect`](/three-flatland/api/three-flatland/src/classes/sprite2d/#addeffect)
***
### addEventListener()
> **addEventListener**\<`T`\>(`type`, `listener`): `void`
Defined in: [three.js/core/EventDispatcher:addEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.addEventListener)
Adds a listener to an event type.
#### Type Parameters
##### T
`T` *extends* keyof [`Object3DEventMap`](https://threejs.org/docs/)
#### Parameters
##### type
`T`
The type of event to listen to.
##### listener
[`EventListener`](https://threejs.org/docs/)\<[`Object3DEventMap`](https://threejs.org/docs/)\[`T`\], `T`, `AnimatedSprite2D`\>
The function that gets called when the event is fired.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`addEventListener`](/three-flatland/api/three-flatland/src/classes/sprite2d/#addeventlistener)
***
### applyMatrix4()
> **applyMatrix4**(`matrix`): `void`
Defined in: [three.js/core/Object3D:applyMatrix4](https://threejs.org/docs/#api/en/core/Object3D.applyMatrix4)
Applies the matrix transform to the object and updates the object's position, rotation and scale.
#### Parameters
##### matrix
[`Matrix4`](https://threejs.org/docs/#api/en/math/Matrix4)
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`applyMatrix4`](/three-flatland/api/three-flatland/src/classes/sprite2d/#applymatrix4)
***
### applyQuaternion()
> **applyQuaternion**(`quaternion`): `this`
Defined in: [three.js/core/Object3D:applyQuaternion](https://threejs.org/docs/#api/en/core/Object3D.applyQuaternion)
Applies the rotation represented by the quaternion to the object.
#### Parameters
##### quaternion
[`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`applyQuaternion`](/three-flatland/api/three-flatland/src/classes/sprite2d/#applyquaternion)
***
### attach()
> **attach**(`object`): `this`
Defined in: [three.js/core/Object3D:attach](https://threejs.org/docs/#api/en/core/Object3D.attach)
Adds a [Object3D](https://threejs.org/docs/#api/en/core/Object3D) as a child of this, while maintaining the object's world transform.
#### Parameters
##### object
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)
#### Returns
`this`
#### Remarks
Note: This method does not support scene graphs having non-uniformly-scaled nodes(s).
#### See
[add](https://threejs.org/docs/)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`attach`](/three-flatland/api/three-flatland/src/classes/sprite2d/#attach)
***
### clear()
> **clear**(): `this`
Defined in: [three.js/core/Object3D:clear](https://threejs.org/docs/#api/en/core/Object3D.clear)
Removes all child objects.
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`clear`](/three-flatland/api/three-flatland/src/classes/sprite2d/#clear)
***
### clone()
> **clone**(`recursive?`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:363](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L363)
Clone the animated sprite.
#### Parameters
##### recursive?
`boolean`
#### Returns
`this`
#### Overrides
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`clone`](/three-flatland/api/three-flatland/src/classes/sprite2d/#clone)
***
### copy()
> **copy**(`object`, `recursive?`): `this`
Defined in: [three.js/core/Object3D:copy](https://threejs.org/docs/#api/en/core/Object3D.copy)
Copies the given object into this object.
#### Parameters
##### object
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)
##### recursive?
`boolean`
If set to `true`, descendants of the object are copied next to the existing ones. If set to
`false`, descendants are left unchanged. Default is `true`.
#### Returns
`this`
#### Remarks
Event listeners and user-defined callbacks (.onAfterRender and .onBeforeRender) are not copied.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`copy`](/three-flatland/api/three-flatland/src/classes/sprite2d/#copy)
***
### dispatchEvent()
> **dispatchEvent**\<`T`\>(`event`): `void`
Defined in: [three.js/core/EventDispatcher:dispatchEvent](https://threejs.org/docs/#api/en/core/EventDispatcher.dispatchEvent)
Fire an event type.
#### Type Parameters
##### T
`T` *extends* keyof [`Object3DEventMap`](https://threejs.org/docs/)
#### Parameters
##### event
[`BaseEvent`](https://threejs.org/docs/)\<`T`\> & [`Object3DEventMap`](https://threejs.org/docs/)\[`T`\]
The event that gets fired.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`dispatchEvent`](/three-flatland/api/three-flatland/src/classes/sprite2d/#dispatchevent)
***
### dispose()
> **dispose**(): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:417](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L417)
Dispose of resources.
#### Returns
`void`
#### Overrides
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`dispose`](/three-flatland/api/three-flatland/src/classes/sprite2d/#dispose)
***
### flip()
> **flip**(`horizontal`, `vertical`): `this`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:863](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L863)
Flip the sprite.
#### Parameters
##### horizontal
`boolean`
##### vertical
`boolean`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`flip`](/three-flatland/api/three-flatland/src/classes/sprite2d/#flip)
***
### getAnimationDuration()
> **getAnimationDuration**(`name?`): `number`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:354](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L354)
Get animation duration.
#### Parameters
##### name?
`string`
#### Returns
`number`
***
### getObjectById()
> **getObjectById**(`id`): [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
Defined in: [three.js/core/Object3D:getObjectById](https://threejs.org/docs/#api/en/core/Object3D.getObjectById)
Searches through an object and its children, starting with the object itself, and returns the first with a matching id.
#### Parameters
##### id
`number`
Unique number of the object instance. Expects a `Integer`
#### Returns
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
#### Remarks
Note that ids are assigned in chronological order: 1, 2, 3, ..., incrementing by one for each new object.
#### See
id
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getObjectById`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getobjectbyid)
***
### getObjectByName()
> **getObjectByName**(`name`): [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
Defined in: [three.js/core/Object3D:getObjectByName](https://threejs.org/docs/#api/en/core/Object3D.getObjectByName)
Searches through an object and its children, starting with the object itself, and returns the first with a matching name.
#### Parameters
##### name
`string`
String to match to the children's Object3D.name property.
#### Returns
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
#### Remarks
Note that for most objects the name is an empty string by default
You will have to set it manually to make use of this method.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getObjectByName`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getobjectbyname)
***
### getObjectByProperty()
> **getObjectByProperty**(`name`, `value`): [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
Defined in: [three.js/core/Object3D:getObjectByProperty](https://threejs.org/docs/#api/en/core/Object3D.getObjectByProperty)
Searches through an object and its children, starting with the object itself,
and returns the first with a property that matches the value given.
#### Parameters
##### name
`string`
the property name to search for.
##### value
`any`
value of the given property.
#### Returns
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\> \| `undefined`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getObjectByProperty`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getobjectbyproperty)
***
### getObjectsByProperty()
> **getObjectsByProperty**(`name`, `value`, `optionalTarget?`): [`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
Defined in: [three.js/core/Object3D:getObjectsByProperty](https://threejs.org/docs/#api/en/core/Object3D.getObjectsByProperty)
Searches through an object and its children, starting with the object itself,
and returns the first with a property that matches the value given.
#### Parameters
##### name
`string`
The property name to search for.
##### value
`any`
Value of the given property.
##### optionalTarget?
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
target to set the result. Otherwise a new Array is instantiated. If set, you must clear
this array prior to each call (i.e., array.length = 0;).
#### Returns
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getObjectsByProperty`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getobjectsbyproperty)
***
### getVertexPosition()
> **getVertexPosition**(`index`, `target`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/objects/Mesh:getVertexPosition](https://threejs.org/docs/#api/en/objects/Mesh.getVertexPosition)
Get the local-space position of the vertex at the given index,
taking into account the current animation state of both morph targets and skinning.
#### Parameters
##### index
`number`
Expects a `Integer`
##### target
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getVertexPosition`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getvertexposition)
***
### getWorldDirection()
> **getWorldDirection**(`target`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:getWorldDirection](https://threejs.org/docs/#api/en/core/Object3D.getWorldDirection)
Returns a vector representing the direction of object's positive z-axis in world space.
#### Parameters
##### target
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
The result will be copied into this Vector3.
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getWorldDirection`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getworlddirection)
***
### getWorldPosition()
> **getWorldPosition**(`target`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:getWorldPosition](https://threejs.org/docs/#api/en/core/Object3D.getWorldPosition)
Returns a vector representing the position of the object in world space.
#### Parameters
##### target
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
The result will be copied into this Vector3.
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getWorldPosition`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getworldposition)
***
### getWorldPosition2D()
> **getWorldPosition2D**(): [`Vector2`](https://threejs.org/docs/#api/en/math/Vector2)
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:1083](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L1083)
Get world position (convenience method).
#### Returns
[`Vector2`](https://threejs.org/docs/#api/en/math/Vector2)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getWorldPosition2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getworldposition2d)
***
### getWorldQuaternion()
> **getWorldQuaternion**(`target`): [`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
Defined in: [three.js/core/Object3D:getWorldQuaternion](https://threejs.org/docs/#api/en/core/Object3D.getWorldQuaternion)
Returns a quaternion representing the rotation of the object in world space.
#### Parameters
##### target
[`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
The result will be copied into this Quaternion.
#### Returns
[`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getWorldQuaternion`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getworldquaternion)
***
### getWorldScale()
> **getWorldScale**(`target`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:getWorldScale](https://threejs.org/docs/#api/en/core/Object3D.getWorldScale)
Returns a vector of the scaling factors applied to the object for each axis in world space.
#### Parameters
##### target
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
The result will be copied into this Vector3.
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`getWorldScale`](/three-flatland/api/three-flatland/src/classes/sprite2d/#getworldscale)
***
### gotoFrame()
> **gotoFrame**(`index`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:289](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L289)
Go to a specific frame.
#### Parameters
##### index
`number`
#### Returns
`this`
***
### hasEventListener()
> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean`
Defined in: [three.js/core/EventDispatcher:hasEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.hasEventListener)
Checks if listener is added to an event type.
#### Type Parameters
##### T
`T` *extends* keyof [`Object3DEventMap`](https://threejs.org/docs/)
#### Parameters
##### type
`T`
The type of event to listen to.
##### listener
[`EventListener`](https://threejs.org/docs/)\<[`Object3DEventMap`](https://threejs.org/docs/)\[`T`\], `T`, `AnimatedSprite2D`\>
The function that gets called when the event is fired.
#### Returns
`boolean`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`hasEventListener`](/three-flatland/api/three-flatland/src/classes/sprite2d/#haseventlistener)
***
### isPlaying()
> **isPlaying**(`name?`): `boolean`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:326](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L326)
Check if an animation is playing.
#### Parameters
##### name?
`string`
#### Returns
`boolean`
***
### loadAnimationSet()
> **loadAnimationSet**(`definition`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:171](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L171)
Load animations from an animation set definition.
#### Parameters
##### definition
[`AnimationSetDefinition`](/three-flatland/api/three-flatland/src/interfaces/animationsetdefinition/)
#### Returns
`this`
***
### localToWorld()
> **localToWorld**(`vector`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:localToWorld](https://threejs.org/docs/#api/en/core/Object3D.localToWorld)
Converts the vector from this object's local space to world space.
#### Parameters
##### vector
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A vector representing a position in this object's local space.
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`localToWorld`](/three-flatland/api/three-flatland/src/classes/sprite2d/#localtoworld)
***
### lookAt()
#### Call Signature
> **lookAt**(`vector`): `void`
Defined in: [three.js/core/Object3D:lookAt](https://threejs.org/docs/#api/en/core/Object3D.lookAt)
Rotates the object to face a point in world space.
##### Parameters
###### vector
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A vector representing a position in world space to look at.
##### Returns
`void`
##### Remarks
This method does not support objects having non-uniformly-scaled parent(s).
##### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`lookAt`](/three-flatland/api/three-flatland/src/classes/sprite2d/#lookat)
#### Call Signature
> **lookAt**(`x`, `y`, `z`): `void`
Defined in: [three.js/core/Object3D:lookAt](https://threejs.org/docs/#api/en/core/Object3D.lookAt)
Rotates the object to face a point in world space.
##### Parameters
###### x
`number`
Expects a `Float`
###### y
`number`
Expects a `Float`
###### z
`number`
Expects a `Float`
##### Returns
`void`
##### Remarks
This method does not support objects having non-uniformly-scaled parent(s).
##### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`lookAt`](/three-flatland/api/three-flatland/src/classes/sprite2d/#lookat)
***
### onAfterRender()
> **onAfterRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void`
Defined in: [three.js/core/Object3D:onAfterRender](https://threejs.org/docs/#api/en/core/Object3D.onAfterRender)
An optional callback that is executed immediately after a 3D object is rendered.
#### Parameters
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
##### scene
[`Scene`](https://threejs.org/docs/#api/en/scenes/Scene)
##### camera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### geometry
[`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry)
##### material
[`Material`](https://threejs.org/docs/#api/en/materials/Material)
##### group
[`Group`](https://threejs.org/docs/#api/en/objects/Group)
#### Returns
`void`
#### Remarks
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of [Object3D](https://threejs.org/docs/#api/en/core/Object3D), [Group](https://threejs.org/docs/#api/en/objects/Group) or Bone are not renderable
and thus this callback is not executed for such objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`onAfterRender`](/three-flatland/api/three-flatland/src/classes/sprite2d/#onafterrender)
***
### onAfterShadow()
> **onAfterShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void`
Defined in: [three.js/core/Object3D:onAfterShadow](https://threejs.org/docs/#api/en/core/Object3D.onAfterShadow)
An optional callback that is executed immediately after a 3D object is rendered to a shadow map.
#### Parameters
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
##### scene
[`Scene`](https://threejs.org/docs/#api/en/scenes/Scene)
##### camera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### shadowCamera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### geometry
[`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry)
##### depthMaterial
[`Material`](https://threejs.org/docs/#api/en/materials/Material)
##### group
[`Group`](https://threejs.org/docs/#api/en/objects/Group)
#### Returns
`void`
#### Remarks
This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
depthMaterial, group.
Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of [Object3D](https://threejs.org/docs/#api/en/core/Object3D), [Group](https://threejs.org/docs/#api/en/objects/Group) or Bone are not renderable
and thus this callback is not executed for such objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`onAfterShadow`](/three-flatland/api/three-flatland/src/classes/sprite2d/#onaftershadow)
***
### onBeforeRender()
> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `material`, `group`): `void`
Defined in: [three.js/core/Object3D:onBeforeRender](https://threejs.org/docs/#api/en/core/Object3D.onBeforeRender)
An optional callback that is executed immediately before a 3D object is rendered.
#### Parameters
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
##### scene
[`Scene`](https://threejs.org/docs/#api/en/scenes/Scene)
##### camera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### geometry
[`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry)
##### material
[`Material`](https://threejs.org/docs/#api/en/materials/Material)
##### group
[`Group`](https://threejs.org/docs/#api/en/objects/Group)
#### Returns
`void`
#### Remarks
This function is called with the following parameters: renderer, scene, camera, geometry, material, group.
Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of [Object3D](https://threejs.org/docs/#api/en/core/Object3D), [Group](https://threejs.org/docs/#api/en/objects/Group) or Bone are not renderable
and thus this callback is not executed for such objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`onBeforeRender`](/three-flatland/api/three-flatland/src/classes/sprite2d/#onbeforerender)
***
### onBeforeShadow()
> **onBeforeShadow**(`renderer`, `scene`, `camera`, `shadowCamera`, `geometry`, `depthMaterial`, `group`): `void`
Defined in: [three.js/core/Object3D:onBeforeShadow](https://threejs.org/docs/#api/en/core/Object3D.onBeforeShadow)
An optional callback that is executed immediately before a 3D object is rendered to a shadow map.
#### Parameters
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
##### scene
[`Scene`](https://threejs.org/docs/#api/en/scenes/Scene)
##### camera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### shadowCamera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
##### geometry
[`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry)
##### depthMaterial
[`Material`](https://threejs.org/docs/#api/en/materials/Material)
##### group
[`Group`](https://threejs.org/docs/#api/en/objects/Group)
#### Returns
`void`
#### Remarks
This function is called with the following parameters: renderer, scene, camera, shadowCamera, geometry,
depthMaterial, group.
Please notice that this callback is only executed for `renderable` 3D objects. Meaning 3D objects which
define their visual appearance with geometries and materials like instances of Mesh, Line,
Points or Sprite. Instances of [Object3D](https://threejs.org/docs/#api/en/core/Object3D), [Group](https://threejs.org/docs/#api/en/objects/Group) or Bone are not renderable
and thus this callback is not executed for such objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`onBeforeShadow`](/three-flatland/api/three-flatland/src/classes/sprite2d/#onbeforeshadow)
***
### pause()
> **pause**(): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:265](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L265)
Pause the current animation.
#### Returns
`this`
***
### play()
> **play**(`name`, `options?`): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:250](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L250)
Play an animation.
#### Parameters
##### name
`string`
##### options?
[`PlayOptions`](/three-flatland/api/three-flatland/src/interfaces/playoptions/)
#### Returns
`this`
***
### raycast()
> **raycast**(`raycaster`, `intersects`): `void`
Defined in: [three.js/core/Object3D:raycast](https://threejs.org/docs/#api/en/core/Object3D.raycast)
Abstract (empty) method to get intersections between a casted ray and this object
#### Parameters
##### raycaster
[`Raycaster`](https://threejs.org/docs/#api/en/core/Raycaster)
##### intersects
[`Intersection`](https://threejs.org/docs/)\<[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>\>[]
#### Returns
`void`
#### Remarks
Subclasses such as THREE.Mesh \| Mesh, THREE.Line \| Line, and THREE.Points \| Points implement this method in order to use raycasting.
#### See
THREE.Raycaster \| Raycaster
#### Default Value
`() => {}`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`raycast`](/three-flatland/api/three-flatland/src/classes/sprite2d/#raycast)
***
### remove()
> **remove**(...`object`): `this`
Defined in: [three.js/core/Object3D:remove](https://threejs.org/docs/#api/en/core/Object3D.remove)
Removes a [Object3D](https://threejs.org/docs/#api/en/core/Object3D) as child of this [Object3D](https://threejs.org/docs/#api/en/core/Object3D).
#### Parameters
##### object
...[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)\<[`Object3DEventMap`](https://threejs.org/docs/)\>[]
#### Returns
`this`
#### Remarks
An arbitrary number of objects may be removed.
#### See
THREE.Group \| Group for info on manually grouping objects.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`remove`](/three-flatland/api/three-flatland/src/classes/sprite2d/#remove)
***
### removeEffect()
> **removeEffect**(`effect`): `this`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:1214](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L1214)
Remove an effect instance from this sprite.
Clears the enable bit and resets effect data to defaults.
The effect type remains registered on the material (no shader change).
#### Parameters
##### effect
[`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`removeEffect`](/three-flatland/api/three-flatland/src/classes/sprite2d/#removeeffect)
***
### removeEventListener()
> **removeEventListener**\<`T`\>(`type`, `listener`): `void`
Defined in: [three.js/core/EventDispatcher:removeEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.removeEventListener)
Removes a listener from an event type.
#### Type Parameters
##### T
`T` *extends* keyof [`Object3DEventMap`](https://threejs.org/docs/)
#### Parameters
##### type
`T`
The type of the listener that gets removed.
##### listener
[`EventListener`](https://threejs.org/docs/)\<[`Object3DEventMap`](https://threejs.org/docs/)\[`T`\], `T`, `AnimatedSprite2D`\>
The listener function that gets removed.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`removeEventListener`](/three-flatland/api/three-flatland/src/classes/sprite2d/#removeeventlistener)
***
### removeFromParent()
> **removeFromParent**(): `this`
Defined in: [three.js/core/Object3D:removeFromParent](https://threejs.org/docs/#api/en/core/Object3D.removeFromParent)
Removes this object from its current parent.
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`removeFromParent`](/three-flatland/api/three-flatland/src/classes/sprite2d/#removefromparent)
***
### resume()
> **resume**(): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:273](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L273)
Resume a paused animation.
#### Returns
`this`
***
### rotateOnAxis()
> **rotateOnAxis**(`axis`, `angle`): `this`
Defined in: [three.js/core/Object3D:rotateOnAxis](https://threejs.org/docs/#api/en/core/Object3D.rotateOnAxis)
Rotate an object along an axis in object space.
#### Parameters
##### axis
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A normalized vector in object space.
##### angle
`number`
The angle in radians. Expects a `Float`
#### Returns
`this`
#### Remarks
The axis is assumed to be normalized.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotateOnAxis`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotateonaxis)
***
### rotateOnWorldAxis()
> **rotateOnWorldAxis**(`axis`, `angle`): `this`
Defined in: [three.js/core/Object3D:rotateOnWorldAxis](https://threejs.org/docs/#api/en/core/Object3D.rotateOnWorldAxis)
Rotate an object along an axis in world space.
#### Parameters
##### axis
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A normalized vector in world space.
##### angle
`number`
The angle in radians. Expects a `Float`
#### Returns
`this`
#### Remarks
The axis is assumed to be normalized
Method Assumes no rotated parent.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotateOnWorldAxis`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotateonworldaxis)
***
### rotateX()
> **rotateX**(`angle`): `this`
Defined in: [three.js/core/Object3D:rotateX](https://threejs.org/docs/#api/en/core/Object3D.rotateX)
Rotates the object around _x_ axis in local space.
#### Parameters
##### angle
`number`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotateX`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotatex)
***
### rotateY()
> **rotateY**(`angle`): `this`
Defined in: [three.js/core/Object3D:rotateY](https://threejs.org/docs/#api/en/core/Object3D.rotateY)
Rotates the object around _y_ axis in local space.
#### Parameters
##### angle
`number`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotateY`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotatey)
***
### rotateZ()
> **rotateZ**(`angle`): `this`
Defined in: [three.js/core/Object3D:rotateZ](https://threejs.org/docs/#api/en/core/Object3D.rotateZ)
Rotates the object around _z_ axis in local space.
#### Parameters
##### angle
`number`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`rotateZ`](/three-flatland/api/three-flatland/src/classes/sprite2d/#rotatez)
***
### setAnchor()
> **setAnchor**(`x`, `y`): `this`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:763](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L763)
Set the anchor point (0-1).
(0, 0) = top-left, (0.5, 0.5) = center, (0.5, 1) = bottom-center
The anchor offset is baked into the matrix transform — no
geometry rebuild. Writing `_anchor.set(...)` triggers the
observable.vector2 callback which marks the matrix dirty; the next
`updateMatrix` picks up the new value.
#### Parameters
##### x
`number`
##### y
`number`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setAnchor`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setanchor)
***
### setFrame()
> **setFrame**(`frame`): `this`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:708](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L708)
Set the current frame.
Note: Does not modify scale - call updateSize() manually if needed after first frame.
#### Parameters
##### frame
[`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/)
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setFrame`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setframe)
***
### setRotationFromAxisAngle()
> **setRotationFromAxisAngle**(`axis`, `angle`): `void`
Defined in: [three.js/core/Object3D:setRotationFromAxisAngle](https://threejs.org/docs/#api/en/core/Object3D.setRotationFromAxisAngle)
Calls THREE.Quaternion.setFromAxisAngle \| setFromAxisAngle(axis, angle) on the [.quaternion](/three-flatland/api/three-flatland/src/classes/flatland/#quaternion).
#### Parameters
##### axis
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A normalized vector in object space.
##### angle
`number`
Angle in radians. Expects a `Float`
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setRotationFromAxisAngle`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setrotationfromaxisangle)
***
### setRotationFromEuler()
> **setRotationFromEuler**(`euler`): `void`
Defined in: [three.js/core/Object3D:setRotationFromEuler](https://threejs.org/docs/#api/en/core/Object3D.setRotationFromEuler)
Calls THREE.Quaternion.setFromEuler \| setFromEuler(euler) on the [.quaternion](/three-flatland/api/three-flatland/src/classes/flatland/#quaternion).
#### Parameters
##### euler
[`Euler`](https://threejs.org/docs/#api/en/math/Euler)
Euler angle specifying rotation amount.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setRotationFromEuler`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setrotationfromeuler)
***
### setRotationFromMatrix()
> **setRotationFromMatrix**(`m`): `void`
Defined in: [three.js/core/Object3D:setRotationFromMatrix](https://threejs.org/docs/#api/en/core/Object3D.setRotationFromMatrix)
Calls THREE.Quaternion.setFromRotationMatrix \| setFromRotationMatrix(m) on the [.quaternion](/three-flatland/api/three-flatland/src/classes/flatland/#quaternion).
#### Parameters
##### m
[`Matrix4`](https://threejs.org/docs/#api/en/math/Matrix4)
Rotate the quaternion by the rotation component of the matrix.
#### Returns
`void`
#### Remarks
Note that this assumes that the upper 3x3 of m is a pure rotation matrix (i.e, unscaled).
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setRotationFromMatrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setrotationfrommatrix)
***
### setRotationFromQuaternion()
> **setRotationFromQuaternion**(`q`): `void`
Defined in: [three.js/core/Object3D:setRotationFromQuaternion](https://threejs.org/docs/#api/en/core/Object3D.setRotationFromQuaternion)
Copy the given THREE.Quaternion \| Quaternion into [.quaternion](/three-flatland/api/three-flatland/src/classes/flatland/#quaternion).
#### Parameters
##### q
[`Quaternion`](https://threejs.org/docs/#api/en/math/Quaternion)
Normalized Quaternion.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`setRotationFromQuaternion`](/three-flatland/api/three-flatland/src/classes/sprite2d/#setrotationfromquaternion)
***
### stop()
> **stop**(): `this`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:281](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L281)
Stop the current animation.
#### Returns
`this`
***
### toJSON()
> **toJSON**(`meta?`): [`MeshJSON`](https://threejs.org/docs/)
Defined in: [three.js/objects/Mesh:toJSON](https://threejs.org/docs/#api/en/objects/Mesh.toJSON)
Convert the object to three.js [JSON Object/Scene format](https://github.com/mrdoob/three.js/wiki/JSON-Object-Scene-format-4).
#### Parameters
##### meta?
[`JSONMeta`](https://threejs.org/docs/)
Object containing metadata such as materials, textures or images for the object.
#### Returns
[`MeshJSON`](https://threejs.org/docs/)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`toJSON`](/three-flatland/api/three-flatland/src/classes/sprite2d/#tojson)
***
### translateOnAxis()
> **translateOnAxis**(`axis`, `distance`): `this`
Defined in: [three.js/core/Object3D:translateOnAxis](https://threejs.org/docs/#api/en/core/Object3D.translateOnAxis)
Translate an object by distance along an axis in object space
#### Parameters
##### axis
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A normalized vector in object space.
##### distance
`number`
The distance to translate. Expects a `Float`
#### Returns
`this`
#### Remarks
The axis is assumed to be normalized.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`translateOnAxis`](/three-flatland/api/three-flatland/src/classes/sprite2d/#translateonaxis)
***
### translateX()
> **translateX**(`distance`): `this`
Defined in: [three.js/core/Object3D:translateX](https://threejs.org/docs/#api/en/core/Object3D.translateX)
Translates object along x axis in object space by distance units.
#### Parameters
##### distance
`number`
Expects a `Float`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`translateX`](/three-flatland/api/three-flatland/src/classes/sprite2d/#translatex)
***
### translateY()
> **translateY**(`distance`): `this`
Defined in: [three.js/core/Object3D:translateY](https://threejs.org/docs/#api/en/core/Object3D.translateY)
Translates object along _y_ axis in object space by distance units.
#### Parameters
##### distance
`number`
Expects a `Float`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`translateY`](/three-flatland/api/three-flatland/src/classes/sprite2d/#translatey)
***
### translateZ()
> **translateZ**(`distance`): `this`
Defined in: [three.js/core/Object3D:translateZ](https://threejs.org/docs/#api/en/core/Object3D.translateZ)
Translates object along _z_ axis in object space by distance units.
#### Parameters
##### distance
`number`
Expects a `Float`
#### Returns
`this`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`translateZ`](/three-flatland/api/three-flatland/src/classes/sprite2d/#translatez)
***
### traverse()
> **traverse**(`callback`): `void`
Defined in: [three.js/core/Object3D:traverse](https://threejs.org/docs/#api/en/core/Object3D.traverse)
Executes the callback on this object and all descendants.
#### Parameters
##### callback
(`object`) => `any`
A function with as first argument an [Object3D](https://threejs.org/docs/#api/en/core/Object3D) object.
#### Returns
`void`
#### Remarks
Note: Modifying the scene graph inside the callback is discouraged.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`traverse`](/three-flatland/api/three-flatland/src/classes/sprite2d/#traverse)
***
### traverseAncestors()
> **traverseAncestors**(`callback`): `void`
Defined in: [three.js/core/Object3D:traverseAncestors](https://threejs.org/docs/#api/en/core/Object3D.traverseAncestors)
Executes the callback on all ancestors.
#### Parameters
##### callback
(`object`) => `any`
A function with as first argument an [Object3D](https://threejs.org/docs/#api/en/core/Object3D) object.
#### Returns
`void`
#### Remarks
Note: Modifying the scene graph inside the callback is discouraged.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`traverseAncestors`](/three-flatland/api/three-flatland/src/classes/sprite2d/#traverseancestors)
***
### traverseVisible()
> **traverseVisible**(`callback`): `void`
Defined in: [three.js/core/Object3D:traverseVisible](https://threejs.org/docs/#api/en/core/Object3D.traverseVisible)
Like traverse, but the callback will only be executed for visible objects
#### Parameters
##### callback
(`object`) => `any`
A function with as first argument an [Object3D](https://threejs.org/docs/#api/en/core/Object3D) object.
#### Returns
`void`
#### Remarks
Descendants of invisible objects are not traversed.
Note: Modifying the scene graph inside the callback is discouraged.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`traverseVisible`](/three-flatland/api/three-flatland/src/classes/sprite2d/#traversevisible)
***
### update()
> **update**(`deltaMs`): `void`
Defined in: [packages/three-flatland/src/sprites/AnimatedSprite2D.ts:302](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/AnimatedSprite2D.ts#L302)
Update animation (call in render loop).
#### Parameters
##### deltaMs
`number`
Time since last frame in milliseconds
#### Returns
`void`
***
### updateMatrix()
> **updateMatrix**(): `void`
Defined in: [packages/three-flatland/src/sprites/Sprite2D.ts:1421](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/sprites/Sprite2D.ts#L1421)
Fast 2D matrix update — bypasses Three.js quaternion-based compose().
Three.js Object3D.updateMatrix() calls matrix.compose(position, quaternion, scale)
which does full 3D quaternion→matrix math (~20 multiplies). For 2D sprites we only
need position, scale, and optional Z-axis rotation — written directly to the matrix
elements.
Also bakes in the layer/zIndex Z offset without save/restore of position.z.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`updateMatrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#updatematrix)
***
### updateMatrixWorld()
> **updateMatrixWorld**(`force?`): `void`
Defined in: [three.js/core/Object3D:updateMatrixWorld](https://threejs.org/docs/#api/en/core/Object3D.updateMatrixWorld)
Updates the global transform of the object.
And will update the object descendants if [.matrixWorldNeedsUpdate](/three-flatland/api/three-flatland/src/classes/flatland/#matrixworldneedsupdate) is set to true or if the force parameter is set to `true`.
#### Parameters
##### force?
`boolean`
A boolean that can be used to bypass [.matrixWorldAutoUpdate](/three-flatland/api/three-flatland/src/classes/flatland/#matrixworldautoupdate), to recalculate the world matrix of the object and descendants on the current frame.
Useful if you cannot wait for the renderer to update it on the next frame, assuming [.matrixWorldAutoUpdate](/three-flatland/api/three-flatland/src/classes/flatland/#matrixworldautoupdate) set to `true`.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`updateMatrixWorld`](/three-flatland/api/three-flatland/src/classes/sprite2d/#updatematrixworld)
***
### updateMorphTargets()
> **updateMorphTargets**(): `void`
Defined in: [three.js/objects/Mesh:updateMorphTargets](https://threejs.org/docs/#api/en/objects/Mesh.updateMorphTargets)
Updates the morphTargets to have no influence on the object
#### Returns
`void`
#### Remarks
Resets the [morphTargetInfluences](/three-flatland/api/three-flatland/src/classes/animatedsprite2d/#morphtargetinfluences) and [morphTargetDictionary](https://threejs.org/docs/) properties.
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`updateMorphTargets`](/three-flatland/api/three-flatland/src/classes/sprite2d/#updatemorphtargets)
***
### updateWorldMatrix()
> **updateWorldMatrix**(`updateParents`, `updateChildren`): `void`
Defined in: [three.js/core/Object3D:updateWorldMatrix](https://threejs.org/docs/#api/en/core/Object3D.updateWorldMatrix)
Updates the global transform of the object.
#### Parameters
##### updateParents
`boolean`
Recursively updates global transform of ancestors.
##### updateChildren
`boolean`
Recursively updates global transform of descendants.
#### Returns
`void`
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`updateWorldMatrix`](/three-flatland/api/three-flatland/src/classes/sprite2d/#updateworldmatrix)
***
### worldToLocal()
> **worldToLocal**(`vector`): [`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
Defined in: [three.js/core/Object3D:worldToLocal](https://threejs.org/docs/#api/en/core/Object3D.worldToLocal)
Converts the vector from world space to this object's local space.
#### Parameters
##### vector
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
A vector representing a position in world space.
#### Returns
[`Vector3`](https://threejs.org/docs/#api/en/math/Vector3)
#### Inherited from
[`Sprite2D`](/three-flatland/api/three-flatland/src/classes/sprite2d/).[`worldToLocal`](/three-flatland/api/three-flatland/src/classes/sprite2d/#worldtolocal)
# AnimationController
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:27](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L27)
Controls animation playback and state.
## Example
```typescript
const controller = new AnimationController();
controller.addAnimation({
name: 'walk',
frames: walkFrames,
fps: 12,
loop: true,
});
controller.play('walk');
// In update loop
controller.update(deltaMs, (frame) => {
sprite.setFrame(frame);
});
```
## Constructors
### Constructor
> **new AnimationController**(): `AnimationController`
#### Returns
`AnimationController`
## Accessors
### currentAnimation
#### Get Signature
> **get** **currentAnimation**(): `string` \| `null`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:286](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L286)
Get current animation name.
##### Returns
`string` \| `null`
## Methods
### addAnimation()
> **addAnimation**(`animation`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:44](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L44)
Add an animation definition.
#### Parameters
##### animation
[`Animation`](/three-flatland/api/three-flatland/src/interfaces/animation/)
#### Returns
`this`
***
### addAnimations()
> **addAnimations**(`animations`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:52](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L52)
Add multiple animations.
#### Parameters
##### animations
[`Animation`](/three-flatland/api/three-flatland/src/interfaces/animation/)[]
#### Returns
`this`
***
### dispose()
> **dispose**(): `void`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:323](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L323)
Dispose of resources.
#### Returns
`void`
***
### getAnimation()
> **getAnimation**(`name`): [`Animation`](/three-flatland/api/three-flatland/src/interfaces/animation/) \| `undefined`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:73](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L73)
Get an animation by name.
#### Parameters
##### name
`string`
#### Returns
[`Animation`](/three-flatland/api/three-flatland/src/interfaces/animation/) \| `undefined`
***
### getAnimationDuration()
> **getAnimationDuration**(`name`): `number`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:308](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L308)
Get animation duration in milliseconds.
#### Parameters
##### name
`string`
#### Returns
`number`
***
### getAnimationNames()
> **getAnimationNames**(): `string`[]
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:80](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L80)
Get all animation names.
#### Returns
`string`[]
***
### getCurrentFrame()
> **getCurrentFrame**(): [`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/) \| `null`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:251](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L251)
Get current frame.
#### Returns
[`SpriteFrame`](/three-flatland/api/three-flatland/src/interfaces/spriteframe/) \| `null`
***
### getSpeed()
> **getSpeed**(): `number`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:293](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L293)
Get playback speed.
#### Returns
`number`
***
### getState()
> **getState**(): [`AnimationState`](/three-flatland/api/three-flatland/src/interfaces/animationstate/)
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:261](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L261)
Get current animation state.
#### Returns
[`AnimationState`](/three-flatland/api/three-flatland/src/interfaces/animationstate/)
***
### gotoFrame()
> **gotoFrame**(`index`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:145](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L145)
Go to a specific frame.
#### Parameters
##### index
`number`
#### Returns
`this`
***
### isPlaying()
> **isPlaying**(`name?`): `boolean`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:276](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L276)
Check if an animation is playing.
#### Parameters
##### name?
`string`
#### Returns
`boolean`
***
### pause()
> **pause**(): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:117](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L117)
Pause the current animation.
#### Returns
`this`
***
### play()
> **play**(`name`, `options?`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:87](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L87)
Play an animation.
#### Parameters
##### name
`string`
##### options?
[`PlayOptions`](/three-flatland/api/three-flatland/src/interfaces/playoptions/) = `{}`
#### Returns
`this`
***
### removeAnimation()
> **removeAnimation**(`name`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:62](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L62)
Remove an animation.
#### Parameters
##### name
`string`
#### Returns
`this`
***
### resume()
> **resume**(): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:125](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L125)
Resume a paused animation.
#### Returns
`this`
***
### setSpeed()
> **setSpeed**(`speed`): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:300](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L300)
Set playback speed.
#### Parameters
##### speed
`number`
#### Returns
`this`
***
### stop()
> **stop**(): `this`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:133](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L133)
Stop the current animation.
#### Returns
`this`
***
### update()
> **update**(`deltaMs`, `onFrame?`, `onEvent?`): `void`
Defined in: [packages/three-flatland/src/animation/AnimationController.ts:159](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/animation/AnimationController.ts#L159)
Update animation state.
#### Parameters
##### deltaMs
`number`
Time since last update in milliseconds
##### onFrame?
`FrameCallback`
Callback when frame changes
##### onEvent?
`EventCallback`
Callback when frame event fires
#### Returns
`void`
# EffectMaterial
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:100](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L100)
Base material class with composable packed-buffer effect system.
Extends MeshBasicNodeMaterial and adds:
- Packed vec4 effect buffers with bitmask enable flags
- Effect registration with automatic slot assignment
- Shader rebuilding with effect chain composition
Subclasses override `_buildBaseColor()` to provide their own base color/UV
(e.g., Sprite2DMaterial provides sprite-specific UV flip, atlas, tint).
This base class can be extended for non-sprite materials that also need effects.
## Extends
- [`MeshBasicNodeMaterial`](https://threejs.org/docs/)
## Extended by
- [`Sprite2DMaterial`](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/)
## Constructors
### Constructor
> **new EffectMaterial**(`options?`): `EffectMaterial`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:209](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L209)
#### Parameters
##### options?
[`EffectMaterialOptions`](/three-flatland/api/three-flatland/src/interfaces/effectmaterialoptions/) = `{}`
#### Returns
`EffectMaterial`
#### Overrides
`MeshBasicNodeMaterial.constructor`
## Properties
### allowOverride
> **allowOverride**: `boolean`
Defined in: [three.js/materials/Material:allowOverride](https://threejs.org/docs/#api/en/materials/Material.allowOverride)
Whether it's possible to override the material with [Scene#overrideMaterial](https://threejs.org/docs/) or not.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.allowOverride`
***
### alphaHash
> **alphaHash**: `boolean`
Defined in: [three.js/materials/Material:alphaHash](https://threejs.org/docs/#api/en/materials/Material.alphaHash)
Enables alpha hashed transparency, an alternative to [Material#transparent](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#transparent) or
[Material#alphaTest](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#alphatest). The material will not be rendered if opacity is lower than
a random threshold. Randomization introduces some grain or noise, but approximates alpha
blending without the associated problems of sorting. Using TAA can reduce the resulting noise.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.alphaHash`
***
### alphaMap
> **alphaMap**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:alphaMap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.alphaMap)
The alpha map is a grayscale texture that controls the opacity across the
surface (black: fully transparent; white: fully opaque).
Only the color of the texture is used, ignoring the alpha channel if one
exists. For RGB and RGBA textures, the renderer will use the green channel
when sampling this texture due to the extra bit of precision provided for
green in DXT-compressed and uncompressed RGB 565 formats. Luminance-only and
luminance/alpha textures will also still work as expected.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.alphaMap`
***
### alphaTestNode
> **alphaTestNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:alphaTestNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.alphaTestNode)
The alpha test of node materials is by default inferred from the `alphaTest`
property. This node property allows to overwrite the default and define the
alpha test with a node instead.
If you don't want to overwrite the alpha test but modify the existing
value instead, use materialAlphaTest.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.alphaTestNode`
***
### alphaToCoverage
> **alphaToCoverage**: `boolean`
Defined in: [three.js/materials/Material:alphaToCoverage](https://threejs.org/docs/#api/en/materials/Material.alphaToCoverage)
Whether alpha to coverage should be enabled or not. Can only be used with MSAA-enabled contexts
(meaning when the renderer was created with *antialias* parameter set to `true`). Enabling this
will smooth aliasing on clip plane edges and alphaTest-clipped edges.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.alphaToCoverage`
***
### aoMap
> **aoMap**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:aoMap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.aoMap)
The red channel of this texture is used as the ambient occlusion map.
Requires a second set of UVs.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.aoMap`
***
### aoMapIntensity
> **aoMapIntensity**: `number`
Defined in: [three.js/materials/MeshBasicMaterial:aoMapIntensity](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.aoMapIntensity)
Intensity of the ambient occlusion effect. Range is `[0,1]`, where `0`
disables ambient occlusion. Where intensity is `1` and the AO map's
red channel is also `1`, ambient light is fully occluded on a surface.
#### Default
```ts
1
```
#### Inherited from
`MeshBasicNodeMaterial.aoMapIntensity`
***
### aoNode
> **aoNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:aoNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.aoNode)
The lighting of node materials might be influenced by ambient occlusion.
The default AO is inferred from an ambient occlusion map assigned to `aoMap`
and the respective `aoMapIntensity`. This node property allows to overwrite
the default and define the ambient occlusion with a custom node instead.
If you don't want to overwrite the diffuse color but modify the existing
values instead, use materialAO.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.aoNode`
***
### backdropAlphaNode
> **backdropAlphaNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:backdropAlphaNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.backdropAlphaNode)
This node allows to modulate the influence of `backdropNode` to the outgoing light.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.backdropAlphaNode`
***
### backdropNode
> **backdropNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:backdropNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.backdropNode)
This node can be used to implement a variety of filter-like effects. The idea is
to store the current rendering into a texture e.g. via `viewportSharedTexture()`, use it
to create an arbitrary effect and then assign the node composition to this property.
Everything behind the object using this material will now be affected by a filter.
```js
const material = new NodeMaterial()
material.transparent = true;
// everything behind the object will be monochromatic
material.backdropNode = saturation( viewportSharedTexture().rgb, 0 );
```
Backdrop computations are part of the lighting so only lit materials can use this property.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.backdropNode`
***
### blendAlpha
> **blendAlpha**: `number`
Defined in: [three.js/materials/Material:blendAlpha](https://threejs.org/docs/#api/en/materials/Material.blendAlpha)
Represents the alpha value of the constant blend color.
This property has only an effect when using custom blending with `ConstantAlpha` or `OneMinusConstantAlpha`.
#### Default
```ts
0
```
#### Inherited from
`MeshBasicNodeMaterial.blendAlpha`
***
### blendColor
> **blendColor**: [`Color`](https://threejs.org/docs/#api/en/math/Color)
Defined in: [three.js/materials/Material:blendColor](https://threejs.org/docs/#api/en/materials/Material.blendColor)
Represents the RGB values of the constant blend color.
This property has only an effect when using custom blending with `ConstantColor` or `OneMinusConstantColor`.
#### Default
```ts
(0,0,0)
```
#### Inherited from
`MeshBasicNodeMaterial.blendColor`
***
### blendDst
> **blendDst**: [`BlendingDstFactor`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:blendDst](https://threejs.org/docs/#api/en/materials/Material.blendDst)
Defines the blending destination factor.
#### Default
```ts
OneMinusSrcAlphaFactor
```
#### Inherited from
`MeshBasicNodeMaterial.blendDst`
***
### blendDstAlpha
> **blendDstAlpha**: [`BlendingDstFactor`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/Material:blendDstAlpha](https://threejs.org/docs/#api/en/materials/Material.blendDstAlpha)
Defines the blending destination alpha factor.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.blendDstAlpha`
***
### blendEquation
> **blendEquation**: [`BlendingEquation`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:blendEquation](https://threejs.org/docs/#api/en/materials/Material.blendEquation)
Defines the blending equation.
#### Default
```ts
AddEquation
```
#### Inherited from
`MeshBasicNodeMaterial.blendEquation`
***
### blendEquationAlpha
> **blendEquationAlpha**: [`BlendingEquation`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/Material:blendEquationAlpha](https://threejs.org/docs/#api/en/materials/Material.blendEquationAlpha)
Defines the blending equation of the alpha channel.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.blendEquationAlpha`
***
### blending
> **blending**: [`Blending`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:blending](https://threejs.org/docs/#api/en/materials/Material.blending)
Defines the blending type of the material.
It must be set to `CustomBlending` if custom blending properties like
[Material#blendSrc](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#blendsrc), [Material#blendDst](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#blenddst) or [Material#blendEquation](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#blendequation)
should have any effect.
#### Default
```ts
NormalBlending
```
#### Inherited from
`MeshBasicNodeMaterial.blending`
***
### blendSrc
> **blendSrc**: [`BlendingSrcFactor`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:blendSrc](https://threejs.org/docs/#api/en/materials/Material.blendSrc)
Defines the blending source factor.
#### Default
```ts
SrcAlphaFactor
```
#### Inherited from
`MeshBasicNodeMaterial.blendSrc`
***
### blendSrcAlpha
> **blendSrcAlpha**: [`BlendingSrcFactor`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/Material:blendSrcAlpha](https://threejs.org/docs/#api/en/materials/Material.blendSrcAlpha)
Defines the blending source alpha factor.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.blendSrcAlpha`
***
### castShadowNode
> **castShadowNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:castShadowNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.castShadowNode)
This node can be used to influence how an object using this node material
casts shadows. To apply a color to shadows, you can simply do:
```js
material.castShadowNode = vec4( 1, 0, 0, 1 );
```
Which can be nice to fake colored shadows of semi-transparent objects. It
is also common to use the property with `Fn` function so checks are performed
per fragment.
```js
materialCustomShadow.castShadowNode = Fn( () => {
hash( vertexIndex ).greaterThan( 0.5 ).discard();
return materialColor;
} )();
```
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.castShadowNode`
***
### castShadowPositionNode
> **castShadowPositionNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:castShadowPositionNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.castShadowPositionNode)
Allows to overwrite the geometry position used for shadow map projection which
is by default positionLocal, the vertex position in local space.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.castShadowPositionNode`
***
### clipIntersection
> **clipIntersection**: `boolean`
Defined in: [three.js/materials/Material:clipIntersection](https://threejs.org/docs/#api/en/materials/Material.clipIntersection)
Changes the behavior of clipping planes so that only their intersection is
clipped, rather than their union.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.clipIntersection`
***
### clippingPlanes
> **clippingPlanes**: [`Plane`](https://threejs.org/docs/)[] \| `null`
Defined in: [three.js/materials/Material:clippingPlanes](https://threejs.org/docs/#api/en/materials/Material.clippingPlanes)
User-defined clipping planes specified as THREE.Plane objects in world
space. These planes apply to the objects this material is attached to.
Points in space whose signed distance to the plane is negative are clipped
(not rendered). This requires [WebGLRenderer#localClippingEnabled](https://threejs.org/docs/) to
be `true`.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.clippingPlanes`
***
### clipShadows
> **clipShadows**: `boolean`
Defined in: [three.js/materials/Material:clipShadows](https://threejs.org/docs/#api/en/materials/Material.clipShadows)
Defines whether to clip shadows according to the clipping planes specified
on this material.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.clipShadows`
***
### color
> **color**: [`Color`](https://threejs.org/docs/#api/en/math/Color)
Defined in: [three.js/materials/MeshBasicMaterial:color](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.color)
Color of the material.
#### Default
```ts
(1,1,1)
```
#### Inherited from
`MeshBasicNodeMaterial.color`
***
### colorNode
> **colorNode**: [`Node`](https://threejs.org/docs/)\<`"vec3"`\> \| [`Node`](https://threejs.org/docs/)\<`"float"`\> \| [`Node`](https://threejs.org/docs/)\<`"color"`\> \| [`Node`](https://threejs.org/docs/)\<`"vec2"`\> \| [`Node`](https://threejs.org/docs/)\<`"vec4"`\> \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:colorNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.colorNode)
The diffuse color of node materials is by default inferred from the
`color` and `map` properties. This node property allows to overwrite the default
and define the diffuse color with a node instead.
```js
material.colorNode = color( 0xff0000 ); // define red color
```
If you don't want to overwrite the diffuse color but modify the existing
values instead, use materialColor.
```js
material.colorNode = materialColor.mul( color( 0xff0000 ) ); // give diffuse colors a red tint
```
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.colorNode`
***
### colorWrite
> **colorWrite**: `boolean`
Defined in: [three.js/materials/Material:colorWrite](https://threejs.org/docs/#api/en/materials/Material.colorWrite)
Whether to render the material's color.
This can be used in conjunction with Object3D#renderOder to create invisible
objects that occlude other objects.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.colorWrite`
***
### combine
> **combine**: [`Combine`](https://threejs.org/docs/)
Defined in: [three.js/materials/MeshBasicMaterial:combine](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.combine)
How to combine the result of the surface's color with the environment map, if any.
When set to `MixOperation`, the [MeshBasicMaterial#reflectivity](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#reflectivity) is used to
blend between the two colors.
#### Default
```ts
MultiplyOperation
```
#### Inherited from
`MeshBasicNodeMaterial.combine`
***
### contextNode
> **contextNode**: [`ContextNode`](https://threejs.org/docs/)\<`unknown`\> \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:contextNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.contextNode)
This node can be used as a global context management component for this material.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.contextNode`
***
### defines?
> `optional` **defines?**: `Record`\<`string`, `unknown`\>
Defined in: [three.js/materials/Material:defines](https://threejs.org/docs/#api/en/materials/Material.defines)
#### Inherited from
`MeshBasicNodeMaterial.defines`
***
### depthFunc
> **depthFunc**: [`DepthModes`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:depthFunc](https://threejs.org/docs/#api/en/materials/Material.depthFunc)
Defines the depth function.
#### Default
```ts
LessEqualDepth
```
#### Inherited from
`MeshBasicNodeMaterial.depthFunc`
***
### depthNode
> **depthNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:depthNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.depthNode)
Allows to overwrite depth values in the fragment shader.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.depthNode`
***
### depthTest
> **depthTest**: `boolean`
Defined in: [three.js/materials/Material:depthTest](https://threejs.org/docs/#api/en/materials/Material.depthTest)
Whether to have depth test enabled when rendering this material.
When the depth test is disabled, the depth write will also be implicitly disabled.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.depthTest`
***
### depthWrite
> **depthWrite**: `boolean`
Defined in: [three.js/materials/Material:depthWrite](https://threejs.org/docs/#api/en/materials/Material.depthWrite)
Whether rendering this material has any effect on the depth buffer.
When drawing 2D overlays it can be useful to disable the depth writing in
order to layer several things together without creating z-index artifacts.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.depthWrite`
***
### dithering
> **dithering**: `boolean`
Defined in: [three.js/materials/Material:dithering](https://threejs.org/docs/#api/en/materials/Material.dithering)
Whether to apply dithering to the color to remove the appearance of banding.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.dithering`
***
### envMap
> **envMap**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:envMap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.envMap)
The environment map.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.envMap`
***
### envMapRotation
> **envMapRotation**: [`Euler`](https://threejs.org/docs/#api/en/math/Euler)
Defined in: [three.js/materials/MeshBasicMaterial:envMapRotation](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.envMapRotation)
The rotation of the environment map in radians.
#### Default
```ts
(0,0,0)
```
#### Inherited from
`MeshBasicNodeMaterial.envMapRotation`
***
### envNode
> **envNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:envNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.envNode)
The environment of node materials can be defined by an environment
map assigned to the `envMap` property or by `Scene.environment`
if the node material is a PBR material. This node property allows to overwrite
the default behavior and define the environment with a custom node.
```js
material.envNode = pmremTexture( renderTarget.texture );
```
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.envNode`
***
### fog
> **fog**: `boolean`
Defined in: [three.js/materials/nodes/NodeMaterial:fog](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.fog)
Whether this material is affected by fog or not.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.fog`
***
### forceSinglePass
> **forceSinglePass**: `boolean`
Defined in: [three.js/materials/Material:forceSinglePass](https://threejs.org/docs/#api/en/materials/Material.forceSinglePass)
Whether double-sided, transparent objects should be rendered with a single pass or not.
The engine renders double-sided, transparent objects with two draw calls (back faces first,
then front faces) to mitigate transparency artifacts. There are scenarios however where this
approach produces no quality gains but still doubles draw calls e.g. when rendering flat
vegetation like grass sprites. In these cases, set the `forceSinglePass` flag to `true` to
disable the two pass rendering to avoid performance issues.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.forceSinglePass`
***
### fragmentNode
> **fragmentNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:fragmentNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.fragmentNode)
This node property can be used if you need complete freedom in implementing
the fragment shader. Assigning a node will replace the built-in material
logic used in the fragment stage.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.fragmentNode`
***
### geometryNode
> **geometryNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:geometryNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.geometryNode)
This node property is intended for logic which modifies geometry data once or per animation step.
Apps usually place such logic randomly in initialization routines or in the animation loop.
`geometryNode` is intended as a dedicated API so there is an intended spot where geometry modifications
can be implemented.
The idea is to assign a `Fn` definition that holds the geometry modification logic. A typical example
would be a GPU based particle system that provides a node material for usage on app level. The particle
simulation would be implemented as compute shaders and managed inside a `Fn` function. This function is
eventually assigned to `geometryNode`.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.geometryNode`
***
### hardwareClipping
> **hardwareClipping**: `boolean`
Defined in: [three.js/materials/nodes/NodeMaterial:hardwareClipping](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.hardwareClipping)
Whether this material uses hardware clipping or not.
This property is managed by the engine and should not be
modified by apps.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.hardwareClipping`
***
### isMaterial
> `readonly` **isMaterial**: `boolean`
Defined in: [three.js/materials/Material:isMaterial](https://threejs.org/docs/#api/en/materials/Material.isMaterial)
This flag can be used for type testing.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.isMaterial`
***
### isMeshBasicNodeMaterial
> `readonly` **isMeshBasicNodeMaterial**: `boolean`
Defined in: [three.js/materials/nodes/MeshBasicNodeMaterial:isMeshBasicNodeMaterial](https://threejs.org/docs/#api/en/materials/nodes/MeshBasicNodeMaterial.isMeshBasicNodeMaterial)
This flag can be used for type testing.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.isMeshBasicNodeMaterial`
***
### isNodeMaterial
> `readonly` **isNodeMaterial**: `boolean`
Defined in: [three.js/materials/nodes/NodeMaterial:isNodeMaterial](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.isNodeMaterial)
This flag can be used for type testing.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.isNodeMaterial`
***
### lightMap
> **lightMap**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:lightMap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.lightMap)
The light map. Requires a second set of UVs.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.lightMap`
***
### lightMapIntensity
> **lightMapIntensity**: `number`
Defined in: [three.js/materials/MeshBasicMaterial:lightMapIntensity](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.lightMapIntensity)
Intensity of the baked light.
#### Default
```ts
1
```
#### Inherited from
`MeshBasicNodeMaterial.lightMapIntensity`
***
### lights
> **lights**: `boolean`
Defined in: [three.js/materials/nodes/NodeMaterial:lights](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.lights)
Whether this material is affected by lights or not.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.lights`
***
### lightsNode
> **lightsNode**: [`LightsNode`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:lightsNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.lightsNode)
Node materials which set their `lights` property to `true`
are affected by all lights of the scene. Sometimes selective
lighting is wanted which means only _some_ lights in the scene
affect a material. This can be achieved by creating an instance
of [LightsNode](https://threejs.org/docs/) with a list of selective
lights and assign the node to this property.
```js
const customLightsNode = lights( [ light1, light2 ] );
material.lightsNode = customLightsNode;
```
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.lightsNode`
***
### map
> **map**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:map](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.map)
The color map. May optionally include an alpha channel, typically combined
with [Material#transparent](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#transparent) or [Material#alphaTest](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#alphatest). The texture map
color is modulated by the diffuse `color`.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.map`
***
### maskNode
> **maskNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:maskNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.maskNode)
Discards the fragment if the mask value is `false`.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.maskNode`
***
### maskShadowNode
> **maskShadowNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:maskShadowNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.maskShadowNode)
This node can be used to implement a shadow mask for the material.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.maskShadowNode`
***
### mrtNode
> **mrtNode**: [`MRTNode`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:mrtNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.mrtNode)
MRT configuration is done on renderer or pass level. This node allows to
overwrite what values are written into MRT targets on material level. This
can be useful for implementing selective FX features that should only affect
specific objects.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.mrtNode`
***
### name
> **name**: `string`
Defined in: [three.js/materials/Material:name](https://threejs.org/docs/#api/en/materials/Material.name)
The name of the material.
#### Inherited from
`MeshBasicNodeMaterial.name`
***
### normalNode
> **normalNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:normalNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.normalNode)
The normals of node materials are by default inferred from the `normalMap`/`normalScale`
or `bumpMap`/`bumpScale` properties. This node property allows to overwrite the default
and define the normals with a node instead.
If you don't want to overwrite the normals but modify the existing values instead,
use materialNormal.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.normalNode`
***
### opacity
> **opacity**: `number`
Defined in: [three.js/materials/Material:opacity](https://threejs.org/docs/#api/en/materials/Material.opacity)
Defines how transparent the material is.
A value of `0.0` indicates fully transparent, `1.0` is fully opaque.
If the [Material#transparent](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#transparent) is not set to `true`,
the material will remain fully opaque and this value will only affect its color.
#### Default
```ts
1
```
#### Inherited from
`MeshBasicNodeMaterial.opacity`
***
### opacityNode
> **opacityNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:opacityNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.opacityNode)
The opacity of node materials is by default inferred from the `opacity`
and `alphaMap` properties. This node property allows to overwrite the default
and define the opacity with a node instead.
If you don't want to overwrite the opacity but modify the existing
value instead, use materialOpacity.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.opacityNode`
***
### outputNode
> **outputNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:outputNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.outputNode)
This node can be used to define the final output of the material.
TODO: Explain the differences to `fragmentNode`.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.outputNode`
***
### polygonOffset
> **polygonOffset**: `boolean`
Defined in: [three.js/materials/Material:polygonOffset](https://threejs.org/docs/#api/en/materials/Material.polygonOffset)
Whether to use polygon offset or not. When enabled, each fragment's depth value will
be offset after it is interpolated from the depth values of the appropriate vertices.
The offset is added before the depth test is performed and before the value is written
into the depth buffer.
Can be useful for rendering hidden-line images, for applying decals to surfaces, and for
rendering solids with highlighted edges.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.polygonOffset`
***
### polygonOffsetFactor
> **polygonOffsetFactor**: `number`
Defined in: [three.js/materials/Material:polygonOffsetFactor](https://threejs.org/docs/#api/en/materials/Material.polygonOffsetFactor)
Specifies a scale factor that is used to create a variable depth offset for each polygon.
#### Default
```ts
0
```
#### Inherited from
`MeshBasicNodeMaterial.polygonOffsetFactor`
***
### polygonOffsetUnits
> **polygonOffsetUnits**: `number`
Defined in: [three.js/materials/Material:polygonOffsetUnits](https://threejs.org/docs/#api/en/materials/Material.polygonOffsetUnits)
Is multiplied by an implementation-specific value to create a constant depth offset.
#### Default
```ts
0
```
#### Inherited from
`MeshBasicNodeMaterial.polygonOffsetUnits`
***
### positionNode
> **positionNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:positionNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.positionNode)
The local vertex positions are computed based on multiple factors like the
attribute data, morphing or skinning. This node property allows to overwrite
the default and define local vertex positions with nodes instead.
If you don't want to overwrite the vertex positions but modify the existing
values instead, use positionLocal.
```js
material.positionNode = positionLocal.add( displace );
```
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.positionNode`
***
### precision
> **precision**: `"highp"` \| `"mediump"` \| `"lowp"` \| `null`
Defined in: [three.js/materials/Material:precision](https://threejs.org/docs/#api/en/materials/Material.precision)
Override the renderer's default precision for this material.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.precision`
***
### premultipliedAlpha
> **premultipliedAlpha**: `boolean`
Defined in: [three.js/materials/Material:premultipliedAlpha](https://threejs.org/docs/#api/en/materials/Material.premultipliedAlpha)
Whether to premultiply the alpha (transparency) value.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.premultipliedAlpha`
***
### receivedShadowNode
> **receivedShadowNode**: (() => [`Node`](https://threejs.org/docs/)) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:receivedShadowNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.receivedShadowNode)
This node can be used to influence how an object using this node material
receive shadows.
```js
const totalShadows = float( 1 ).toVar();
material.receivedShadowNode = Fn( ( [ shadow ] ) => {
totalShadows.mulAssign( shadow );
//return float( 1 ); // bypass received shadows
return shadow.mix( color( 0xff0000 ), 1 ); // modify shadow color
} );
@default null
#### Inherited from
`MeshBasicNodeMaterial.receivedShadowNode`
***
### receivedShadowPositionNode
> **receivedShadowPositionNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:receivedShadowPositionNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.receivedShadowPositionNode)
Allows to overwrite the position used for shadow map rendering which
is by default positionWorld, the vertex position
in world space.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.receivedShadowPositionNode`
***
### reflectivity
> **reflectivity**: `number`
Defined in: [three.js/materials/MeshBasicMaterial:reflectivity](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.reflectivity)
How much the environment map affects the surface.
The valid range is between `0` (no reflections) and `1` (full reflections).
#### Default
```ts
1
```
#### Inherited from
`MeshBasicNodeMaterial.reflectivity`
***
### refractionRatio
> **refractionRatio**: `number`
Defined in: [three.js/materials/MeshBasicMaterial:refractionRatio](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.refractionRatio)
The index of refraction (IOR) of air (approximately 1) divided by the
index of refraction of the material. It is used with environment mapping
modes CubeRefractionMapping and EquirectangularRefractionMapping.
The refraction ratio should not exceed `1`.
#### Default
```ts
0.98
```
#### Inherited from
`MeshBasicNodeMaterial.refractionRatio`
***
### shadowSide
> **shadowSide**: [`Side`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/Material:shadowSide](https://threejs.org/docs/#api/en/materials/Material.shadowSide)
Defines which side of faces cast shadows. If `null`, the side casting shadows
is determined as follows:
- When [Material#side](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#side) is set to `FrontSide`, the back side cast shadows.
- When [Material#side](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#side) is set to `BackSide`, the front side cast shadows.
- When [Material#side](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#side) is set to `DoubleSide`, both sides cast shadows.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.shadowSide`
***
### side
> **side**: [`Side`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:side](https://threejs.org/docs/#api/en/materials/Material.side)
Defines which side of faces will be rendered - front, back or both.
#### Default
```ts
FrontSide
```
#### Inherited from
`MeshBasicNodeMaterial.side`
***
### specularMap
> **specularMap**: [`Texture`](https://threejs.org/docs/#api/en/textures/Texture)\<`unknown`\> \| `null`
Defined in: [three.js/materials/MeshBasicMaterial:specularMap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.specularMap)
Specular map used by the material.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.specularMap`
***
### stencilFail
> **stencilFail**: [`StencilOp`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:stencilFail](https://threejs.org/docs/#api/en/materials/Material.stencilFail)
Which stencil operation to perform when the comparison function returns `false`.
#### Default
```ts
KeepStencilOp
```
#### Inherited from
`MeshBasicNodeMaterial.stencilFail`
***
### stencilFunc
> **stencilFunc**: [`StencilFunc`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:stencilFunc](https://threejs.org/docs/#api/en/materials/Material.stencilFunc)
The stencil comparison function to use.
#### Default
```ts
AlwaysStencilFunc
```
#### Inherited from
`MeshBasicNodeMaterial.stencilFunc`
***
### stencilFuncMask
> **stencilFuncMask**: `number`
Defined in: [three.js/materials/Material:stencilFuncMask](https://threejs.org/docs/#api/en/materials/Material.stencilFuncMask)
The bit mask to use when comparing against the stencil buffer.
#### Default
```ts
0xff
```
#### Inherited from
`MeshBasicNodeMaterial.stencilFuncMask`
***
### stencilRef
> **stencilRef**: `number`
Defined in: [three.js/materials/Material:stencilRef](https://threejs.org/docs/#api/en/materials/Material.stencilRef)
The value to use when performing stencil comparisons or stencil operations.
#### Default
```ts
0
```
#### Inherited from
`MeshBasicNodeMaterial.stencilRef`
***
### stencilWrite
> **stencilWrite**: `boolean`
Defined in: [three.js/materials/Material:stencilWrite](https://threejs.org/docs/#api/en/materials/Material.stencilWrite)
Whether stencil operations are performed against the stencil buffer. In
order to perform writes or comparisons against the stencil buffer this
value must be `true`.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.stencilWrite`
***
### stencilWriteMask
> **stencilWriteMask**: `number`
Defined in: [three.js/materials/Material:stencilWriteMask](https://threejs.org/docs/#api/en/materials/Material.stencilWriteMask)
The bit mask to use when writing to the stencil buffer.
#### Default
```ts
0xff
```
#### Inherited from
`MeshBasicNodeMaterial.stencilWriteMask`
***
### stencilZFail
> **stencilZFail**: [`StencilOp`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:stencilZFail](https://threejs.org/docs/#api/en/materials/Material.stencilZFail)
Which stencil operation to perform when the comparison function returns
`true` but the depth test fails.
#### Default
```ts
KeepStencilOp
```
#### Inherited from
`MeshBasicNodeMaterial.stencilZFail`
***
### stencilZPass
> **stencilZPass**: [`StencilOp`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:stencilZPass](https://threejs.org/docs/#api/en/materials/Material.stencilZPass)
Which stencil operation to perform when the comparison function returns
`true` and the depth test passes.
#### Default
```ts
KeepStencilOp
```
#### Inherited from
`MeshBasicNodeMaterial.stencilZPass`
***
### toneMapped
> **toneMapped**: `boolean`
Defined in: [three.js/materials/Material:toneMapped](https://threejs.org/docs/#api/en/materials/Material.toneMapped)
Defines whether this material is tone mapped according to the renderer's tone mapping setting.
It is ignored when rendering to a render target or using post processing or when using
`WebGPURenderer`. In all these cases, all materials are honored by tone mapping.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.toneMapped`
***
### transparent
> **transparent**: `boolean`
Defined in: [three.js/materials/Material:transparent](https://threejs.org/docs/#api/en/materials/Material.transparent)
Defines whether this material is transparent. This has an effect on
rendering as transparent objects need special treatment and are rendered
after non-transparent objects.
When set to true, the extent to which the material is transparent is
controlled by [Material#opacity](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#opacity).
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.transparent`
***
### type
> **type**: `string`
Defined in: [three.js/materials/Material:type](https://threejs.org/docs/#api/en/materials/Material.type)
The type property is used for detecting the object type
in context of serialization/deserialization.
#### Inherited from
`MeshBasicNodeMaterial.type`
***
### userData
> **userData**: `Record`\<`string`, `any`\>
Defined in: [three.js/materials/Material:userData](https://threejs.org/docs/#api/en/materials/Material.userData)
An object that can be used to store custom data about the Material. It
should not hold references to functions as these will not be cloned.
#### Inherited from
`MeshBasicNodeMaterial.userData`
***
### uuid
> `readonly` **uuid**: `string`
Defined in: [three.js/materials/Material:uuid](https://threejs.org/docs/#api/en/materials/Material.uuid)
The UUID of the material.
#### Inherited from
`MeshBasicNodeMaterial.uuid`
***
### version
> `readonly` **version**: `number`
Defined in: [three.js/materials/Material:version](https://threejs.org/docs/#api/en/materials/Material.version)
This starts at `0` and counts how many times [Material#needsUpdate](https://threejs.org/docs/) is set to `true`.
#### Default
```ts
0
```
#### Inherited from
`MeshBasicNodeMaterial.version`
***
### vertexColors
> **vertexColors**: `boolean`
Defined in: [three.js/materials/Material:vertexColors](https://threejs.org/docs/#api/en/materials/Material.vertexColors)
If set to `true`, vertex colors should be used.
The engine supports RGB and RGBA vertex colors depending on whether a three (RGB) or
four (RGBA) component color buffer attribute is used.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.vertexColors`
***
### vertexNode
> **vertexNode**: [`Node`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/NodeMaterial:vertexNode](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.vertexNode)
This node property can be used if you need complete freedom in implementing
the vertex shader. Assigning a node will replace the built-in material logic
used in the vertex stage.
#### Default
```ts
null
```
#### Inherited from
`MeshBasicNodeMaterial.vertexNode`
***
### visible
> **visible**: `boolean`
Defined in: [three.js/materials/Material:visible](https://threejs.org/docs/#api/en/materials/Material.visible)
Defines whether 3D objects using this material are visible.
#### Default
```ts
true
```
#### Inherited from
`MeshBasicNodeMaterial.visible`
***
### wireframe
> **wireframe**: `boolean`
Defined in: [three.js/materials/MeshBasicMaterial:wireframe](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.wireframe)
Renders the geometry as a wireframe.
#### Default
```ts
false
```
#### Inherited from
`MeshBasicNodeMaterial.wireframe`
***
### wireframeLinecap
> **wireframeLinecap**: `"round"` \| `"bevel"` \| `"miter"`
Defined in: [three.js/materials/MeshBasicMaterial:wireframeLinecap](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.wireframeLinecap)
Defines appearance of wireframe ends.
Can only be used with SVGRenderer.
#### Default
```ts
'round'
```
#### Inherited from
`MeshBasicNodeMaterial.wireframeLinecap`
***
### wireframeLinejoin
> **wireframeLinejoin**: `"round"` \| `"bevel"` \| `"miter"`
Defined in: [three.js/materials/MeshBasicMaterial:wireframeLinejoin](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.wireframeLinejoin)
Defines appearance of wireframe joints.
Can only be used with SVGRenderer.
#### Default
```ts
'round'
```
#### Inherited from
`MeshBasicNodeMaterial.wireframeLinejoin`
***
### wireframeLinewidth
> **wireframeLinewidth**: `number`
Defined in: [three.js/materials/MeshBasicMaterial:wireframeLinewidth](https://threejs.org/docs/#api/en/materials/MeshBasicMaterial.wireframeLinewidth)
Controls the thickness of the wireframe.
Can only be used with SVGRenderer.
#### Default
```ts
1
```
#### Inherited from
`MeshBasicNodeMaterial.wireframeLinewidth`
***
### MAX\_EFFECT\_FLOATS
> `readonly` `static` **MAX\_EFFECT\_FLOATS**: `12` = `12`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:144](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L144)
Maximum total effect-data floats allowed across all registered
effects on this material. WebGPU allows 8 vertex-buffer bindings
per pipeline; SpriteBatch uses 5 fixed bindings (3 geometry +
instanceMatrix + interleaved core), leaving 3 for `effectBuf0/1/2`
× 4 floats = 12 floats. Exceeding this would force a 4th effectBuf
binding which WebGPU rejects at pipeline creation with a cryptic
"vertex buffer count exceeds maximum" error. `registerEffect`
throws clearly when the cap would be exceeded.
## Accessors
### alphaTest
#### Get Signature
> **get** **alphaTest**(): `number`
Defined in: [three.js/materials/Material:alphaTest](https://threejs.org/docs/#api/en/materials/Material.alphaTest)
Sets the alpha value to be used when running an alpha test. The material
will not be rendered if the opacity is lower than this value.
##### Default
```ts
0
```
##### Returns
`number`
#### Set Signature
> **set** **alphaTest**(`value`): `void`
Defined in: [three.js/materials/Material:alphaTest](https://threejs.org/docs/#api/en/materials/Material.alphaTest)
##### Parameters
###### value
`number`
##### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.alphaTest`
***
### colorTransform
#### Get Signature
> **get** **colorTransform**(): [`ColorTransformFn`](/three-flatland/api/three-flatland/src/type-aliases/colortransformfn/) \| `null`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:223](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L223)
Get the color transform function.
##### Returns
[`ColorTransformFn`](/three-flatland/api/three-flatland/src/type-aliases/colortransformfn/) \| `null`
#### Set Signature
> **set** **colorTransform**(`value`): `void`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:231](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L231)
Set the color transform function.
Triggers shader rebuild.
##### Parameters
###### value
[`ColorTransformFn`](/three-flatland/api/three-flatland/src/type-aliases/colortransformfn/) \| `null`
##### Returns
`void`
***
### needsUpdate
#### Set Signature
> **set** **needsUpdate**(`value`): `void`
Defined in: [three.js/materials/Material:needsUpdate](https://threejs.org/docs/#api/en/materials/Material.needsUpdate)
Setting this property to `true` indicates the engine the material
needs to be recompiled.
##### Default
```ts
false
```
##### Parameters
###### value
`boolean`
##### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.needsUpdate`
***
### requiredChannels
#### Get Signature
> **get** **requiredChannels**(): `ReadonlySet`\<`string`\>
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:243](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L243)
Get the required channels set.
##### Returns
`ReadonlySet`\<`string`\>
#### Set Signature
> **set** **requiredChannels**(`value`): `void`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:251](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L251)
Set the required channels.
Triggers shader rebuild when channels change.
##### Parameters
###### value
`ReadonlySet`\<`string`\>
##### Returns
`void`
***
### type
#### Get Signature
> **get** `static` **type**(): `string`
Defined in: [three.js/materials/nodes/NodeMaterial:type](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.type)
##### Returns
`string`
#### Inherited from
`MeshBasicNodeMaterial.type`
## Methods
### addEventListener()
> **addEventListener**\<`T`\>(`type`, `listener`): `void`
Defined in: [three.js/core/EventDispatcher:addEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.addEventListener)
Adds a listener to an event type.
#### Type Parameters
##### T
`T` *extends* `"dispose"`
#### Parameters
##### type
`T`
The type of event to listen to.
##### listener
[`EventListener`](https://threejs.org/docs/)\<`object`\[`T`\], `T`, `EffectMaterial`\>
The function that gets called when the event is fired.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.addEventListener`
***
### build()
> **build**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:build](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.build)
Builds this material with the given node builder.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.build`
***
### clone()
> **clone**(): `this`
Defined in: [three.js/materials/Material:clone](https://threejs.org/docs/#api/en/materials/Material.clone)
Returns a new material with copied values from this instance.
#### Returns
`this`
A clone of this instance.
#### Inherited from
`MeshBasicNodeMaterial.clone`
***
### copy()
> **copy**(`source`): `this`
Defined in: [three.js/materials/nodes/NodeMaterial:copy](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.copy)
Copies the properties of the given node material to this instance.
#### Parameters
##### source
[`NodeMaterial`](https://threejs.org/docs/)
The material to copy.
#### Returns
`this`
A reference to this node material.
#### Inherited from
`MeshBasicNodeMaterial.copy`
***
### customProgramCacheKey()
> **customProgramCacheKey**(): `string`
Defined in: [three.js/materials/Material:customProgramCacheKey](https://threejs.org/docs/#api/en/materials/Material.customProgramCacheKey)
In case [Material#onBeforeCompile](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#onbeforecompile) is used, this callback can be used to identify
values of settings used in `onBeforeCompile()`, so three.js can reuse a cached
shader or recompile the shader for this material as needed.
This method can only be used when rendering with [WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer).
#### Returns
`string`
The custom program cache key.
#### Inherited from
`MeshBasicNodeMaterial.customProgramCacheKey`
***
### dispatchEvent()
> **dispatchEvent**\<`T`\>(`event`): `void`
Defined in: [three.js/core/EventDispatcher:dispatchEvent](https://threejs.org/docs/#api/en/core/EventDispatcher.dispatchEvent)
Fire an event type.
#### Type Parameters
##### T
`T` *extends* `"dispose"`
#### Parameters
##### event
[`BaseEvent`](https://threejs.org/docs/)\<`T`\> & `object`\[`T`\]
The event that gets fired.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.dispatchEvent`
***
### dispose()
> **dispose**(): `void`
Defined in: [three.js/materials/Material:dispose](https://threejs.org/docs/#api/en/materials/Material.dispose)
Frees the GPU-related resources allocated by this instance. Call this
method whenever this instance is no longer used in your app.
#### Returns
`void`
#### Fires
Material#dispose
#### Inherited from
`MeshBasicNodeMaterial.dispose`
***
### getEffectFieldLocation()
> **getEffectFieldLocation**(`effectName`, `fieldName`): \{ `bufferName`: `string`; `componentIndex`: `number`; `size`: `number`; \} \| `undefined`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:640](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L640)
Locate an effect's schema field within the packed instance buffers.
Returns the `effectBufN` attribute that contains this field, the
float offset within a single instance's 4-float slice of that
buffer (0-3), and the field's float width. Returns `undefined`
if no registered effect declares the given field.
Used by instance-writing code (e.g. TileLayer, SpriteBatch) that
needs to poke per-instance effect values directly without going
through a MaterialEffect instance's property setter.
#### Parameters
##### effectName
`string`
##### fieldName
`string`
#### Returns
\{ `bufferName`: `string`; `componentIndex`: `number`; `size`: `number`; \} \| `undefined`
***
### getEffects()
> **getEffects**(): readonly *typeof* [`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)[]
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:366](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L366)
Get the list of registered effect classes.
#### Returns
readonly *typeof* [`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)[]
***
### getUsedEffectFloats()
> **getUsedEffectFloats**(): `number`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:193](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L193)
Current per-instance effect-float usage (sum across all registered
effects). Complements [getMaxEffectFloats](/three-flatland/api/three-flatland/src/classes/effectmaterial/#getmaxeffectfloats).
#### Returns
`number`
***
### hasEffect()
> **hasEffect**(`effectClass`): `boolean`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:359](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L359)
Check if an effect class is registered on this material.
#### Parameters
##### effectClass
*typeof* [`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)
#### Returns
`boolean`
***
### hasEventListener()
> **hasEventListener**\<`T`\>(`type`, `listener`): `boolean`
Defined in: [three.js/core/EventDispatcher:hasEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.hasEventListener)
Checks if listener is added to an event type.
#### Type Parameters
##### T
`T` *extends* `"dispose"`
#### Parameters
##### type
`T`
The type of event to listen to.
##### listener
[`EventListener`](https://threejs.org/docs/)\<`object`\[`T`\], `T`, `EffectMaterial`\>
The function that gets called when the event is fired.
#### Returns
`boolean`
#### Inherited from
`MeshBasicNodeMaterial.hasEventListener`
***
### onBeforeCompile()
> **onBeforeCompile**(`parameters`, `renderer`): `void`
Defined in: [three.js/materials/Material:onBeforeCompile](https://threejs.org/docs/#api/en/materials/Material.onBeforeCompile)
An optional callback that is executed immediately before the shader
program is compiled. This function is called with the shader source code
as a parameter. Useful for the modification of built-in materials.
This method can only be used when rendering with [WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer). The
recommended approach when customizing materials is to use `WebGPURenderer` with the new
Node Material system and [TSL](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language).
#### Parameters
##### parameters
[`WebGLProgramParametersWithUniforms`](https://threejs.org/docs/)
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
A reference to the renderer.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.onBeforeCompile`
***
### onBeforeRender()
> **onBeforeRender**(`renderer`, `scene`, `camera`, `geometry`, `object`, `group`): `void`
Defined in: [three.js/materials/Material:onBeforeRender](https://threejs.org/docs/#api/en/materials/Material.onBeforeRender)
An optional callback that is executed immediately before the material is used to render a 3D object.
This method can only be used when rendering with [WebGLRenderer](https://threejs.org/docs/#api/en/renderers/WebGLRenderer).
#### Parameters
##### renderer
[`WebGLRenderer`](https://threejs.org/docs/#api/en/renderers/WebGLRenderer)
The renderer.
##### scene
[`Scene`](https://threejs.org/docs/#api/en/scenes/Scene)
The scene.
##### camera
[`Camera`](https://threejs.org/docs/#api/en/cameras/Camera)
The camera that is used to render the scene.
##### geometry
[`BufferGeometry`](https://threejs.org/docs/#api/en/core/BufferGeometry)
The 3D object's geometry.
##### object
[`Object3D`](https://threejs.org/docs/#api/en/core/Object3D)
The 3D object.
##### group
[`Group`](https://threejs.org/docs/#api/en/objects/Group)
The geometry group data.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.onBeforeRender`
***
### registerEffect()
> **registerEffect**(`effectClass`, `constants?`): `boolean`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:273](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L273)
Register an effect class on this material.
Assigns a bit index and packed buffer slots, then rebuilds the shader.
If the effect is already registered, this is a no-op.
#### Parameters
##### effectClass
*typeof* [`MaterialEffect`](/three-flatland/api/three-flatland/src/classes/materialeffect/)
The MaterialEffect subclass to register
##### constants?
`Record`\<`string`, `unknown`\>
Optional constants from the effect instance (for provider effects)
#### Returns
`boolean`
Whether the buffer tier changed (requiring batch rebuild).
***
### removeEventListener()
> **removeEventListener**\<`T`\>(`type`, `listener`): `void`
Defined in: [three.js/core/EventDispatcher:removeEventListener](https://threejs.org/docs/#api/en/core/EventDispatcher.removeEventListener)
Removes a listener from an event type.
#### Type Parameters
##### T
`T` *extends* `"dispose"`
#### Parameters
##### type
`T`
The type of the listener that gets removed.
##### listener
[`EventListener`](https://threejs.org/docs/)\<`object`\[`T`\], `T`, `EffectMaterial`\>
The listener function that gets removed.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.removeEventListener`
***
### setDefaultValues()
> **setDefaultValues**(`material`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setDefaultValues](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setDefaultValues)
Most classic material types have a node pendant e.g. for `MeshBasicMaterial`
there is `MeshBasicNodeMaterial`. This utility method is intended for
defining all material properties of the classic type in the node type.
#### Parameters
##### material
[`Material`](https://threejs.org/docs/#api/en/materials/Material)
The material to copy properties with their values to this node material.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setDefaultValues`
***
### setup()
> **setup**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setup](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setup)
Setups the vertex and fragment stage of this node material.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setup`
***
### setupClipping()
> **setupClipping**(`builder`): [`ClippingNode`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupClipping](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupClipping)
Setups the clipping node.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`ClippingNode`](https://threejs.org/docs/)
The clipping node.
#### Inherited from
`MeshBasicNodeMaterial.setupClipping`
***
### setupDepth()
> **setupDepth**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setupDepth](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupDepth)
Setups the depth of this material.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setupDepth`
***
### setupDiffuseColor()
> **setupDiffuseColor**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setupDiffuseColor](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupDiffuseColor)
Setups the computation of the material's diffuse color.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setupDiffuseColor`
***
### setupEnvironment()
> **setupEnvironment**(`builder`): [`BasicEnvironmentNode`](https://threejs.org/docs/) \| `null`
Defined in: [three.js/materials/nodes/MeshBasicNodeMaterial:setupEnvironment](https://threejs.org/docs/#api/en/materials/nodes/MeshBasicNodeMaterial.setupEnvironment)
Overwritten since this type of material uses [BasicEnvironmentNode](https://threejs.org/docs/)
to implement the default environment mapping.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`BasicEnvironmentNode`](https://threejs.org/docs/) \| `null`
The environment node.
#### Inherited from
`MeshBasicNodeMaterial.setupEnvironment`
***
### setupFog()
> **setupFog**(`builder`, `outputNode`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupFog](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupFog)
Setup the fog.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
##### outputNode
[`Node`](https://threejs.org/docs/)
The existing output node.
#### Returns
[`Node`](https://threejs.org/docs/)
The output node.
#### Inherited from
`MeshBasicNodeMaterial.setupFog`
***
### setupHardwareClipping()
> **setupHardwareClipping**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setupHardwareClipping](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupHardwareClipping)
Setups the hardware clipping if available on the current device.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setupHardwareClipping`
***
### setupLighting()
> **setupLighting**(`builder`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupLighting](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupLighting)
Setups the outgoing light node.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`Node`](https://threejs.org/docs/)
The outgoing light node.
#### Inherited from
`MeshBasicNodeMaterial.setupLighting`
***
### setupLightingModel()
> **setupLightingModel**(): [`BasicLightingModel`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/MeshBasicNodeMaterial:setupLightingModel](https://threejs.org/docs/#api/en/materials/nodes/MeshBasicNodeMaterial.setupLightingModel)
Setups the lighting model.
#### Returns
[`BasicLightingModel`](https://threejs.org/docs/)
The lighting model.
#### Inherited from
`MeshBasicNodeMaterial.setupLightingModel`
***
### setupLightMap()
> **setupLightMap**(`builder`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupLightMap](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupLightMap)
Setups the light map node from the material.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`Node`](https://threejs.org/docs/)
The light map node.
#### Inherited from
`MeshBasicNodeMaterial.setupLightMap`
***
### setupLights()
> **setupLights**(`builder`): [`LightsNode`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupLights](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupLights)
Setups the lights node based on the scene, environment and material.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`LightsNode`](https://threejs.org/docs/)
The lights node.
#### Inherited from
`MeshBasicNodeMaterial.setupLights`
***
### setupModelViewProjection()
> **setupModelViewProjection**(): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupModelViewProjection](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupModelViewProjection)
Setups the position in clip space.
#### Returns
[`Node`](https://threejs.org/docs/)
The position in view space.
#### Inherited from
`MeshBasicNodeMaterial.setupModelViewProjection`
***
### setupNormal()
> **setupNormal**(): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupNormal](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupNormal)
Setups the normal node from the material.
#### Returns
[`Node`](https://threejs.org/docs/)
The normal node.
#### Inherited from
`MeshBasicNodeMaterial.setupNormal`
***
### setupObserver()
> **setupObserver**(`builder`): [`NodeMaterialObserver`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupObserver](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupObserver)
Setups a node material observer with the given builder.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`NodeMaterialObserver`](https://threejs.org/docs/)
The node material observer.
#### Inherited from
`MeshBasicNodeMaterial.setupObserver`
***
### setupOutgoingLight()
> **setupOutgoingLight**(): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupOutgoingLight](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupOutgoingLight)
Setups the outgoing light node variable
#### Returns
[`Node`](https://threejs.org/docs/)
The outgoing light node.
#### Inherited from
`MeshBasicNodeMaterial.setupOutgoingLight`
***
### setupOutput()
> **setupOutput**(`builder`, `outputNode`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupOutput](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupOutput)
Setups the output node.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
##### outputNode
[`Node`](https://threejs.org/docs/)
The existing output node.
#### Returns
[`Node`](https://threejs.org/docs/)
The output node.
#### Inherited from
`MeshBasicNodeMaterial.setupOutput`
***
### setupPosition()
> **setupPosition**(`builder`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupPosition](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupPosition)
Setups the computation of the position in local space.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`Node`](https://threejs.org/docs/)
The position in local space.
#### Inherited from
`MeshBasicNodeMaterial.setupPosition`
***
### setupPositionView()
> **setupPositionView**(`builder`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupPositionView](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupPositionView)
Setups the position node in view space. This method exists
so derived node materials can modify the implementation e.g. sprite materials.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`Node`](https://threejs.org/docs/)
The position in view space.
#### Inherited from
`MeshBasicNodeMaterial.setupPositionView`
***
### setupPremultipliedAlpha()
> **setupPremultipliedAlpha**(`builder`, `outputNode`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupPremultipliedAlpha](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupPremultipliedAlpha)
Setups premultiplied alpha.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
##### outputNode
[`Node`](https://threejs.org/docs/)
The existing output node.
#### Returns
[`Node`](https://threejs.org/docs/)
The output node.
#### Inherited from
`MeshBasicNodeMaterial.setupPremultipliedAlpha`
***
### setupVariants()
> `abstract` **setupVariants**(`builder`): `void`
Defined in: [three.js/materials/nodes/NodeMaterial:setupVariants](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupVariants)
Abstract interface method that can be implemented by derived materials
to setup material-specific node variables.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setupVariants`
***
### setupVertex()
> **setupVertex**(`builder`): [`Node`](https://threejs.org/docs/)
Defined in: [three.js/materials/nodes/NodeMaterial:setupVertex](https://threejs.org/docs/#api/en/materials/nodes/NodeMaterial.setupVertex)
Setups the logic for the vertex stage.
#### Parameters
##### builder
[`NodeBuilder`](https://threejs.org/docs/)
The current node builder.
#### Returns
[`Node`](https://threejs.org/docs/)
The position in clip space.
#### Inherited from
`MeshBasicNodeMaterial.setupVertex`
***
### setValues()
> **setValues**(`values?`): `void`
Defined in: [three.js/materials/nodes/MeshBasicNodeMaterial:setValues](https://threejs.org/docs/#api/en/materials/nodes/MeshBasicNodeMaterial.setValues)
#### Parameters
##### values?
[`MeshBasicNodeMaterialParameters`](https://threejs.org/docs/)
#### Returns
`void`
#### Inherited from
`MeshBasicNodeMaterial.setValues`
***
### toJSON()
> **toJSON**(`meta?`): [`MaterialJSON`](https://threejs.org/docs/)
Defined in: [three.js/materials/Material:toJSON](https://threejs.org/docs/#api/en/materials/Material.toJSON)
Serializes the material into JSON.
#### Parameters
##### meta?
[`JSONMeta`](https://threejs.org/docs/)
An optional value holding meta information about the serialization.
#### Returns
[`MaterialJSON`](https://threejs.org/docs/)
A JSON object representing the serialized material.
#### See
ObjectLoader#parse
#### Inherited from
`MeshBasicNodeMaterial.toJSON`
***
### getMaxEffectFloats()
> `static` **getMaxEffectFloats**(): `number`
Defined in: [packages/three-flatland/src/materials/EffectMaterial.ts:185](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/materials/EffectMaterial.ts#L185)
Return the maximum number of per-instance effect floats this
material type supports. See [MAX\_EFFECT\_FLOATS](/three-flatland/api/three-flatland/src/classes/sprite2dmaterial/#max_effect_floats).
#### Returns
`number`
# Flatland
Defined in: [packages/three-flatland/src/Flatland.ts:162](https://github.com/thejustinwalsh/three-flatland/blob/main/packages/three-flatland/src/Flatland.ts#L162)
Flatland - Unified 2D rendering pipeline for Three.js WebGPU.
Combines sprite batching, post-processing, render targets, and global uniforms
into a single high-level API. Implements WorldProvider — one ECS world per Flatland
instance, shared between sprite batching and post-processing passes.
## Examples
```typescript
// Basic usage - render to viewport
const flatland = new Flatland({ viewSize: 400 })
flatland.add(new Sprite2D({ texture }))
// Render loop
function animate() {
flatland.render(renderer)
requestAnimationFrame(animate)
}
```
```typescript
// Render to texture
import { RenderTarget } from 'three'
const target = new RenderTarget(512, 512)
const flatland = new Flatland({ renderTarget: target })
flatland.add(sprite)
// Use texture on 3D mesh
mesh.material.map = flatland.texture
// Render loop
flatland.render(renderer) // Renders to target
renderer.render(scene3D, camera3D) // Renders 3D with card
```
```tsx
// React Three Fiber usage
import { Canvas, extend, useFrame, useThree } from '@react-three/fiber/webgpu'
import { Flatland, Sprite2D } from 'three-flatland/react'
extend({ Flatland, Sprite2D })
function Scene() {
const flatlandRef = useRef