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

ShaderProps

Property Type Default value Description
fragment string undefined The fragment shader from void main() on. uTime (world seconds), uPointer (-1 to 1 across the canvas) and vUv (the mesh’s UVs) are declared before it, as is each key of uniforms.
transparent? boolean false Whether gl_FragColor.a below 1 shows what is behind the mesh. A transparent shader writes no depth, so what lies behind it still draws.
uniforms? Record<string, ShaderValue> undefined Extra uniforms by name: a number, a Vector2, a Vector3, a Color or a Texture, each declared for the fragment and copied to it every frame.