Tex Coords From XYZ

From Terragen Documentation from Planetside Software
Jump to navigation Jump to search
Tex Coords From XYZ
Tex Coords From XYZ


Overview

The Tex Coords from XYZ node generates world space texture coordinates for the shader or function nodes assigned its Main Input.

Historically, this node was first written to compute texture coordinates, and later as the need for surface normals became apparent the Compute Normal node was written. Finally, the Compute Terrain node combines the functionality of the Tex Coords from XYZ node and the Compute Normal node into one node.

The Tex Coords from XYZ node returns world texture space coordinates. The Compute Normal returns surface normals, and the Compute Terrain node does both.


It’s important to understand that in order for displacements and textures to be in sync and aligned, there should only exist one calculated solution within a given branch of the node network. This is why the Terrain Group ends with a Compute Terrain node in the default Terragen project before moving onto the Shaders Group. This workflow ensures that every shader will have consistent knowledge of the texture coordinates to work with. However, if your workflow doesn’t require normals to be known, such as using Redirect shaders and Vector displacement, then the Texture Coords from XYZ may be a faster solution than the Compute Terrain node because it only calculates texture coordinates.

When the Tex Coord from XYZ node or the Compute Terrain node is enabled, surface shaders have access to the displacement altitudes.
When the Tex Coord from XYZ node is enabled (and there is no Compute Terrain node), surface shaders do not have have access to the displacement altitudes because the surface normals have not been calculated.
Some shaders, such as the Surface Layer, have Slope Key and Altitude Key settings which allow you to access the Final position of the surface and not just the last Compute Terrain or Tex Coords from XYZ nodes within the node network branch.


Therefore, having a Tex Coords from XYZ and a Compute Terrain node in the same branch of a pipeline is not recommended. Multiple Tex Coordinates from XYZ and/or Compute Terrain nodes can exist in a project provided they’re not being used by the same node network branch. For example, a Compute terrain node with a Patch Size of 200 could exist and be used for populations only, while another Compute terrain node with a Patch Size of 20 is connected from the Terrain group (displacements) to the Shader group (texturing).

In this example, the forest population uses the Compute Terrain node with a Patch Size of 200 and not the Tex Coords from XYZ in order to access the terrain’s slope information.


Certain workflows may also benefit by having the major surface displacement nodes positioned prior to the Compute Terrain node, and having the smaller, secondary displacements, such as a Strata and Outcrop shader occur after the Compute Terrain node.


Settings:

    • Name: This setting allows you to apply a descriptive name to the node, which can be helpful when using multiple Tex Coords from XYZ shader nodes in a project.
    • Enable: When checked, the node is active and the current world space texture coordinates will be calculated for the shader or function nodes assigned to the Main input. This includes all nodes upstream from the assigned shader node.