Optional
__webglGets the vertex shader body code. Currently returns an empty string as classic shading is performed in the fragment shader.
Static
__instanceStatic
Readonly
materialThe material element type associated with this shader
Gets the composition types for vertex attributes required by this shader. Classic shading doesn't require additional vertex attribute compositions.
Empty array as no additional attribute compositions are needed
Gets the attribute names required by this shader. Classic shading doesn't require additional vertex attributes beyond the standard ones.
Empty array as no additional attributes are needed
Gets the vertex attribute semantics required by this shader. Classic shading doesn't require additional vertex attribute semantics.
Empty array as no additional attribute semantics are needed
Gets the pixel (fragment) shader body code. Currently returns an empty string as the main shading logic is defined in pixelShaderDefinitions.
Empty string for pixel shader body
Gets the pixel (fragment) shader definitions including uniforms, structs, and the main shading function. Defines the classic shading function that supports multiple lighting models:
GLSL code string containing shader definitions and the classicShading function
Gets the vertex shader definitions. Currently returns an empty string as classic shading calculations are performed in the fragment shader.
Empty string for vertex shader definitions
Static
getGenerates variable assignment statement with proper type declaration. Creates appropriate syntax for both WebGL (GLSL) and WebGPU (WGSL) based on the current process approach.
The name of the variable to declare
The socket containing type and default value information
The variable assignment statement string
Static
getGenerates varying variable assignment statement for fragment/pixel shaders. Creates code to read varying variables passed from vertex shader with proper type declaration.
The name of the variable to declare
The socket containing type information
The shader node that provides the varying variable
The varying variable assignment statement string for fragment shader
Static
getGenerates varying variable assignment statement for vertex shaders. Creates code to write varying variables that will be passed to fragment shader.
The shader node that provides the varying variable
Array of variable names to assign
Index of the current variable in the varNames array
The varying variable assignment statement string for vertex shader
Static
getGets the singleton instance of ClassicShadingShader. Creates a new instance if one doesn't exist.
The singleton instance of ClassicShadingShader
Static
getGenerates the main function beginning code for vertex or fragment shaders. Handles differences between WebGL (GLSL) and WebGPU (WGSL) shader languages.
True if generating code for vertex shader, false for fragment shader
The shader code string for the main function beginning
Static
getGenerates the main function ending code for vertex or fragment shaders. Handles differences between WebGL (GLSL) and WebGPU (WGSL) shader languages.
True if generating code for vertex shader, false for fragment shader
The shader code string for the main function ending
Static
getStatic
getGenerates fragment/pixel shader prerequisites including definitions and varying variable declarations. Creates appropriate code for both WebGL (GLSL) and WebGPU (WGSL) based on the current process approach.
Array of shader nodes used to generate varying variables for WebGPU
The complete fragment shader prerequisites code string
Static
getGenerates vertex shader prerequisites including definitions, vertex inputs, and uniform declarations. Creates appropriate code for both WebGL (GLSL) and WebGPU (WGSL) based on the current process approach.
Array of shader nodes used to generate varying variables for WebGPU
The complete vertex shader prerequisites code string
A shader part that implements classic shading models including Lambert, Blinn-Phong, and Phong shading. This class provides GLSL shader code for traditional lighting calculations with support for multiple light types (directional, point, and spot lights) and different shading models.
The shader supports: