Generative landscapes

About

Software rendering attempts at drawing / painting landscapes (and seascapes) with code using simple drawing primitives.

It use the painter algorithm, drawing the sky first and others layers in an ordered fashion.

To fake perspective i usually start from the horizon then increase the vertical coordinate by some small steps, all features increases in size (and amplitude) as it approach the bottom.

Made in p5.js, most of the code is quite small and only make use of simple primitives in huge amounts with blending and a loop of about 2-3 lines for each layers, some trigonometry and Perlin noise. Some are also using gaussian functions as modulation. The grass, sea and rain is made by lines driven by noise.

Some have small amount of compositing to add background features such as mountains. Each images take some milliseconds to render on modern hardware, the code is highly unoptimized.

My goal was to approach paintings.

Composition

Some scenes produced by using some of the tricks below with objects such as planets and spaceships (first ones are inspired by Star Control games, especially the Melnormes).

Swamps

The video demonstrate a way to add background features such as mountains by using a falling sand algorithm, that rainy sky is literally falling and create textured mountains !

Grassy barren fields

Sea

Some seascapes, the first few ones has improvements in clouds, sunlight (smoothed functions), reflections and transition between land and sea by addition of foam.

The first video demonstrate a way to add different kind of noisy features to the background and sea by using a falling sand algorithm with a relaxed treshold.

The second video is a different version which attempt to draw an animated sea by using large filled circles with a white outline, the opacity of the outline and circles decrease as it goes farther generating a foggy background. This video have a fun optical illusion where waves seems to overlap on the wrong side sometimes.

Mountains

The first few images are actually flat generated lands which are bent radially using GIMP then i applied GIMP content aware filling plugin to hide any distorsions and added some compositing (lightning storm, smoke) and filtering.

Experiments

Some experiments, a flat landscape viewed from the side, an oldschool nightscape with an aurora and a sea which use modulated lines, the last one may have been successfull with better colors and some tweaking.


back

20/05/2021