Geometry constructor
parameters used to create our Geometry.
Number of vertices defined by this geometry.
Vertices order to be drawn by the render pipeline.
Number of instances of this geometry to draw.
Array of vertex buffers to use with this geometry.
Options used to create this geometry.
The type of the geometry.
The universal unique id of the geometry.
Allow to draw this Geometry with an IndirectBuffer if set.
The bounding box of the geometry, i.e. two Vec3 defining the min and max positions to wrap this geometry in a cube.
A string to append to our shaders code describing the WGSL structure representing this geometry attributes.
A string representing the vertexBuffers layout, used for pipelines caching.
A Set to store this Geometry consumers (Mesh uuid).
Whether this geometry is ready to be drawn, i.e. it has been computed and all its vertex buffers have been created.
Get whether this Geometry is ready to compute, i.e. if its first vertex buffer array has not been created yet.
StaticdequantizeHelper to decode and normalize integer values to float values based on the data type.
TypedArrayConstructor used to know the data type.
Reset all the vertex buffers when the device is lost.
Add a vertex buffer to our Geometry, set its attributes and return it.
Vertex buffer parameters.
Get a vertex buffer by name.
Our vertex buffer name.
Set a vertex buffer attribute.
Attributes parameters.
Get an attribute by name.
Name of the attribute to find.
Compute Geometry flat normals in case the normal attribute is missing.
Compute a Geometry, which means iterate through all vertex buffers and create the attributes array that will be sent as buffers. Also compute the Geometry bounding box.
Set the layoutCacheKey and WGSL code snippet that will be appended to the vertex shader.
Upload a GeometryBuffer to the GPU.
Renderer used to upload the buffer.
GeometryBuffer holding a Buffer and a typed array to upload.
Set the indirectDraw parameters to draw this Geometry with an IndirectBuffer.
indirect draw parameters to use for this Geometry.
Set our render pass geometry vertex buffers.
Current render pass.
Draw our geometry. Can use indirect drawing if indirectDraw is set up.
current render pass.
Set our vertex buffers then draw the geometry.
current render pass.
Used to create a Geometry from given parameters like instances count or geometry attributes (vertices, uvs, normals).
Holds all attributes arrays, bounding box and create as WGSL code snippet for the vertex shader input attributes.
During the render, the Geometry is responsible for setting the vertexBuffers and drawing the vertices.
Example