Skip to content
Work in progress. These docs describe Spawnite at launch, and some parts are still being built.

usePixelMaterial

usePixelMaterial(texture, pixelMaterialOptions?): MeshLambertMaterial

A Lambert material that lays a pixel texture in world space, at its texels per metre, on whichever world plane each face is most turned to, and varies it per metre so its repeat never shows. Its normal map turns with its colour, and it takes the scene’s light and fog. For faceted, standing geometry such as terrain blocks and walls: a moving mesh would slide under its texture, and a curved one seams where its plane changes, so those take usePixelTexture on their UVs. Shared by every view that names the same texture and options, so a change to it changes it for each of them.

Parameter Type
texture PixelTexture
pixelMaterialOptions PixelMaterialOptions

MeshLambertMaterial