Description
Provides access to the current render context's attributes. These attributes are utilized to set parameters in materials and shaders. The attributes are reset at the end of each render block, ensuring that they do not persist across different rendering operations.
Usage
Use the Attributes
property to access and modify the rendering attributes for the current context. This is particularly useful when you need to pass specific data to shaders or materials during rendering.
Example
// Example of using the Attributes property
if (Graphics.IsActive)
{
// Set a custom attribute
Graphics.Attributes.Set("CustomAttribute", 1.0f);
// Use the attribute in a rendering operation
Graphics.DrawModel(myModel, myTransform, Graphics.Attributes);
}