Static
fillFills template placeholders in a shader object with provided arguments and WebGL-specific parameters. This method performs a two-step template filling process: first with user-provided arguments, then with WebGL resource repository specific parameters.
The shader object containing template placeholders to be filled
Key-value pairs of template arguments to fill in the shader
A new ShaderityObject with all template placeholders replaced
Static
getExtracts vertex attribute information from a shader object using reflection. This method analyzes the shader code to determine vertex attribute names, semantics, compositions, and component types required for proper vertex buffer binding.
The shader object to analyze for vertex attributes
An object containing arrays of attribute names, semantics, compositions, and components
Static
getExtracts shader uniform data and semantic information from a shader object. This method parses uniform declarations in the shader code, extracts metadata from comments, and creates semantic information objects for each uniform.
The shader object to analyze for uniform declarations
An object containing an array of shader semantic info and a modified shader object with uniforms removed
Static
transformTransforms a shader object to target a specific WebGL version (WebGL 1.0 or 2.0). This method converts GLSL code to be compatible with either GLSL ES 1.0 or 3.0 depending on the WebGL version being used.
The shader object to transform
Whether to target WebGL 2.0 (true) or WebGL 1.0 (false)
A new ShaderityObject with version-appropriate GLSL code
A utility class for processing and managing Shaderity shader objects in WebGL environments.
This class provides comprehensive functionality for shader processing including:
The class integrates with the Shaderity library to provide enhanced shader processing capabilities specifically tailored for the Rhodonite rendering engine's WebGL backend. It handles the complex process of analyzing GLSL shader code, extracting metadata from comments, and preparing shader objects for use in the rendering pipeline.
All methods are static and the class serves as a namespace for shader utility functions.
Example