Sprite2DMaterialOptions
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:223
Properties
Section titled “Properties”alphaTest?
Section titled “alphaTest?”
optionalalphaTest?:number
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:226
colorTransform?
Section titled “colorTransform?”
optionalcolorTransform?:ColorTransformFn
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:250
Color transform function for custom effects (e.g., lighting)
effectsKey?
Section titled “effectsKey?”
optionaleffectsKey?:string
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:254
Effect configuration key for material caching/batching
effectTier?
Section titled “effectTier?”
optionaleffectTier?:number
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:248
Effect buffer tier size in floats. Buffers are allocated in tiers: 0, 4, 8, 16. Default is 8 (2 vec4 buffers), covering most effect combinations. Set to 0 for fully effect-free materials (no effect buffer overhead).
globalUniforms?
Section titled “globalUniforms?”
optionalglobalUniforms?:GlobalUniforms
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:252
Global uniforms for auto-applying tint, time, etc.
optionallit?:boolean
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:232
Whether sprites using this material receive lighting. Part of the
material identity (batching) key — lit and unlit sprites can’t share
a batch. Default false.
optionalmap?:Texture<unknown,TextureEventMap>
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:224
premultipliedAlpha?
Section titled “premultipliedAlpha?”
optionalpremultipliedAlpha?:boolean
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:241
Use premultiplied alpha blending.
When true, the shader outputs vec4(rgb * alpha, alpha) and uses
CustomBlending with OneFactor / OneMinusSrcAlphaFactor.
This eliminates Discard() calls, improving performance on WebGL
by preserving early-z optimization. Depth writes are disabled since
transparent pixels produce (0,0,0,0) which blends to nothing.
transparent?
Section titled “transparent?”
optionaltransparent?:boolean
Defined in: packages/three-flatland/src/materials/Sprite2DMaterial.ts:225