The fragment shader starts by retrieving a noise value from the noise texture (NoiseTex), and storing the result in the noise variable. We want noise that has a large amount of high-frequency fluctuation, so we choose four-octave noise, which is stored in the alpha channel (noise.a).
We then discard the fragment if the noise value is below LowThreshold or above HighThreshold. As the discard keyword causes the execution of the shader to stop, the rest of the shader will not execute if the fragment is discarded.
Finally, we compute the shading model and apply the result to the fragment.