2D procedural textures are textures generated from mathematical functions of (x,y).
|
|
|
| ||||||||
|
|
|
|
Random Gray
This is probably the easiest texture to create. Simply loop through all the pixels and randomly set the grayscale value to somewhere between 0 and 255. Note the difference between this texture an the turbulence texture. How would you characterize the difference?
Vertical Sharp Bands
To generate these texture, use the mod function on the x value. To generate horizontal bands, use the y value. For example, to create vertical bands using 2 colors and have have a width of 10 :
if ((x/10)%2 == 0) set to color 1, else set to color 2.
Soft Bands
Here a sin (or cos) function of x (or y) is used to set the intensity value. The period of the sin (or cos) determines the width of the bands. The get the two colors, use the intensity value for one color component (e.g. red) and the inverse intensity value (255-intensity) for another component.
Sin-Cos
This is made using a variation of sin(x)*sin(y).
Turbulence
This is created using the random gray pattern at multiple scales of resolution. For java code see Noise.Java
Marble
This is created by starting with multiple bands of color and then perturbing the colors using turbulence. For excerpted java code see Marble
[top]
[Home]