Shader Shader { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The Shader property of the Material class provides access to the shader associated with the material. This shader defines how the material is rendered, including its visual effects and interactions with light.

Usage

To access the shader of a material, use the Shader property. 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 inspect its properties or pass it to another function
Console.WriteLine("Shader Name: " + shader.Name);