OptionalattributesA prebuilt attribute map, keyed by shader attribute name
Use it to supply your own buffers or interleaved layout. The names the other options fill are
aPosition, aUV, aNormal, aTangent, aJoints, aWeights, aColor and aColor1.
With a map, the per-attribute options build nothing, so pass bounds3D too: a geometry with
empty bounds is never culled, and picking never hits it.
Optionalbounds3The geometry's local bounding box; computed from float positions when omitted
Pass it when you already know the box, to skip scanning the positions. Integer positions throw
without it, and need it in the values their format reads as: within -1 to 1 for snorm16x4,
the stored integers for sint16x4.
OptionalcolorsVertex colours, four components per vertex (RGBA)
A Float32Array is used as floats; an integer array is read as normalized, 0 to 1. Widen RGB
colours to RGBA with an opaque alpha first. BaseMaterial3D#vertexColors decides whether
they tint.
Optionalcolors1A second set of vertex colours, read as aColor1, with the same rules as colors
Materials never tint with it; only a custom shader bit that declares aColor1 reads it, which
makes it the place for data that isn't really a colour, such as a wind mask.
OptionaldynamicDraw the geometry from its own buffers, so later writes to them reach the screen
Set it when you rewrite the vertices every frame, as a trail or a particle system does. A dynamic geometry is never frustum-culled. Fixed at construction.
Put v = 0 on the top edge instead of the bottom, so an image texture shows the right way up
Set it when the plane shows a picture, which otherwise renders upside down. Only the UVs change.
The height of the plane along the local Y axis
Subdivision count along the height (Y axis)
Floored, and clamped to a minimum of 1.
OptionalindexHow many indices to draw, when that is fewer than the index buffer holds
0 draws the whole buffer. Only a dynamic geometry honours it; any other draws its whole
index buffer. Use it to draw a prefix of an index buffer several geometries share.
OptionalindicesVertex indices, three per triangle for the default triangle-list topology
Left out, the vertices are drawn in order. A Uint16Array of odd length is copied into a
Uint32Array. A Buffer is used as it is, so several geometries can share one.
OptionalinterleaveWhether to pack the attributes into one interleaved buffer
Only a dynamic geometry draws from its own buffers; for any other, this changes how its own
data is laid out, not how it draws. Per-triangle picking, a
hitVolume of 'geometry', never hits an interleaved geometry.
OptionaljointsFour bone indices per vertex, for skinning
OptionalmorphMorph targets (blend shapes), each a set of per-vertex offsets from positions
A Mesh3D drawing the geometry blends the targets by its Mesh3D#weights.
Normal offsets are used only when every target has them. A geometry morphs in one renderer
only: once a second renderer draws it, even a new Application made after the first is
destroyed, it draws unmorphed from then on and warns once.
Culling allows for weights from 0 to 1. For weights outside that range, pass a larger
bounds3D.
Optionalnormals?: Float32Array<ArrayBufferLike>Offsets from the base normals, three floats per vertex
Offsets from the base positions, three floats per vertex
OptionalnormalsVertex normals, three floats per vertex
Without them the geometry shades as if every normal were (0, 0, 1), which suits unlit
billboards and ribbons. quantizeNormals decides how they are stored.
OptionalpositionsVertex positions, three floats per vertex
Integer positions come in as an Attribute, since only its format says how to read them:
snorm as -1 to 1, unorm as 0 to 1, and sint or uint as the stored integers. An integer
typed array throws. Pad 8- and 16-bit xyz to four components per vertex, and pass bounds3D.
OptionalquantizeWhether to store Float32Array normals as 16-bit signed integers
They then take 8 bytes per vertex instead of 12, with negligible visual difference. Read them back as floats with getAttributeData.
OptionalquantizeWhether to store Float32Array tangents as 16-bit signed integers
They then take 8 bytes per vertex instead of 16, with negligible visual difference. Read them back as floats with getAttributeData.
OptionalshrinkWhether the geometry's own GPU buffers may shrink to fit their data when it gets smaller
OptionaltangentsVertex tangents, four floats per vertex: the tangent direction, then 1 or -1 for which way
the bitangent points
Normal maps use them when present and otherwise derive a tangent frame per pixel.
quantizeTangents decides how they are stored.
OptionaltopologyPrimitive topology used when drawing the mesh
OptionaluvsTexture coordinates, two floats per vertex
Integer coordinates come in as an Attribute, read as integer positions are: unorm16x2 as
0 to 1, uint16x2 as the stored integers, which the material's
BaseMaterial3D#uvTransform has to scale back down.
OptionalweightsFour bone weights per vertex, matching joints
A Float32Array is used as floats; an integer array is read as normalized, 0 to 1.
The width of the plane along the local X axis
Subdivision count along the width (X axis)
Floored, and clamped to a minimum of 1.
Options for PlaneGeometry
Example