Difference between revisions of "Warp Shader"

From Planetside Software Wiki
Jump to: navigation, search
(Changed this to redirect to Warp Merge Shader)
Line 1: Line 1:
[[Image:drex_module_166_image_0.png|center|Warp Shader]]
'''Node Description and Purpose:'''<br />
#REDIRECT [[Warp Merge Shader]]
The Warp Shader performs a domain distortion on the shader attached to its '''Shader''' input, using the displacement vectors from the shader attached to its '''Warper''' input. It does this by offsetting the texture coordinates before they are used by "shader". This almost looks like the warper bends the final result, but it's actually bending the space before it is read by the shader. A simplistic way you can think about it is that the shapes from the warper will bend the final texture (but in the opposite direction).
When the Warp Shader is asked to shade or displace a point, the following happens. First, like most other shaders in Terragen, the Warp Shader calls the shader connected to its main input. The main input is not warped. Then "warper" is called to produce a displacement vector. To produce the warp effect the warper must be a displacement shader or a network of shaders producing displacement. The displacement is not applied to the surface; its vector is merely stored for the next step. Next, the texture coordinates ("position in texture") are offset by the displacement vector, and then "shader" is called. The shader now produces different results because it works with modified texture coordinates. Finally, the texture coordinates are reset so that shaders following the Warp Shader will not be affected.
[[Category:Warp Shader]]
If you have a colour shader, colour function, scalar function or vector function that you want to use as your warper, you can turn it into displacement using a [[Displacement Shader]] or a [[Vector Displacement Shader]].
You may see the Warp Shader and the [[Redirect Shader]] used in the same context. The reason the Warp Shader and the [[Redirect Shader]] often work well together is because the [[Redirect Shader]] allows you to construct displacement vectors which go in all directions, which can be useful for warping a 3D function such as the Power Fractal. If you just use a single fractal operating along the normal as your warper, you might not easily see its warping effect.
'''Node Type:''' Other Shader<br />
'''Settings:'''<br />
'''Warper:''' The shader attached to this input generates the warp or distortion which effects the node attached to the '''Shader''' input.
'''Shader:''' The shader attached to this input is the one which is effected by the '''Warper''' shader.
[[Category:Other Shader]]

Latest revision as of 02:01, 4 May 2018

Redirect to: