Loads and prepares mesh data for rendering. Sets up VBO (Vertex Buffer Object) and VAO (Vertex Array Object) if not already done.
The mesh component containing the mesh to load
True if the mesh was loaded successfully, false otherwise
Re-sets up shader program for the material using updated shader sources from Spector.js. This method is specifically designed for shader debugging and live editing scenarios.
The material to re-setup shader program for
The primitive geometry associated with the shader
The updated shader source code
Callback function to handle compilation errors
The CGAPIResourceHandle of the updated shader program, or InvalidCGAPIResourceUid on failure
Attaches GPU data for the primitive. This method is part of the CGAPIStrategy interface but is a no-op in uniform strategy as GPU data is handled differently through data textures.
The primitive to attach GPU data for
Attaches vertex data for rendering. This method is part of the CGAPIStrategy interface but is a no-op in uniform strategy as vertex data attachment is handled in attachVertexDataInner.
Index parameter (unused in uniform strategy)
The primitive containing vertex data
WebGL context wrapper
Instance ID buffer handle (unused in uniform strategy)
Internal method to attach vertex data for a specific mesh and primitive. Binds the appropriate VAO or sets up vertex data pipeline for rendering.
The mesh containing vertex data
The primitive geometry to render
Unique identifier for the primitive
WebGL context wrapper
Instance ID buffer handle (unused in uniform strategy)
Common rendering method that handles the main rendering pipeline. Processes primitives in different rendering phases: opaque, translucent, blend with/without Z-write. Supports buffer-less rendering mode for special cases like post-processing effects.
Array of primitive UIDs to render, sorted by rendering order
The render pass configuration containing rendering settings
Current tick count for the render pass
True if any primitives were rendered, false otherwise
Detaches vertex data and cleans up OpenGL state after rendering. Unbinds VAO, element array buffer, and array buffer to prevent state leakage.
WebGL context wrapper used for state cleanup
Internal rendering method for processing individual primitives. Handles shader setup, material parameters, lighting, VR rendering, and draw calls for each mesh entity associated with the primitive.
Unique identifier of the primitive to render
WebGL context wrapper
The render pass configuration
Current tick count for the render pass
True if the primitive was rendered successfully, false otherwise
Sets up shader program for the given material and primitive in this WebGL strategy. Creates a new shader program if needed and configures uniform locations for rendering.
The CGAPIResourceHandle of the created or existing shader program
Static
getGets the singleton instance of WebGLStrategyUniform. Initializes the instance and WebXR system if not already created.
The singleton instance of WebGLStrategyUniform
WebGL rendering strategy implementation using uniform-based approach. This strategy uses uniforms to pass per-object data to shaders instead of vertex attributes, which is more suitable for rendering multiple objects with different properties.
Implements
Implements