A simple HLSL file for use in Unity's Shader Graph.
Simply drag and drop "StochasticNode.hlsl" into any Unity assets folder.
- Open the Shader Graph window.
- Right-click on the background and select "Create Node."
- Search for the "Custom Function" node and add it to the graph.
- Configure the parameters as shown in the following image.
- Select the texture you wish to use and drag the output to the "Base Color" input.
This is an unofficial implementation based on the paper "Procedural Stochastic Textures by Tiling and Blending" by Thomas Deliot and Eric Heitz. This implementation only includes the tiling part of the original paper. The blending part is not implemented. The majority of the code was developed with assistance from GPT-4.