Class: Mesh

Mesh

Base mesh class.

This class empowers you to have maximum flexibility to render any kind of WebGL/WebGPU visuals you can think of. This class assumes a certain level of WebGL/WebGPU knowledge. If you know a bit this should abstract enough away to make your life easier!

Pretty much ALL WebGL/WebGPU can be broken down into the following:

  • Geometry - The structure and data for the mesh. This can include anything from positions, uvs, normals, colors etc..
  • Shader - This is the shader that PixiJS will render the geometry with (attributes in the shader must match the geometry)
  • State - This is the state of WebGL required to render the mesh.

Through a combination of the above elements you can render anything you want, 2D or 3D!

new Mesh (…args) Deprecated`` : since 8.0.0

Name Type Description
args [MeshOptions<SHADER, GEOMETRY>] | [GEOMETRY, SHADER, unknown, unknown]

Members

geometry

Includes vertex positions, face indices, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU. Can be shared between multiple Mesh objects.

material

Alias for shader.

roundPixels

Whether or not to round the x/y position of the mesh.

shader

Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Mesh objects.

texture

The texture that the Mesh uses. Null for non-MeshMaterial shaders