Shader Shader { get; set; }

robot_2Generated
code_blocksInput

Description

The Shader property of the Material class provides access to the shader associated with the material. This property is essential for defining how the material interacts with light and other visual effects in the rendering pipeline.

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 for further operations
// For example, you might want to log the shader's name
string shaderName = shader.Name;
// Note: Avoid using Console.WriteLine in Sandbox environment