Get Normal: Difference between revisions
No edit summary |
No edit summary |
||
| Line 4: | Line 4: | ||
[[Image:drex_module_35_image_0.png|485pxpx|Get Normal]] | [[Image:drex_module_35_image_0.png|485pxpx|Get Normal]] | ||
Provides the Normal of the | Provides the Surface Normal (or a reasonable equivalent), in world space, of the current [[Render State]]. The [[Render State]] is affected by any shaders which were called before this function is called, among other things. | ||
Normal is usually the most recently calculated surface normal at the current point on the surface being rendered or sampled, but other may be modified by other shaders, e.g. [[Redirect Shader]]. | |||
When used in the context of displacement, for example in a function network that feeds a displacement shader, Normal depends on where the node is connected with respect to [[Compute Terrain]] and [[Compute Normal]], and may also depend on other displacement shaders. Initially the normal is derived from the undisplaced surface being rendered. On imported objects such as OBJs or TGOs, normals are often provided by the object file and (optionally) interpolated to give a smooth surface for displacement and shading. On terrains these are initially set to the normal at the point on the flat planet from which the terrain was displaced, but may be updated by [[Compute Terrain]] or [[Compute Normal]] nodes to provide a more detailed representation of the surface relief. | |||
When used in the context of providing colour and lighting to a surface, for example in a function network that feeds a shader's colour or luminosity, Normal is always the "final normal" after all displacement and includes micro-polygon details. By the time a shader's colour and lighting is calculated, all displacements for that point have been performed and the renderer has already recalculated the normal for the micro-polygon. | |||
When sampling an atmosphere shader, Normal is usually set to the local "Up" vector with respect to the planet to which the atmosphere shader is attached. | |||
For some shading uses it may be better to use [[Get Normal in Texture]], because that often provides a value that is consistent between displacement and colour contexts. | |||
The Input connection is not used by this node. | |||
__NOTOC__ | __NOTOC__ | ||
<!-- imported from file: module_35.html--> | <!-- imported from file: module_35.html--> | ||
Revision as of 06:21, 2 May 2011
Get Normal
Provides the Surface Normal (or a reasonable equivalent), in world space, of the current Render State. The Render State is affected by any shaders which were called before this function is called, among other things.
Normal is usually the most recently calculated surface normal at the current point on the surface being rendered or sampled, but other may be modified by other shaders, e.g. Redirect Shader.
When used in the context of displacement, for example in a function network that feeds a displacement shader, Normal depends on where the node is connected with respect to Compute Terrain and Compute Normal, and may also depend on other displacement shaders. Initially the normal is derived from the undisplaced surface being rendered. On imported objects such as OBJs or TGOs, normals are often provided by the object file and (optionally) interpolated to give a smooth surface for displacement and shading. On terrains these are initially set to the normal at the point on the flat planet from which the terrain was displaced, but may be updated by Compute Terrain or Compute Normal nodes to provide a more detailed representation of the surface relief.
When used in the context of providing colour and lighting to a surface, for example in a function network that feeds a shader's colour or luminosity, Normal is always the "final normal" after all displacement and includes micro-polygon details. By the time a shader's colour and lighting is calculated, all displacements for that point have been performed and the renderer has already recalculated the normal for the micro-polygon.
When sampling an atmosphere shader, Normal is usually set to the local "Up" vector with respect to the planet to which the atmosphere shader is attached.
For some shading uses it may be better to use Get Normal in Texture, because that often provides a value that is consistent between displacement and colour contexts.
The Input connection is not used by this node.
