Shaders

From Terragen Documentation from Planetside Software
Revision as of 21:22, 8 October 2018 by BFlasher (talk | contribs) (Created page with "Shaders are a familiar concept in the computer graphics industry and are used in many other 3D applications. Fundamentally, a “shader” does just what the name implies –...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Shaders are a familiar concept in the computer graphics industry and are used in many other 3D applications. Fundamentally, a “shader” does just what the name implies – it “shades” something, a surface in your scene, where “shade” means literally “to apply color to.” In computer graphics terminology, a “shader” is the set of instructions that dictate how a particular surface will be shaded, including aspects like diffuse color, luminosity, specularity and reflectivity, transparency, displacement, and much more. Shaders often act on input from other elements of the scene such as light sources, determining the final color of the surface by combining lighting effects with base surface properties.

In Terragen, all scene elements are depicted as “nodes,” and virtually any node that applies to a surface is a shader. Shader nodes are of two primary types in Terragen: “compound nodes” and "function nodes." The term “compound node” refers to shader nodes like the power fractal which encompass a great deal of functionality and internal complexity in a single node interface. While you won't see the term “compound node” used to refer to any specific node in the Terragen interface, it is a useful term to refer to nodes which are not function nodes and which have greater encapsulated functionality.

Function nodes, on the other hand, are the most basic building blocks of a shader, often times comprised of individual simplistic math operations such as add, subtract, sine, and cosine. Experienced shader writers and those who have a firm grasp of how mathematics applies to computer graphics can use these individual functional components to build whole networks, with complex interactions that comprise surface shaders capable of producing unique and powerful effects. Function nodes are the building blocks that those who are experienced writing shaders in other applications may find most familiar, however Terragen provides so-called compound nodes for the most often-used and important effects like simple surface shading with altitude control, or image mapping. As a beginner or intermediate Terragen user, you will seldom have need to use function nodes. This capability is provided for those with unique requirements or who need more specific control over their shader output and who have the appropriate knowledge and experience to effectively build shaders from scratch.