Description
The Processor
property of the TextureInput
struct in the Editor.ShaderGraph
namespace is used to specify the TextureProcessor
that will be applied when compiling the texture. This property allows you to define how the texture should be processed during the shader compilation process, enabling custom processing logic to be applied to the texture data.
Usage
To use the Processor
property, you need to assign it a value of type Editor.ShaderGraph.TextureProcessor
. This can be done when setting up your shader graph or when configuring a texture input for a material. The processor will determine the specific operations or transformations that are applied to the texture during the shader compilation.
Example
// Example of setting the Processor property
TextureInput textureInput = new TextureInput();
textureInput.Processor = new CustomTextureProcessor();
// CustomTextureProcessor should be a class that implements the TextureProcessor interface
public class CustomTextureProcessor : TextureProcessor
{
public override void Process(Texture texture)
{
// Custom processing logic here
}
}