Description
The Rough
field is a member of the TextureExtension
enumeration within the Editor.ShaderGraph
namespace. This enumeration is used to specify different types of texture extensions that can be applied in a shader graph, particularly for defining how textures are interpreted or utilized in rendering materials.
The Rough
field specifically represents a texture extension that is used to define the roughness of a material's surface. Roughness is a key factor in determining how light interacts with a surface, affecting the appearance of glossiness or matte finish. A higher roughness value typically results in a more diffuse reflection, while a lower value results in a sharper, more specular reflection.
Usage
To use the Rough
field, you would typically assign it to a property or parameter that expects a TextureExtension
value. This is often done when setting up materials in a shader graph to control the visual properties of a surface.
For example, when creating a material in a shader graph, you might specify that a particular texture should be interpreted as a roughness map by using the Rough
field. This helps the rendering engine understand how to apply the texture data to achieve the desired visual effect.
Example
// Example of using the Rough field in a shader graph setup
// Assume we have a method to set up a material's texture properties
void SetupMaterialTextureProperties(Material material)
{
// Set the texture extension to Rough to indicate this texture is a roughness map
material.SetTextureExtension(TextureExtension.Rough);
}