Description
The Shader
property of the Material
class provides access to the shader associated with the material. This property allows you to retrieve the Shader
object that defines how the material is rendered, including its visual effects and rendering techniques.
Usage
To access the shader of a material, simply use the Shader
property on an instance of the Material
class. This property is read-only and returns a Shader
object.
Example
// Example of accessing the Shader property of a Material
Material myMaterial = Material.Load("path/to/material");
Shader shader = myMaterial.Shader;
// Use the shader object as needed
// For example, you might want to log its name or properties
string shaderName = shader.Name;
// Perform operations with the shader