MeshBaseClass constructor
our Renderer class object
a DOM HTML Element that can be bound to a Mesh
The type of the MeshBaseClass
Readonly
uuidThe universal unique id of the MeshBaseClass
Readonly
indexIndex of this MeshBaseClass, i.e. creation order
The Renderer used
Options used to create this MeshBaseClass
RenderMaterial used by this MeshBaseClass
Geometry used by this MeshBaseClass
RenderTarget to render this Mesh to instead of the canvas context, if any.
Controls the order in which this MeshBaseClass should be rendered by our Scene
Whether this MeshBaseClass should be treated as transparent. Impacts the render pipeline blend properties
Flag indicating whether to draw this MeshBaseClass or not
Flag indicating whether this MeshBaseClass is ready to be drawn
Empty object to store any additional data or custom properties into your Mesh.
function assigned to the onReady callback
function assigned to the onReady callback
function assigned to the onBeforeRender callback
function assigned to the onBeforeRender callback
function assigned to the onRender callback
function assigned to the onRender callback
function assigned to the onAfterRender callback
function assigned to the onAfterRender callback
function assigned to the onAfterResize callback
function assigned to the onAfterResize callback
callback to run when MeshBaseClass is ready
Callback to execute before updating the Scene matrix stack. This means it is called early and allows to update transformations values before actually setting the Mesh matrices (if any). This also means it won't be called if the Mesh has not been added to the Scene. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to execute before updating the Scene matrix stack. This means it is called early and allows to update transformations values before actually setting the Mesh matrices (if any). This also means it won't be called if the Mesh has not been added to the Scene. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
callback to run just before updating the Scene matrix stack.
Callback to execute right before actually rendering the Mesh. Useful to update uniforms for example. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to execute right before actually rendering the Mesh. Useful to update uniforms for example. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
callback to run just before rendering the MeshBaseClass.
Callback to execute just after a Mesh has been rendered. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
Callback to execute just after a Mesh has been rendered. The callback won't be called if the Renderer is not ready or the Mesh itself is neither ready nor visible.
callback to run just after MeshBaseClass has been rendered
Callback to execute just after a Mesh has been resized.
Callback to execute just after a Mesh has been resized.
callback to run just after MeshBaseClass has been resized
Get private #autoRender value
Get/set whether a Mesh is ready or not
Get the transparent property value
Set the transparent property value. Update the RenderMaterial rendering options and Scene stack if needed.
new transparency value
Get the visible property value
Set the visible property value
new visibility value
Get our RenderMaterial domTextures array
Get our RenderMaterial textures array
Get the current RenderMaterial uniforms
Get the current RenderMaterial storages
Add a Mesh to the renderer and the Scene
Remove a Mesh from the renderer and the Scene
Set a new Renderer for this Mesh
new Renderer to set
Called when the device has been lost to prepare everything for restoration. Basically set all the GPUBuffer to null so they will be reset next time we try to draw the Mesh
Called when the device has been restored
Set or update the Mesh Geometry
Set or update the RenderMaterial rendering options to match the RenderPass descriptor used to draw this Mesh.
RenderPass used to draw this Mesh, default to the renderer renderPass.
Hook used to clean up parameters before sending them to the material.
parameters to clean before sending them to the RenderMaterial
Set or update the Mesh RenderMaterial
new RenderMaterial to use
Set a Mesh transparent property, then set its material
Create a new DOMTexture
Add a DOMTexture
DOMTexture to add
Callback run when a new DOMTexture has been created
newly created DOMTexture
Create a new Texture
Add a Texture
Assign or remove a RenderTarget to this Mesh Since this manipulates the Scene stacks, it can be used to remove a RenderTarget as well.
the RenderTarget to assign or null if we want to remove the current RenderTarget
Resize the Mesh's textures
Optional
boundingRect: DOMElementBoundingRectExecute onBeforeRender callback if needed. Called by the Scene before updating the matrix stack.
Called before rendering the Mesh Set the geometry if needed (create buffers and add attributes to the RenderMaterial) Then executes RenderMaterial#onBeforeRender: create its bind groups and pipeline if needed and eventually update its bindings
Render our MeshBaseClass if the RenderMaterial is ready
current render pass encoder
Render our Mesh
current render pass encoder
Remove the Mesh from the Scene and destroy it
This class describes the properties and methods to set up a basic Mesh, implemented in the MeshBaseMixin: