How it works...

The main function of the fragment shader retrieves a noise value from NoiseTex and stores it in the noise variable. The next two lines set the variable color to either the base diffuse reflectivity (Material.Kd) or PaintColor, depending on whether or not the noise value is greater than the threshold value (Threshold). This will cause a sharp transition between the two colors, and the size of the spatters will be related to the frequency of the noise.

Finally, the Phong shading model is evaluated using color as the diffuse reflectivity. The result is applied to the fragment.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.24.134