Create a new MeshRenderBehavior.
The mesh data (vertices and indices/faces generated for example, by the ObjLoader)
The URL of the texture image (will automatically load the texture in the GPU)
The vertex shader in WGSL (source code in string). Ensure that the shader has a uniform mat4 mvpMatrix and is compatible with the layout.
The fragment shader in WGSL (source code in string). Ensure that the shader has a texture and sampler and is compatible with the layout.
Sampler configuration, by default : Not repeat with linear filter
Protected_bindProtected_bindProtected_indexProtected_indexProtected_mvpProtected_pipelineProtected_renderProtected_spriteProtected_vertexProtectedasyncProtectedCalled when the rendering is ready (device is available).
Detach this behavior from the GameObject it is attached to.
The GameObject to detach this behavior from.
ProtectedobserveProtectedObserve a LogicBehavior and call the observer function when the data changes.
ProtectedonProtectedonRender the object to the screen. Pipeline and MVP uniform are set by RenderEngine.
The render pass to render to
Like onEnable, but should only be for internal use, so some non-abstact direct behaviors could expose attachedOn to the user.
The GameObject this behavior is attached to.
ProtectedtickProtectedCalled every frame. Override this method to add custom behavior.
The time in seconds since the last frame.
A RenderBehavior that renders a mesh with a texture. Supports both traditional triangle indices and N-gon faces.