Creates a new MToon 0.x material content instance.
The engine instance
Whether this material is for outline rendering
VRM material properties from the glTF file
Array of textures used by the material
Array of samplers for texture sampling configuration
Whether morphing (blend shapes) is enabled
Whether skeletal animation is enabled
Whether lighting calculations are enabled
Whether to use tangent attributes for normal mapping
Debug visualization mode (optional)
Whether to convert output to sRGB color space
Name identifier for the material
Additional shader preprocessor definitions
Protected__Protected__Protected__Protected Optional_The engine instance this material content is associated with
Collection of tags associated with this object
Protected Static__Protected Static__Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static Readonly_Static ReadonlyAspectStatic ReadonlyCameraStaticcurrentCurrent maximum object count for UID generation
Static ReadonlyInvalidInvalid object UID constant
StaticmaterialGets 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
InternalCopies tag data from another RnObject instance to this object
The source RnObject to copy tags from
Sets material-specific internal parameters for WebGL rendering. This method is called per material and configures matrices, lighting, morphing, skinning, and other per-material uniforms.
Object containing rendering parameters
WebGL rendering arguments
The engine instance
Whether this is the first time setup
The material instance
The WebGL shader program
Sets internal setting parameters to GPU for WebGL per primitive. This method should be overridden by derived classes to provide specific parameter handling.
Sets shader-specific internal parameters for WebGL rendering. This method is called once per shader program and sets up IBL environment textures and other program-level uniforms.
Object containing rendering parameters
WebGL rendering arguments
The WebGL shader program
Sets internal shader parameters for WebGPU rendering. This method configures camera-related and IBL (Image-Based Lighting) parameters that are managed internally by the material system.
Object containing material and rendering arguments
WebGPU rendering arguments
The material instance to configure
ProtecteddoPerforms 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
Gets the base material name (e.g., "PbrUber", "ClassicUber"). Double trailing underscores are removed for cleaner display.
The base material name string
Gets the shader definition string for this material. This method should be overridden by derived classes to provide specific definitions.
Empty string by default
Gets the shader definitions string for this material.
The definitions string
Gets the material semantics variant name for this material. This is the full identifier combining material name and variation identifier.
The unique variant name string
Gets the material variation identifier (without the base material name). This represents only the parameter variation part of the material type.
The variation identifier string
Retrieves a complete tag object (name and value) for the specified tag name
The name of the tag to retrieve
A Tag object containing the name and value
Retrieves the value associated with a specific tag name
The name of the tag whose value to retrieve
The tag value, or undefined if the tag doesn't exist
Checks whether this object has a tag with the specified name
The name of the tag to check for
True if the tag exists (value is not null/undefined), false otherwise
Generates a unique variant name for this material based on its shader semantics. This name is used to differentiate materials with different semantic configurations.
Checks if this object has a tag with the specified name and value
The tag name to match
The tag value to match
True if the object has a matching tag, false otherwise
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
Removes a tag from this object
The name of the tag to remove
ProtectedsetSets the billboard flag uniform in the shader.
The WebGL shader program
Whether the object should be rendered as a billboard
ProtectedsetSets the visibility flag uniform in the shader.
The WebGL shader program
Whether the object should be rendered
ProtectedsetSets lighting information uniforms in the shader.
The WebGL shader program
Array of light components
Whether to set uniform values
Configures material parameters based on MToon properties. This method sets up blending modes, culling, and other rendering states based on the material's MToon properties.
Sets morph target animation uniforms in the shader.
The WebGL shader program
The primitive containing morph targets
Optional_blendShapeComponent: BlendShapeComponentProtectedsetSets the normal transformation matrix uniform in the shader.
The WebGL shader program
The normal transformation matrix
ProtectedsetSets the pixel shader object for this material.
OptionalpixelShaderityObject: ShaderityObjectThe pixel shader object to set
Optionalengine: EngineOptional engine instance (uses this._engine if not provided)
Sets 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
ProtectedsetSets skeletal animation uniforms in the shader.
The WebGL shader program
Whether to set uniform values
OptionalskeletalComponent: SkeletalComponentThe skeletal component containing bone data
ProtectedsetupSets 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
ProtectedsetSets the vertex shader object for this material.
OptionalvertexShaderityObject: ShaderityObjectThe vertex shader object to set
Optionalengine: EngineOptional engine instance (uses this._engine if not provided)
Sets 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
ProtectedsetSets the world transformation matrix uniform in the shader.
The WebGL shader program
The world transformation matrix
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
Unregisters this object from all tracking collections. Should be called when the object is being destroyed.
Validates that a tag string contains only allowed characters (alphanumeric and underscore)
The string to validate
True if the string contains only valid characters, false if it contains invalid characters
Static_InternalCleans up static caches for a specific Engine instance. This should be called when the Engine is destroyed to prevent stale references.
The Engine instance being destroyed Called from Engine.destroy()
Static_InternalResets all static object tracking data. Used primarily for testing.
StaticgetRetrieves a material node by its unique identifier.
The unique identifier of the material node
The material node instance
StaticgetRetrieves an RnObject instance by its unique identifier
The unique identifier of the object to retrieve
The RnObject instance or undefined if not found or garbage collected
StaticgetRetrieves an RnObject instance by its unique name
The unique name of the object to retrieve
The RnObject instance or undefined if not found or garbage collected
StaticsearchSearches 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
StaticunityConverts Unity blend mode enum values to corresponding WebGL blend constants. This method maps Unity's blend mode enumeration to the appropriate WebGL blend function constants for proper alpha blending.
Unity blend mode enum value
Corresponding WebGL blend constant
Material content implementation for MToon 0.x shader. This class handles the creation and configuration of MToon materials, which are commonly used for toon-style rendering in VRM models.