Creates a new empty carbon material.
OptionalisInternalConstructor: booleanProtected_lastStores the last program code used to avoid recompilation if the code hasn't changed. This can be a string representing the code or undefined if no code has been set.
Returns a reference handle for this resource.
Determines if the resource is destroyed.
Returns the meta data of this resource.
Sets a material model and applies all model parameters to the material.
Name of the resource. Use primarily for easier identification and not important to the engine itself.
Sets a shader that will be used by the material. Material will be initialized using all compatible techniques from the shader. Shader must be set before doing any other operations with the material.
Sets a shader that will be used by the material. Material will be initialized using all compatible techniques from the shader. Shader must be set before doing any other operations with the material.
Sets a shader that will be used by the material. Material will be initialized using all compatible techniques from the shader. Shader must be set before doing any other operations with the material.
Gets the surface model type of the material. Typically this depends on the shader implementation and controls which buffers are bound during rendering.
Returns the total number of techniques supported by this material.
Set of parameters that determine which subset of techniques in the assigned shader should be used. Only the techniques that have the provided parameters with the provided values will match. This will control which technique is considered the default technique and which subset of techniques are searched during a call to findTechnique().
ProtectedcompileCompiles the CarbonGraph sourcecode.
Compiles the specified variation asynchronously, if the variation is already compiled, the operation will complete immediately.
The variation to compile, if unspecified, compiles the material default variation.
Deserializes the underlying graph for editing purposes.
Returns a boolean value assigned with the parameter with the specified name.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
Parameter name.
OptionalarrayIndex: numberPosition index as an array.
Returns a color assigned with the parameter with the specified name. If a color gradient is assigned to this parameter, returns the gradient color evaluated at time 0.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
OptionalarrayIndex: numberReturns a color gradient assigned with the parameter with the specified name. If the parameter has a constant value bound instead of a gradient then this method returns an empty gradient.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
OptionalarrayIndex: numberReturns a float value assigned with the parameter with the specified name. If a curve is assigned to this parameter, returns the curve value evaluated at time 0.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
OptionalarrayIndex: numberReturns a curve value assigned to the parameter with the specified name. If the parameter has a constant value bound instead of a curve then this method returns an empty curve.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
OptionalarrayIndex: numberProtectedgetReturns an integer value assigned with the parameter with the specified name.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
Parameter name.
OptionalarrayIndex: numberPosition index as an array.
Returns a SpriteImage assigned to the material parameter.
Name of the texture parameter.
SpriteImage assigned to the specified material or null if not found.
Returns an unsigned integer value assigned with the parameter with the specified name.
Optionally if the parameter is an array you may provide an array index you which to retrieve.
Parameter name.
OptionalarrayIndex: numberPosition index as an array.
Compiles the graph asynchronously and updates the material.
Optionalforce: booleanStores the underlying graph.
Optionalforce: booleanAssigns a color to the shader parameter with the specified name.
Optionally if the parameter is an array you may provide an array index to assign the value to.
OptionalarrayIndex: numberAssigns a color gradient to the shader parameter with the specified name. The system will automatically evaluate the gradient with the passage of time and apply the evaluated value to the parameter.
Optionally if the parameter is an array you may provide an array index to assign the value to.
OptionalarrayIndex: numberOptionalarrayIndex: numberProtectedsetSets the CarbonGraph and cooks the underlying shader immediately.
Assigns a SpriteImage to the specified material parameter. The sprite image is allowed to be animated, or just used for referencing a subset of a texture atlas.
Name of the texture parameter.
SpriteImage resource to assign.
Assigns a texture to the specified material parameter.
Name of the texture parameter.
Texture resource to assign.
Assigns a texture to the specified material parameter. Allows you to specify a surface parameter that allows you to bind only a sub-set of the texture.
Name of the texture parameter.
Texture resource to assign.
Subset of the texture to assign.
Synchronizes the parameters of the graph with the current material parameters.
Static ReadonlyonTriggered when a carbon material was initialized that has outdated dependencies. If the event returns false, the automatic recompilation begins.
Static ReadonlyonTriggered when a carbon material was recompiled that had outdated dependencies. The material should be saved to the project.
ReadonlyonTriggered when the state of a code compilation changed.
The CarbonMaterial class implements a Material that is backed by a CarbonMaterialGraph that generates the underlying shader that is directly owned and serialized together with the CarbonMaterial.
The CarbonMaterial supports the following features: