Illuminating Textures from the Perlin Playpen



January 7th, 2021 by Diana Coman

On a break from the most recent exploration of the wide open complex space, I went back for another look at last year's noise-based textures and ended up ever more doubtful that there is a meaningful distinction that goes any deeper than "here's this trodden path vs there's the world." Still, trodden paths have their utility too and it takes thorough exploration to gain some serious doubts anyway, so I went ahead and implemented in Ada a tidy set of puzzle pieces together with a working way to mix-and-match them programmatically even, if desired. Then I set it to loop through various parameters, which it dutifully did over a few days and nights, resulting in a deluge of neatly named pictures that took quite some time to go through. I'll sample from them for this write-up but I don't quite think there's much point in uploading them all - do let me know though if you want to see them all, as I'll keep them around for a while anyway.

Before diving into the exploration and corresponding images, here's the core idea of the "fbm fractal" approach:

  1. Structured noise (Perlin is the most common but not the only one) is used to provide that sort of controlled chaos and order mixture needed for meaningful variation.
  2. Waves of the chosen noise, with ever increasing frequency and decreasing amplitude are then simply summed up, basically filling in increasingly more detail, as more waves are added.
  3. The number of octaves (o) gives the number of iterations or, in other words, the number of waves to sum and therefore the amount of detail to include.
  4. The Hurst coefficient (h) controls the way in which the amplitude of the waves is decreased at each iteration and as a result, how noisy (noisiest as h decreases) or smooth (smoother as h increases) the resulting image is.
  5. Typically, the amplitude decreases at each iteration 2^(-h) times, with this quantity named sometimes "gain" or g.
  6. Typically, the frequency doubles at each iteration (hence the "octaves" name) but in principle there is an argument for fuzzying this number between iterations, to avoid a too precise overlap of the noise waves where they are 0 for instance (since such overlap will show up as too-ordered artefacts basically).
  7. Overall, fbm is simply a sum function fbm(x) with terms 2^(-j*h) * noise(2^j * x) for all j between 0 and o.

For the exploration part, I had the generator loop through o from 1 to 10 and through h from 0.112 to 1.112. To keep things reasonably easy to follow, I used a single texture mapping throughout but I had the generator plot the result using 4 different RGB mappings: a sinus-based grayscale (for heightmaps), a direct rgb mapping used by the previous C prototype, a fixed palette-based mapping (using the same sinus-based colour palette as employed for the complex curvy space illustrations) and a phase-variable version of that palette (basically changing shade depending on the seed). Scroll further to see what dramatic difference the colours can make, indeed.

First off and keeping it to the grayscale results, a low number of octaves and a relatively high h seem to give as far as I can tell some possibly useful heightmaps of sorts. Basically a high h is needed to ensure smoothness since noise on heightmaps is rather unhelpful as it creates too sharp jumps from high to low. Similarly, a low number of octaves is required to keep detail relatively low - for this particular pattern at least, there is already enough detail brought in by the pattern itself (the pattern is on top of the fbm, basically a composition -at times recursive, too- of fbm at each point). For illustration, here's the grayscale series obtained for a single seed with o=2 and h 0.212, 0.412, 0.612 and 0.812:

perlin_playpen_7_fbm3_s4005_fracxyzmt_h0212_o2_w512_h512_normc_graytrig.jpg
perlin_playpen_8_fbm3_s4005_fracxyzmt_h0412_o2_w512_h512_normc_graytrig.jpg
perlin_playpen_12_fbm3_s4005_fracxyzmt_h0612_o2_w512_h512_normc_graytrig.jpg
perlin_playpen_13_fbm3_s4005_fracxyzmt_h0812_o2_w512_h512_normc_graytrig.jpg

When the number of octaves is increased, the number of curves in this landscape increases very quickly and to my eye the result doesn't look that well as a heightmap although the intermediate o values may very well look fine as a creature skin or some other sort of texture perhaps (h is 0.812 while o changes from 3 to 9):

perlin_playpen_14_fbm3_s4005_fracxyzmt_h0812_o3_w512_h512_normc_graytrig.jpg
perlin_playpen_15_fbm3_s4005_fracxyzmt_h0812_o4_w512_h512_normc_graytrig.jpg
perlin_playpen_16_fbm3_s4005_fracxyzmt_h0812_o5_w512_h512_normc_graytrig.jpg
perlin_playpen_17_fbm3_s4005_fracxyzmt_h0812_o6_w512_h512_normc_graytrig.jpg
perlin_playpen_18_fbm3_s4005_fracxyzmt_h0812_o7_w512_h512_normc_graytrig.jpg
perlin_playpen_19_fbm3_s4005_fracxyzmt_h0812_o8_w512_h512_normc_graytrig.jpg
perlin_playpen_20_fbm3_s4005_fracxyzmt_h0812_o9_w512_h512_normc_graytrig.jpg

While working in grayscale, there is little point in increasing o and h beyond 9 and 1 respectively: the result just ends up very noisy and/or matted. However, when colour is brought in, the situation changes, as different parts can get effectively highlighted in such different ways that I can't say I have any sort of concrete interval to offer as a rule - it's more likely to depend on the exact colour mapping really. At any rate, the low o and h values can make for clear(er) patterned textures while the higher values (with h even beyond 1) can make for quite striking skies or even lava or similar perhaps - basically I have no idea what they are exactly but there are quite a few that I just like looking at! Anyways, here are some illustrations, with all parameters coded in the filename:

perlin_playpen_1_fbm3_s4000_fracxyzmt_h0612_o4_w512_h512_normc_fpal3d_default.jpg
perlin_playpen_2_fbm3_s4000_fracxyzmt_h0612_o4_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_3_fbm3_s4005_fracxyzmt_h01012_o7_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_4_fbm3_s4005_fracxyzmt_h0112_o2_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_5_fbm3_s4005_fracxyzmt_h0112_o3_w512_h512_normc_fpal3d_default.jpg
perlin_playpen_6_fbm3_s4005_fracxyzmt_h0112_o3_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_9_fbm3_s4005_fracxyzmt_h0412_o3_w512_h512_normc_pal3d_default.jpg
perlin_playpen_10_fbm3_s4005_fracxyzmt_h0412_o3_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_11_fbm3_s4005_fracxyzmt_h0412_o3_w512_h512_normc_pal3d_phasevar.jpg
perlin_playpen_21_fbm3_s4009_fracxyzmt_h0212_o3_w512_h512_normc_pal3d_fsinglef.jpg
perlin_playpen_22_fbm3_s4010_fracxyzmt_h01012_o8_w512_h512_normc_pal3d_fsinglef.jpg

All the above use a single pattern of all those I made last year. There would be in principle all the other patterns to translate over to Ada and then perhaps explore further. There can easily be more/new patterns to explore too, but at this stage it's not all that clear to me if this is the best direction to press forwards. Compared to the iteration of complex polynomials, this approach is basically limited to a carefully chosen playpen but it comes as a result of this strict limitation with some guarantees regarding the full coverage of the texture space for all seeds and otherwise a guarantee regarding the result based on the type of pattern chosen at any time. Perhaps there is some use for both approaches (noise-based and iterated complex functions) but in any case, at the moment there seems to me to be more promise in pushing perhaps further the more open case of iterating functions rather than in further tweaking the various parameters in this specific playpen of noise-based textures. Then again, there are plenty of *entirely other* things to push further at the moment, not even texture or heightmaps related!

Comments feed: RSS 2.0

2 Responses to “Illuminating Textures from the Perlin Playpen”

  1. [...] short, being otherwise rather busy with other matters, I just added the "rotated" pattern to my previous puzzle set and then let it fill my hard-drive with wondrous and amazing... art1. Being the art lover that I [...]

  2. [...] from the signature rotate and shrink of chaotic systems to the clever diamond square and fm plus Perlin noise cheating shortcuts, there is always seemingly just out of reach - or at least out of *my* reach for [...]

Leave a Reply