Creates a new CustomMaterialContent instance with custom shaders and configuration.
Configuration object for the custom material
Array of additional shader semantic information
Optional
definitions?: string[]Optional array of preprocessor definitions for shaders
Whether this material uses lighting calculations
Whether this material supports vertex morphing/blending
Whether this material supports skeletal animation skinning
The name identifier for this material content
Optional
pixelOptional pixel/fragment shader object for WebGL rendering
Optional
pixelOptional pixel/fragment shader object for WebGPU rendering
Optional
vertexOptional vertex shader object for WebGL rendering
Optional
vertexOptional vertex shader object for WebGPU rendering
Protected
__definitionsProtected
__materialProtected
__semanticsCollection of tags associated with this object
Static
Readonly
InvalidInvalid object UID constant
Protected
Static
Optional
__glProtected
Static
__tmp_Protected
Static
__tmp_Static
currentCurrent maximum object count for UID generation
Static
materialGets the shader semantics information array for this material.
Array of shader semantics information
Checks if this material supports lighting calculations.
True if lighting is enabled
Checks if this material supports morph target animation.
True if morphing is enabled
Checks if this material supports skeletal animation.
True if skinning is enabled
Gets the unique object identifier
The object's UID
Gets the pixel shader object associated with this material.
The pixel shader object or undefined if not set
Gets the unique name of this object
The unique name string
Gets the vertex shader object associated with this material.
The vertex shader object or undefined if not set
Internal
Copies tag data from another RnObject instance to this object
The source RnObject to copy tags from
Sets internal material parameters for WebGL rendering on a per-material basis. Configures world/view/projection matrices, lighting, skinning, and IBL parameters.
Parameters object
WebGL rendering arguments containing matrices, entities, and rendering context
Whether this is the first time setting up this material
The material instance to configure
The WebGL shader program to use
Sets internal parameters for WebGL rendering on a per-primitive basis. Handles morph target/blend shape information for vertex animation.
Parameters object
WebGL rendering arguments containing entity, mesh, and primitive data
Whether this is the first time setting up this primitive
The material instance to configure
The WebGL shader program to use
Sets internal parameters for WebGL rendering on a per-shader-program basis. Primarily handles IBL environment texture setup including diffuse, specular, and sheen cube maps.
Parameters object
WebGL rendering arguments containing cube map textures and rendering context
Whether this is the first time setting up this shader program
The material instance to configure
The WebGL shader program to use
Sets internal material parameters for WebGPU rendering, including IBL parameters and HDRI format information.
Parameters object
WebGPU rendering arguments containing entity and rendering context
The material instance to configure
Protected
doPerforms shader reflection to extract semantics information from vertex and pixel shaders.
The vertex shader object for WebGL
The pixel shader object for WebGL
The vertex shader object for WebGPU
The pixel shader object for WebGPU
Array of shader definitions
Array of shader semantics information
Checks if this object has all the specified tags with exactly matching values
Object containing tag names as keys and expected values
True if all specified tags exist with matching values, false otherwise
Checks if the object's combined tag string contains all the provided search strings. This allows for flexible searching within tag names and values.
Array of strings that must all be present in the combined tag string
True if all strings are found in the combined tag string, false otherwise
Protected
setProtected
setSets lighting information uniforms in the shader.
The WebGL shader program
Array of light components
The material instance
Whether to set uniform values
Sets morph target animation uniforms in the shader.
The WebGL shader program
The mesh component
The primitive containing morph targets
Optional
blendShapeComponent: BlendShapeComponentThe blend shape component containing weights
Protected
setSets the normal transformation matrix uniform in the shader.
The WebGL shader program
The normal transformation matrix
Protected
setProtected
setSets the projection matrix uniform in the shader.
The WebGL shader program
The camera component
Whether rendering in VR mode
The display index for VR rendering
Sets the shader semantics information array for this material.
Array of shader semantics information to set
Protected
setSets skeletal animation uniforms in the shader.
The WebGL shader program
Whether to set uniform values
Optional
skeletalComponent: SkeletalComponentThe skeletal component containing bone data
Protected
setProtected
setSets view-related uniforms including view matrix and camera position.
The WebGL shader program
The camera component
Whether rendering in VR mode
The display index for VR rendering
Protected
setSets the world transformation matrix uniform in the shader.
The WebGL shader program
The world transformation matrix
Protected
setupSets up basic rendering information including matrices, camera, and lighting.
WebGL rendering arguments
The WebGL shader program
Whether this is the first time setup
The material instance
The camera component class
Attempts to set a tag on this object. If the tag already exists, it will be replaced.
The tag object containing the name and value to set
True if the tag was successfully set, false if the tag name contains invalid characters
Attempts to set a unique name for this object
The desired unique name
If true, appends UID to make name unique when conflicts occur; if false, fails on conflict
True if the name was successfully set, false if there was a conflict and toAddNameIfConflict was false
Static
_resetStatic
getRetrieves a material node by its unique identifier.
The unique identifier of the material node
The material node instance
Static
getStatic
getStatic
searchSearches for the first object that has a specific tag with the given value
The tag name to search for
The tag value to match
WeakRef to the first matching object, or undefined if not found
Custom material content class that extends AbstractMaterialContent to provide custom shader handling and rendering capabilities with support for IBL (Image-Based Lighting), morphing, skinning, and various shader semantics.