I’ve implemented preliminary functionality to map output from a node chain to terrain height, layer blends or masks.
Currently, only the Map, New and Edit buttons actually do anything. But you can click new to create a new node group, Edit to edit the node graph, then click Map Output to open a dialog that allows you to choose some options. The drop-down list lets you choose from Terrain, any of the 8 layers, and any of the 3 masks as target. You can also choose the range to re-map the output to, and you can select to use any of the 3 masks to mask off the output. (Mask selections are ignored when writing to a mask layer.) Clicking Make it happen! will perform the operation.
I’ve also written a routine to generate a cavity map from the heightmap. It is still in testing stage in these shots, but I’ll make it a filter with more flexibility after the wife and I get back from lunch today. The cavity mapper works a lot like a SSAO shader, only implemented in software and operating on the heightmap. You specify a radius size, and it samples random samples around each pixel in the heightmap and tests occlusion, building an occlusion factor for the pixel and writing it to an output buffer. This output buffer can then be used for things such as writing layer blend values:
Combined with an erosion filter (in the works) this can create some interesting terrain variation.
I’ve got projects in process for setting up waypoint groups/spline groups for road and river filters, to make that process a little more flexible. Plus, I’m working on revamping the toolbar to use an actual icon toolbar, and working on the terrain and blend resizing/loading/saving stuff to make it a little better. (It’s fully broken right now, due to a refactor.)
Some notes on graph node generation:
One of the more useful graph nodes is the Fractal node. Supply it with a basis function to use for the octave layers, plus some other parameters, and it generates a layered noise fractal useful for generating terrain. The Accidental Noise Library supplies some functionality to help the process generate some interesting effects. Here is a sample node graph using Fractal:
In this image, a Gradient noise basis is passed through an Abs function then through a Rotate Domain function (which applies a rotation of the input coordinates around an axis). This is set as the Layer input for the fractal. The Angle parameter of the Rotate Domain is fed from a Randomizer node; a Randomizer node randomizes a value from a range based on a given seed.
The way Fractal works is, it iterates over numoctaves, and for each layer it re-seeds the Layer input chain with a new random seed. Re-seeding iterates through the source tree, and overwrites a new random seed for every Seed node in the chain. This re-seeds the Gradient basis and the Randomizer for Angle for each layer, causing each fractal octave layer to generate a different pattern, rotated by a different angle around the vertical axis. This rotation prevents grid-aligned artifacts in the input noise from aligning with/amplifying each other, something that is especially useful for ridged or billow noise.
Any of the inputs can be overridden by attaching a node graph link to the input. This makes it possible to perform some pretty complex functions. You can specify the frequency from a node graph chain, for example, to vary the frequency of the noise fractal based on some input pattern. You can specify as complex a node graph for any input as you desire, limited only by how long you want to sit and wait for it to execute.
Also provided is an Expression node, which evaluates a string expression into a node graph:
In the works is a format to allow saving and loading node graphs. Also, I would like to implement some sort of grouping functionality, to provide the ability to create libraries of node graphs that can be imported into a node graph, and used as a sort of ‘black box’ function. ANL provides a Seeder node that performs similarly to how the Fractal re-seeds its input layer parameter. You can attach the output of a node graph module to any number of Seeder modules, to enable re-using the node graph with different seeds for different tasks.