Skip to main content

Class: SeeThroughTexelSplit

Splits a see-through mesh's texels by their alpha (see TexelPlan). Solid texels hide what is behind them, so they draw with the depth writers, and the depth they leave hides the blended layers behind them; translucent texels tint what is behind, so they blend and write nothing. One material fork per side carries the cut, made once per material.

Constructors​

constructor​

• new SeeThroughTexelSplit(cuts, fork): SeeThroughTexelSplit

Parameters​

NameTypeDescription
cutsTexelAlphaCuts-
fork(material: Material) => MaterialA copy of a material that keeps its live uniforms and textures.

Returns​

SeeThroughTexelSplit

Properties​

cuts​

• Readonly cuts: TexelAlphaCuts

Methods​

apply​

▸ apply(mesh, base, plan): Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>

Points mesh at the draws plan asks for, base being the material it was built with. The child that draws translucent texels is made the first time a split needs it and hidden, never disposed, when a later plan does not: it draws from the mesh's own buffers.

Parameters​

NameType
meshMesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>
baseMaterial
planTexelPlan

Returns​

Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>


forget​

▸ forget(material): void

Drops material's forks: its shader changed, and they copied the old.

Parameters​

NameType
materialMaterial

Returns​

void


forksOf​

▸ forksOf(material): TexelForks

Parameters​

NameType
materialMaterial

Returns​

TexelForks


layerOf​

▸ layerOf(mesh): Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>

The child that draws mesh's translucent texels, once one was made.

Parameters​

NameType
meshMesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>

Returns​

Mesh<BufferGeometry<NormalBufferAttributes, BufferGeometryEventMap>, Material | Material[], Object3DEventMap>