The Default Scene Explained

From Planetside Software Wiki
Jump to: navigation, search

When you open Terragen, you will immediately see a terrain with a simple mountain in front of you and a flat area closer to the camera. This is the Default Scene. It is intended to give you a starting point for working in Terragen and to show you a basic example of what a Terragen scene looks like. Although it is a simple scene, there are some techniques used in its construction that may not be immediately intuitive. Below we'll explain in brief how this scene is setup.

You may find it helpful to switch to the Layout that corresponds to the part of the scene you are looking at as you read the below explanations. To do this, click on the respective Layout button at the top of the interface, e.g. Objects, Terrain, Shaders, etc. These are customized views that show you nodes and controls specific to the part of the scene you are editing.

Camera[edit]

The camera in the Default Scene is positioned in a flattened area of the terrain (which we'll look at in the next section) and is 10 meters off the ground. It is facing a mountain and is -30 meters from the coordinate origin along the Z axis. If you switch to a Top View camera, it will appear that nothing is visible as everything is gray, but this is simply because the terrain around the camera is flattened. If you move the camera upward or zoom out from the Top View starting point, you will see the rest of the terrain come into view (see the Navigation Panel and Terragen Input Settings Reference for details on camera movement).

Camera nodes must be connected to Render nodes in Terragen for them to render correctly. You can, however, have independent Camera nodes which can be viewed-through but do not render, if they are not connected to a Render node.

Terrain[edit]

The terrain setup is the most complex part of the Default Scene. It is best to look at this in the node network window to clearly understand it, but the node list can also be used.

When you first load Terragen with the Default Scene, you should be in the Terrain Layout. In the node network window on the right you should see an overview of the shading (node) network. Shading data flows from the top to the bottom of the network (though it is computed in reverse order, which is explained in more detail elsewhere). The primary terrain and shader network data flows through the "Main input" of each shader node, and each successive node (further down in the network) builds or operates on the input of the previous node above it.

Zoom in on the Terrain group (controls in the node network are similar to camera movement controls) and you should see four nodes inside the Terrain group. "Simple shape shader 01" is connected to the Mask Shader input of "Fractal terrain 01", and "Fractal terrain 01" is connected to the Main Input of "Fractal warp shader 01", which then connects to the Main Input of "Compute Terrain" node.

If you're using the node list view, you'll see "Fractal terrain 01" and below it "Fractal warp shader 01". There is a + next to "Fractal terrain 01", which will expand to show "child" or subordinate nodes if you click it. In this case you should see the "Simple shape shader 01". Now you can hopefully start to get an idea of how the connections in the node network correspond to their representation in the node list.

The "Fractal terrain 01" node is creating the basic terrain shape. The node type is Power Fractal Shader v3, which is a flexible fractal noise generator used for a wide range of purposes in Terragen. In this case it is creating displacement at multiple levels of scale to create mountains, valleys, etc. As previously mentioned, it has the "Simple shape shader 01" as its Mask Shader input, which should restrict the influence of the "Fractal terrain 01" node to the area defined by the input shader. The output of the "Fractal terrain 01" goes into the next few shaders and ultimately connects to the Planet node's "Surface shader" input, so the displacement is applied to the surface of the planet via that connection.

The Simple Shape Shader outputs color and/or displacement data representing various basic shapes such as a circle, rectangle, or polygon. If you click on it in the node list or double-click in the node network window you can view the node's settings. In this case you can see it is set to output a circle/ellipse that is 10,000 meters (10km) in each dimension (a perfect circle, rather than an ellipse). This circle is positioned at the 0,0,0 coordinate origin, very close to the default camera position.

From what we know so far, what we should be seeing is a 10km circular area of terrain, but instead we have a flat area surrounded by mountains. Open the settings of the "Fractal terrain 01" node and you'll see why. At the bottom of the node's settings you'll see the Masking controls. Mask By Shader is enabled, but note that Invert Mask is also checked: rather than creating a 10km circle of terrain, we are actually getting a 10km area where "Fractal terrain 01" is masked out and thus does not affect the flat planet surface with displacement. As a result we get a 10km area of flat, undisplaced terrain, while everywhere outside of this area is affected by the "Fractal terrain 01" displacement and thus we get mountains and valleys beyond the area of the Simple Shape Shader. This is the key insight to understand the Default Scene.

Next in the shading network we have the "Fractal warp shader 01" (of the type Fractal Warp Shader), which essentially just adds some more interesting variation and detail to the basic shapes created by the nodes before it in the node network. We'll save a more in-depth discussion of Fractal Warp Shaders, as well as the Compute Terrain, for another time.

So to review, as noted above the primary terrain shapes are generated by the "Fractal terrain 01" node, which is masked to create a flat area by the "Simple shape shader 01". The output of "Fractal terrain 01" is enhanced by "Fractal warp shader 01", then flows through the Compute Terrain, it gets basic texturing in the "Base colours" shader (covered more below), then flows into the "Planet 01" "Surface shader" input, meaning the accumulated shading settings of all these nodes get applied to the surface of this Planet node.

Shaders[edit]

The Shaders Layout and group are generally where color and other shading effects are applied to the displacement terrain shapes created in the Terrain group. This separation is not strict, but we advise users create their larger terrain shapes in the Terrain group before the Compute Terrain.

In the Default Scene there is only one color node, "Base colours", which is a specialized Base Colours type node, very similar to a Power Fractal node. If you open this node's settings you can see that it is simply providing two colors, black and a a dark-medium gray, which then get applied to the terrain based on its internal noise generation algorithms. The "high colour" gets applied to the high values generated by the shader, and "low colour" gets applied to low values, with blending between them controlled by the settings at the bottom of the Colour tab such as "Colour contrast" and "Colour offset". This creates a simple monochrome mottled appearance on the terrain. You can adjust these colors to create simple variations, but using additional shaders is the best way to create more complex and realistic results. You can find out more about shading in the Creating Your First Scene tutorial.

Objects[edit]

Objects in Terragen can be either "native", created procedurally within Terragen, or imported, such as plant models or characters created in other applications. In the Default Scene all existing objects are native Terragen objects. These consist of the "Planet 01" object, a Planet object type, and the "Background", a Background object type.

The Planet[edit]

Terragen works on a full Earth-sized planet by default. This allows for a realistic depiction of scale and planetary curvature, as well as atmosphere, including realistic lighting dependent on sun angle, etc. This does not affect the Default Scene very much, but you can see the extent of the planet if you open the "Render Camera" node's settings, set the X axis rotation to -90 (it is -7 by default) and then change the Position coordinates to the following: [xyz: 0, 1.4e+007, -30]. For the Position, you can simply copy everything here between brackets and use the paste button to the right of the coordinate input field, if desired. Once you've made those changes you should see a spherical planet in the 3D preview.

If you have not enabled the Atmosphere preview in the 3D Preview window you can do so now by clicking the small blue cloud outline icon on the top toolbar of the 3D preview window, to the right of "RTP". You should then see a blue atmosphere around the entire planet.

Being able to work on an entire planet can have many uses, but even in simple scenes such as this one it helps provide a realistic atmosphere and other subtle effects that add to realism.

Background[edit]

The Background object is a special object that is required for correct rendering of the scene. It is a very, very large inverted sphere which should enclose the entire scene. You can use the Background object to map background images or other textures onto, for example if you want to have a starfield or nebula in the background of the sky, beyond the atmosphere.

Atmosphere[edit]

As noted in the previous sections, the Atmosphere in Terragen is spherical, enclosing the planet as the real Earth's atmosphere does. The "Atmosphere 01" allows you to control the settings of the atmosphere in this scene. By default is set to look like a realistic "Earth-normal", although of course this can vary in the real world based on location. You may find the defaults to be a bit hazier or more clear than you are used to, for example. You can open the settings of the "Atmosphere 01" to adjust it, but you should find it provides a slight amount of realistic distance haze and a nice blue sky in the Default Scene.

Light Sources[edit]

The Default Scene includes 2 light sources, the "Enviro light" (Enviro Light type node) and the Sunlight 01 (Sunlight type node).

The "Sunlight 01" provides the primary illumination in your scene. It is a "distant" or "parallel" light source, with no specific coordinate position in 3D space, only a Heading (direction) and Elevation to control the direction that light comes from. Sunlight nodes are shown on the compass at the upper-left of the 3D Preview. They are the only type of Lighting node that are represented in this way. In the Default Scene you'll see that "Sunlight 01" is positioned to the left and slightly toward the front of the camera. You can adjust its position by changing the Heading and Elevation settings in the node.

The direct light from "Sunlight 01" bounces and scatters off of various elements of the scene and becomes Global Illumination that is controlled by the "Enviro light". If you disable the "Enviro light" it will also disable Global Illumination and you will only get the effect of primary lighting, which is less realistic. The "Enviro light" also allows you to control Global Illumination lighting contribution in the Default Scene and other scenes. You can independently adjust the contribution and color of Global Illumination lighting data that is applied to surfaces or atmosphere elements in the scene.

Render[edit]

Rendering functions in Terragen are controlled by one or more Render nodes. In the Default Scene this is "Render 01" and it is connected to the "Render Camera" node. This combination of nodes defines both the camera view and render settings to allow you to render a final image and save it to disk. There a wide range of Render node controls which are covered elsewhere in the documentation.

Changing the Default Scene[edit]

A useful additional feature in Terragen allows you to define your own customized Default Scene. This is more useful once you become familiar with Terragen and have a better understanding of how you prefer to create your scenes and what nodes and other configurations and settings may be helpful to start with each time. For example you could setup your own default scene with 2 or more render nodes representing different levels of detail and quality, allowing you to quickly switch back and forth between quick preview and longer high quality renders of the same camera view. Or you might prefer to start each time with a totally blank Terrain network, rather than having the same shape every time as in the existing default scene.

Please note that this is considered and advanced feature and we recommend you have a good familiarity with file operations and permission settings in your operating system before you attempt this. With that in mind, to save your own default scene, start by setting up a Terragen scene the way you want it to load every time you start Terragen. Then Save your scene to the location of your choice, somewhere that you won't need to move or delete it, but otherwise it can really be anywhere.

Next, open the Terragen Preferences and in the Startup area you'll see "Project Creation: Use Defaults" at the top. Click "Use Defaults" to get a dropdown and select "Load from File" instead. Then use the "Choose File" button below to select the TGD file you created previously. Click OK, and beginning with the next time you load Terragen, you'll have your own customized default project.

A single object or device in the node network which generates or modifies data and may accept input data or create output data or both, depending on its function. Nodes usually have their own settings which control the data they create or how they modify data passing through them. Nodes are connected together in a network to perform work in a network-based user interface. In Terragen 2 nodes are connected together to describe a scene.

The Node Network Window is a part of the Terragen interface that shows the connections between nodes and their visual layout in the shading network. The Node Network Window is usually on the bottom-right of the Terragen interface, although when you switch to the Node Network Layout it occupies the entire right side.

The Node List is a part of the Terragen interface that shows a list of nodes along the left side of the application window. The Node List generally shows only those nodes that are relevant to the current Layout (e.g. Terrain, Atmosphere). It sometimes includes buttons or other controls that are specific to a particular Layout as well. The Node List is hierarchical and each level is collapsible.

A shader is a program or set of instructions used in 3D computer graphics to determine the final surface properties of an object or image. This can include arbitrarily complex descriptions of light absorption and diffusion, texture mapping, reflection and refraction, shadowing, surface displacement and post-processing effects. In Terragen 2 shaders are used to construct and modify almost every element of a scene.

Literally, to change the position of something. In graphics terminology to displace a surface is to modify its geometric (3D) structure using reference data of some kind. For example, a grayscale image might be taken as input, with black areas indicating no displacement of the surface, and white indicating maximum displacement. In Terragen 2 displacement is used to create all terrain by taking heightfield or procedural data as input and using it to displace the normally flat sphere of the planet.

In a graphical user interface (GUI) on a computer a toolbar is a row, column, or block of onscreen buttons or icons that, when clicked, activate certain functions of the program.