Difference between revisions of "The Default Scene Explained"

From Planetside Software Wiki
Jump to: navigation, search
(The Planet)
(The Atmosphere)
Line 31: Line 31:
 
== The Atmosphere ==
 
== The Atmosphere ==
  
 +
As noted in the previous sections, the Atmosphere in Terragen is spherical, enclosing the planet as the real Earth's atmosphere does.
  
 
== The Light Sources ==
 
== The Light Sources ==

Revision as of 23:25, 25 September 2018

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.

The 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).

The 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). 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 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.

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.

The 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 Light Sources[edit]

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 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.

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.