Functions are biome nodes that have their inputs and outputs. Imagine using a portal right into the biome sub-graph, and the portal out - and that is what the basic function is. This way you can re-use some common elements in all of your graph, bringing them to a separate graph. Tuning and enhancing it will automatically enhance all of the graphs where the function is used.
Use case
As an example can take the demo graph SimpleGraph from the Tutorial scene (make a copy to apply changes).
We can bring all of the texturing group into a function. Do do this we create one more graph with all the nodes from the texture group imported. Instead of portals we use Function Input and Function Outputs.
In a parent (SimpleGraph Copy) graph we remove them, and replace with a function.
This won't affect the visual representation of the terrain, since, except some technical details, the generate process is quite the same. However, we can insert this function in other graphs in the same way, and it will automatically textures any terrain in the same way it did in Tutorial scene. Don't forget to make copies and remove texturing nodes.
Tutorial texturing applied to Badlands graph.
And the same texturing applied to the Snow Plains.
Value Exposing
Right-clicking on a value field in any graph and selecting Value -> Exposewill make this value to be exposed by modifying externally. If you turn on Value Override in your function node you can change it without opening child graph.
Inlets and Outlets
Function Inlet and Outlet connectors will appear after the functions graph is assigned in slot. For each of the Function Input generators in function graph one Inlet will be created. As well as for each Function Output in function graph one Outlet will be added.
Inlet or Outlet named the same way Function Input/Output is named in function graph.
Properties
-
Graph Slot: the sub-graph with the function.
The graph could be opened as a biome by clicking the Open button
. In contrast to opening the graph by double-clicking it in Project window, accessing it with the Open button will open it as a biome. You can return to the parent biome with the Folder Up
button in the toolbar, and access other biomes with the Folder Tree
(also in a toolbar).
-
Override Exposed: enables the modifying of the function graph fields that are marked as Exposed. These fields will be listed below. Modifying any of the values in function will not change the value in graph, nor it will affect other functions - this change is active only in this function scope.
Note that overriding values creates some overhead and slows down a graph generate a bit, so try not enable this feature if it's unnecessary.
-
List of overridden values (if Override Exposed enabled and function graph has values exposed).