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
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
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.
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.
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
Deletes the current data texture and frees associated GPU resources. This method should be called when the data texture needs to be recreated or when cleaning up resources.
Destroys all GPU resources held by this strategy. Should be called when the engine is being destroyed.
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
Performs pre-rendering setup operations. Initializes light components, sets up data texture for GPU vertex data, and prepares global rendering state.
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
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
StaticinitGets 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