Loads and prepares a mesh component for rendering. Sets up vertex buffer objects (VBO) and vertex array objects (VAO) if not already done.
The mesh component to load
True if the mesh was successfully loaded, false if the mesh is null
Main rendering method that draws all primitives in the specified render pass. Handles different primitive types (opaque, translucent, blend) with appropriate depth writing settings.
Array of primitive UIDs to render, sorted by rendering order
The render pass configuration containing rendering settings
Current tick count for animation and timing purposes
True if any primitives were successfully rendered
Renders a single primitive with the specified material and render settings. Handles shader setup, uniform buffer updates, and the actual draw call.
Unique identifier of the primitive to render
Render pass containing rendering configuration
Whether to enable depth buffer writing
True if the primitive was successfully rendered
Renders a render pass using pre-built render bundles for improved performance. Render bundles allow WebGPU to optimize command encoding by pre-recording draw commands.
The render pass to execute
True if the render bundle was successfully executed
Sets up shader programs for materials using the WebGPU rendering strategy. This method orchestrates the shader compilation process by providing the necessary method definitions and property setters.
The material to create shader programs for
The primitive geometry that will use this material
WGSL code containing vertex shader helper methods
Function to generate property accessor methods
Static
getGets the singleton instance of WebGpuStrategyBasic. Creates a new instance if none exists.
The singleton instance of WebGpuStrategyBasic
Static
getGenerates vertex shader method definitions for storage buffer access. These methods provide standardized access to transform matrices, visibility flags, and morphing functionality in vertex shaders.
WGSL shader code containing helper functions for storage buffer access
Basic WebGPU rendering strategy implementation that handles mesh rendering, storage buffer management, and shader program setup for WebGPU-based rendering pipeline.
This class provides a complete rendering solution using WebGPU API, including:
Example