What are Shader Designer nodes?

The Shader Designer in Visual Studio represents visual effects as a graph. These graphs are built from nodes that are chosen and connected in precise ways to achieve the intended effect. Each node represents either a piece of information or a mathematical function, and the connections between them represent how the information flows through the graph to produce the result. Node types include filters, textures, parameters, constants, utility nodes, and math nodes.

Node structure

All nodes are made up of a combination of common elements. Every node has at least one output terminal on its right-hand side (except the final color node, which represents the output of the shader). Nodes that represent calculations or texture samplers have input terminals on their left-hand sides, but nodes that represent information have no input terminals. Output terminals are connected to input terminals to move information from one node to another.

Promotion of inputs

Because the Shader Designer must ultimately generate HLSL source code so that the effect can be used in a game or app, Shader Designer nodes are subject to the type-promotion rules that HLSL uses. Because graphics hardware operates primarily on floating-point values, type promotion between different types—for example, from int to float, or from float to double—is uncommon. Instead, because graphics hardware uses the same operation on multiple pieces of information at once, a different kind of promotion can occur in which the shorter of many inputs is lengthened to match the size of the longest input. How it's lengthened depends on the type of the input, and also on the operation itself:

  • If the smaller type is a scalar value, then:

    The value of the scalar is replicated into a vector that is equal in size to the larger input. For example, the scalar input 5.0 becomes the vector (5.0, 5.0, 5.0) when the largest input of the operation is a three-element vector, regardless of what the operation is.

  • If the smaller type is a vector, and the operation is multiplicative (*, /, %, and so on), then:

    The value of the vector is copied into the leading elements of a vector that is equal in size to the larger input, and the trailing elements are set to 1.0. For example, the vector input (5.0, 5.0) becomes the vector (5.0, 5.0, 1.0, 1.0) when it's multiplied by a four-element vector. This preserves the third and fourth elements of the output by using the multiplicative identity, 1.0.

  • If the smaller type is a vector, and the operation is additive (+, -, and so on), then:

    The value of the vector is copied into the leading elements of a vector that is equal in size to the larger input, and the trailing elements are set to 0.0. For example, the vector input (5.0, 5.0) becomes the vector (5.0, 5.0, 0.0, 0.0) when it's added to a four-element vector. This preserves the third and fourth elements of the output by using the additive identity, 0.0.

Nodes and node types

The Shader Designer provides six different node types—filters, texture nodes, parameters, constants, utility nodes, and math nodes—and several individual nodes belong to each type.

Constant nodes

In the Shader Designer, constant nodes represent literal values and interpolated vertex attributes in pixel-shader calculations. Because vertex attributes are interpolated—and so, are different for each pixel—each pixel-shader instance receives a different version of the constant. This gives each pixel a unique appearance.

Vertex attribute interpolation

The image of a 3D scene in a game or app is made by mathematically transforming many objects—which are defined by vertices, vertex attributes, and primitive definitions—into on-screen pixels. All of the information that's required to give a pixel its unique appearance is supplied through vertex attributes, which are blended together according to the pixel's proximity to the different vertices that make up its primitive. A primitive is a basic rendering element; that is, a simple shape such as a point, a line, or a triangle. A pixel that's very close to just one of the vertices receives constants that are nearly identical to that vertex, but a pixel that's evenly spaced between all the vertices of a primitive receives constants that are the average of those vertices. In graphics programming, the constants that the pixels receive are said to be interpolated. Providing constant data to pixels in this way produces good visual quality and at the same time reduces memory footprint and bandwidth requirements.

Although each pixel-shader instance receives only one set of constant values and can't change these values, different pixel-shader instances receive different sets of constant data. This design enables a shader program to produce a different color output for each pixel in the primitive.

Constant node reference

Node Details Properties
Camera Vector The vector that extends from the current pixel to the camera in world space.

You can use this to calculate reflections in world space.

Output

Output: float3
The vector from the current pixel to the camera.
None
Color Constant A constant color value.

Output

Output: float4
The color value.
Output
The color value.
Constant A constant scalar value.

Output

Output: float
The scalar value.
Output
The scalar value.
2D Constant A two-component vector constant.

Output

Output: float2
The vector value.
Output
The vector value.
3D Constant A three-component vector constant.

Output

Output: float3
The vector value.
Output
The vector value.
4D Constant A four-component vector constant.

Output

Output: float4
The color value.
Output
The vector value.
Normalized Position The position of the current pixel, expressed in normalized device coordinates.

The x-coordinate and y-coordinate have values in the range of [-1, 1], the z-coordinate has a value in the range of [0, 1], and the w component contains the point depth value in view space; w isn't normalized.

Output

Output: float4
The position of the current pixel.
None
Point Color The diffuse color of the current pixel, which is a combination of the material diffuse color and vertex color attributes.

Output

Output: float4
The diffuse color of the current pixel.
None
Point Depth The depth of the current pixel in view space.

Output

Output: float
The depth of the current pixel.
None
Normalized Point Depth The depth of the current pixel, expressed in normalized device coordinates.

The result has a value in the range of [0, 1].

Output

Output: float
The depth of the current pixel.
None
Screen Position The position of the current pixel, expressed in screen coordinates.

The screen coordinates are based on the current viewport. The x and y components contain the screen coordinates, the z component contains the depth normalized to a range of [0, 1], and the w component contains the depth value in view space.

Output

Output: float4
The position of the current pixel.
None
Surface Normal The surface normal of the current pixel in object space.

You can use this to calculate lighting contributions and reflections in object space.

Output

Output: float3
The surface normal of the current pixel.
None
Tangent Space Camera Vector The vector that extends from the current pixel to the camera in tangent space.

You can use this to calculate reflections in tangent space.

Output

Output: float3
The vector from the current pixel to the camera.
None
Tangent Space Light Direction The vector that defines the direction in which light is cast from a light source in the tangent space of the current pixel.

You can use this to calculate lighting and specular contributions in tangent space.

Output:

Output: float3
The vector from the current pixel to a light source.
None
World Normal The surface normal of the current pixel in world space.

You can use this to calculate lighting contributions and reflections in world space.

Output

Output: float3
The surface normal of the current pixel.
None
World Position The position of the current pixel in world space.

Output

Output: float4
The position of the current pixel.
None

Parameter nodes

In the Shader Designer, parameter nodes represent inputs to the shader that are under the control of the app on a per-draw basis, for example, material properties, directional lights, camera position, and time. Because you can change these parameters with each draw call, you can use the same shader to give an object different appearances.

Parameter node reference

Node Details Properties
Camera World Position The position of the camera in world space.

Output:

Output: float4
The position of the camera.
None
Light Direction The vector that defines the direction in which light is cast from a light source in world space.

You can use this to calculate lighting and specular contributions in world space.

Output:

Output: float3
The vector from the current pixel to a light source.
None
Material Ambient The diffuse color contribution of the current pixel that is attributed to indirect lighting.

The diffuse color of a pixel simulates how lighting interacts with rough surfaces. You can use the Material Ambient parameter to approximate how indirect lighting contributes to the appearance of an object in the real world.

Output:

Output: float4
The diffuse color of the current pixel that's due to indirect—that is, ambient—lighting.
Access
Public to enable the property to be set from the Model Editor; otherwise, Private.

Value
The diffuse color of the current pixel that's due to indirect—that is, ambient—lighting.
Material Diffuse A color that describes how the current pixel diffuses direct lighting.

The diffuse color of a pixel simulates how lighting interacts with rough surfaces. You can use the Material Diffuse parameter to change how the current pixel diffuses direct lighting—that is, directional, point, and spot lights.

Output:

Output: float4
A color that describes how the current pixel diffuses direct lighting.
Access
Public to enable the property to be set from the Model Editor; otherwise, Private.

Value
A color that describes how the current pixel diffuses direct lighting.
Material Emissive The color contribution of the current pixel that is attributed to lighting that it supplies to itself.

You can use this to simulate a glowing object; that is, an object that supplies its own light. This light doesn't affect other objects.

Output:

Output: float4
The color contribution of the current pixel that's due to self-provided lighting.
Access
Public to enable the property to be set from the Model Editor; otherwise, Private.

Value
The color contribution of the current pixel that's due to self-provided lighting.
Material Specular A color that describes how the current pixel reflects direct lighting.

The specular color of a pixel simulates how lighting interacts with smooth, mirror-like surfaces. You can use the Material Specular parameter to change how the current pixel reflects direct lighting—that is, directional, point, and spot lights.

Output:

Output: float4
A color that describes how the current pixel reflects direct lighting.
Access
Public to allow the property to be set from the Model Editor; otherwise, Private.

Value
A color that describes how the current pixel reflects direct lighting.
Material Specular Power A scalar value that describes the intensity of specular highlights.

The larger the specular power, the more intense and far-reaching the specular highlights become.

Output:

Output: float
An exponential term that describes the intensity of specular highlights on the current pixel.
Access
Public to enable the property to be set from the Model Editor; otherwise, Private.

Value
The exponent that defines the intensity of specular highlights on the current pixel.
Normalized Time The time in seconds, normalized to the range [0, 1], such that when time reaches 1, it resets to 0.

You can use this as a parameter in shader calculations, for example, to animate texture coordinates, color values, or other attributes.

Output:

Output: float
The normalized time, in seconds.
None
Time The time in seconds.

You can use this as a parameter in shader calculations, for example, to animate texture coordinates, color values, or other attributes.

Output:

Output: float
The time, in seconds.
None

Texture nodes

In the Shader Designer, texture nodes sample various texture types and geometries, and produce or transform texture coordinates. Textures provide color and lighting detail on objects.

Texture node reference

Node Details Properties
Cubemap Sample Takes a color sample from a cubemap at the specified coordinates.

You can use a cubemap to provide color detail for reflection effects, or to apply to a spherical object a texture that has less distortion than a 2D texture.

Input:

UVW: float3
A vector that specifies the location on the texture cube where the sample is taken. The sample is taken where this vector intersects the cube.

Output:

Output: float4
The color sample.
Texture
The texture register that's associated with the sampler.
Normal Map Sample Takes a normal sample from a 2D normal map at the specified coordinates

You can use a normal map to simulate the appearance of additional geometric detail on the surface of an object. Normal maps contain packed data that represents a unit vector instead of color data

Input:

UV: float2
The coordinates where the sample is taken.

Output:

Output: float3
The normal sample.
Axis Adjustment
The factor that's used to adjust the handiness of the normal map sample.

Texture
The texture register that's associated with the sampler.
Pan UV Pans the specified texture coordinates as a function of time.

You can use this to move a texture or normal map across the surface of an object.

Input:

UV: float2
The coordinates to pan.

Time: float
The length of time to pan by, in seconds.

Output:

Output: float2
The panned coordinates.
Speed X
The number of texels that are panned along the x axis, per second.

Speed Y
The number of texels that are panned along the y axis, per second.
Parallax UV Displaces the specified texture coordinates as a function of height and viewing angle.

The effect this creates is known as parallax mapping, or virtual displacement mapping. You can use it to create an illusion of depth on a flat surface.

Input:

UV: float2
The coordinates to displace.

Height: float
The heightmap value that's associated with the UV coordinates.

Output:

Output: float2
The displaced coordinates.
Depth Plane
The reference depth for the parallax effect. By default, the value is 0.5. Smaller values lift the texture; larger values sink it into the surface.

Depth Scale
The scale of the parallax effect. This makes the apparent depth more or less pronounced. Typical values range from 0.02 to 0.1.
Rotate UV Rotates the specified texture coordinates around a central point as a function of time.

You can use this to spin a texture or normal map on the surface of an object.

Input:

UV: float2
The coordinates to rotate.

Time: float
The length of time to pan by, in seconds.

Output:

Output: float2
The rotated coordinates.
Center X
The x coordinate that defines the center of rotation.

Center Y
The y coordinate that defines the center of rotation.

Speed
The angle, in radians, by which the texture rotates per second.
Texture Coordinate The texture coordinates of the current pixel.

The texture coordinates are determined by interpolating among the texture coordinate attributes of nearby vertices. You can think of this as the position of the current pixel in texture space.

Output:

Output: float2
The texture coordinates.
None
Texture Dimensions Outputs the width and height of a 2D texture map.

You can use the texture dimensions to consider the width and height of the texture in a shader.

Output:

Output: float2
The width and height of the texture, expressed as a vector. The width is stored in the first element of the vector. The height is stored in the second element.
Texture
The texture register that's associated with the texture dimensions.
Texel Delta Outputs the delta (distance) between the texels of a 2D texture map.

You can use the texel delta to sample neighboring texel values in a shader.

Output:

Output: float2
The delta (distance) from a texel to the next texel (moving diagonally in the positive direction), expressed as a vector in normalized texture space. You can derive the positions of all neighboring texels by selectively ignoring or negating the U or V coordinates of the delta.
Texture
The texture register that's associated with the texel delta.
Texture Sample Takes a color sample from a 2D texture map at the specified coordinates.

You can use a texture map to provide color detail on the surface of an object.

Input:

UV: float2
The coordinates where the sample is taken.

Output:

Output: float4
The color sample.
Texture
The texture register that's associated with the sampler.

Math nodes

In the Shader Designer, math nodes perform algebraic, logic, trigonometric, and other mathematical operations.

Note

When you work with math nodes in the Shader Designer, type promotion is especially evident. For more information about how type promotion affects input parameters, see the Promotion of inputs section.

Math node reference

Node Details Properties
Abs Computes the absolute value of the specified input per component.

For each component of input X, negative values are made positive so that every component of the result has a positive value.

Input:

X: float, float2, float3, or float4
The values for which to determine the absolute value.

Output:

Output: same as input X
The absolute value, per component.
None
Add Computes the component-wise sum of the specified inputs per component.

For each component of the result, the corresponding components of input X and input Y are added together.

Input:

X: float, float2, float3, or float4
One of the values to add together.

Y: same as input X
One of the values to add together.

Output:

Output: same as input X
The sum, per component.
None
Ceil Computes the ceiling of the specified input per component.

The ceiling of a value is the smallest integer that's greater than or equal to that value.

Input:

X: float, float2, float3, or float4
The values for which to compute the ceiling.

Output:

Output: same as input X
The ceiling, per component.
None
Clamp Clamps each component of the specified input to a predefined range.

For each component of the result, values that are below the defined range are made equal to the minimum value in the range, values that are above the defined range are made equal to the maximum value in the range, and values that are in the range aren't changed.

Input:

X: float, float2, float3, or float4
The values to clamp.

Output:

Output: same as input X
The clamped value, per component.
Max
The largest possible value in the range.

Min
The smallest possible value in the range.
Cos Computes the cosine of the specified input, in radians, per component.

For each component of the result, the cosine of the corresponding component, which is provided in radians, is calculated. The result has components that have values in the range of [-1, 1].

Input:

X: float, float2, float3, or float4
The values to compute the cosine of, in radians.

Output:

Output: same as input X
The cosine, per component.
None
Cross Computes the cross product of the specified three-component vectors.

You can use the cross product to compute the normal of a surface that's defined by two vectors.

Input:

X: float3
The vector on the left-hand-side of the cross product.

Y: float3
The vector on the right-hand-side of the cross product.

Output:

Output: float3
The cross product.
None
Distance Computes the distance between the specified points.

The result is a positive scalar value.

Input:

X: float, float2, float3, or float4
One of the points to determine the distance between.

Y: same as input X
One of the points to determine the distance between.

Output:

Output: same as input X
The distance.
None
Divide Computes the component-wise quotient of the specified inputs.

For each component of the result, the corresponding component of input X is divided by the corresponding component of input Y.

Input:

X: float, float2, float3, or float4
The dividend values.

Y: same as input X
The divisor values.

Output:

Output: same as input X
The quotient, per component.
None
Dot Computes the dot product of the specified vectors.

The result is a scalar value. You can use the dot product to determine the angle between two vectors.

Input:

X: float, float2, float3, or float4
One of the terms.

Y: same as input X
One of the terms.

Output:

Output: float
The dot product.
None
Floor Computes the floor of the specified input per component.

For each component of the result, its value is the largest whole integer value that's less than or equal to the corresponding component of the input. Every component of the result is a whole integer.

Input:

X: float, float2, float3, or float4
The values for which to compute the floor.

Output:

Output: same as input X
The floor, per component.
None
Fmod Computes the component-wise modulus (remainder) of the specified inputs.

For each component of the result, some integral (whole-number) multiple, m, of the corresponding component of input Y is subtracted from the corresponding component of input X, leaving a remainder. The multiple, m, is chosen such that the remainder is less than the corresponding component of input Y and has the same sign as the corresponding component of input X. For example, fmod(-3.14, 1.5) is -0.14.

Input:

X: float, float2, float3, or float4
The dividend values.

Y: same as input X
The divisor values.

Output:

Output: same as input X
The modulus, per component.
None
Frac Removes the integral (whole-number) part of the specified input per component.

For each component of the result, the integral part of the corresponding component of the input is removed, but the fractional part and sign are retained. This fractional value falls in the range [0, 1). For example, the value -3.14 becomes the value -0.14.

Input:

X: float, float2, float3, or float4
The values for which to compute the fractional part.

Output:

Output: same as input X
The fractional part, per component.
None
Lerp Linear Interpolation. Computes the component-wise weighted average of the specified inputs.

For each component of the result, the weighted average of the corresponding components of the inputs X and Y. The weight is provided by Percent, a scalar, and is uniformly applied to all components. You can use this to interpolate between points, colors, attributes, and other values.

Input:

X: float, float2, float3, or float4
The originating value. When Percent is zero, the result is equal to this input.

Y: same as input X
The terminal value. When Percent is one, the result is equal to this input.

Percent: float
A scalar weight that's expressed as a percentage of the distance from input X towards input Y.

Output:

Output: same as input X
A value that's collinear with the specified inputs.
None
Multiply Add Computes the component-wise multiply-add of the specified inputs.

For each component of the result, the product of the corresponding components of the inputs M and A is added to the corresponding component of input B. This operation sequence is found in common formulas—for example, in the point-slope formula of a line, and in the formula to scale and then bias an input.

Input:

M: float, float2, float3, or float4
One of the values to multiply together.

A: same as input M
One of the values to multiply together.

B: same as input M
The values to add to the product of the other two inputs.

Output:

Output: same as input M
The result of the multiply-add, per component.
None
Max Computes the component-wise maximum of the specified inputs.

For each component of the result, the greater of the corresponding components of the inputs is taken.

Input:

X: float, float2, float3, or float4
One of the values for which to compute the maximum.

Y: same as input X
One of the values for which to compute the maximum.

Output:

Output: same as input X
The maximum value, per component.
None
Min Computes the component-wise minimum of the specified inputs.

For each component of the result, the lesser of the corresponding components of the inputs is taken.

Input:

X: float, float2, float3, or float4
One of the values for which to compute the minimum.

Y: same as input X
One of the values for which to compute the minimum.

Output:

Output: same as input X
The minimum value, per component.
None
Multiply Computes the component-wise product of the specified inputs.

For each component of the result, the corresponding components of the inputs X and Y are multiplied together.

Input:

X: float, float2, float3, or float4
One of the values to multiply together.

Y: same as input X
One of the values to multiply together.

Output:

Output: same as input X
The product, per component.
None
Normalize Normalizes the specified vector.

A normalized vector retains the direction of the original vector, but not its magnitude. You can use normalized vectors to simplify calculations where the magnitude of a vector isn't important.

Input:

X: float2, float3, or float4
The vector to normalize.

Output:

Output: same as input X
The normalized vector.
None
One Minus Computes the difference between 1 and the specified input per component.

For each component of the result, the corresponding component of the input is subtracted from 1.

Input:

X: float, float2, float3, or float4
The values to be subtracted from 1.

Output:

Output: same as input X
The difference between 1 and the specified input, per component.
None
Power Computes the component-wise exponentiation (power) of the specified inputs.

For each component of the result, the corresponding component of input X is raised to the power of the corresponding component of the input Y.

Input:

X: float, float2, float3, or float4
The base values

Y: same as input X
The exponent values.

Output:

Output: same as input X
The exponentiation, per component.
None
Saturate Clamps each component of the specified input to the range [0, 1].

You can use this range to represent percentages and other relative measurements in calculations. For each component of the result, the corresponding component values of the input that are less than 0 are made equal to 0, values that are larger than 1 are made equal to 1, and values that are in the range aren't changed.

Input:

X: float, float2, float3, or float4
The values to saturate.

Output:

Output: same as input X
The saturated value, per component.
None
Sin Computes the sine of the specified input, in radians, per component.

For each component of the result, the sine of the corresponding component, which is provided in radians, is calculated. The result has components that have values in the range [-1, 1].

Input:

X: float, float2, float3, or float4
The values to compute the sine of, in radians.

Output:

Output: same as input X
The sine, per component.
None
Sqrt Computes the square root of the specified input, per component.

For each component of the result, the square root of the corresponding component is calculated.

Input:

X: float, float2, float3, or float4
The values for which to compute the square root.

Output:

Output: same as input X
The square root, per component.
None
Subtract Computes the component-wise difference of the specified inputs.

For each component of the result, the corresponding component of input Y is subtracted from the corresponding component of input X. You can use this to compute the vector that extends from the first input to the second.

Input:

X: float, float2, float3, or float4
The values to be subtracted from.

Y: same as input X
The values to subtract from input X.

Output:

Output: same as input X
The difference, per component.
None
Transform 3D Vector Transforms the specified 3D vector into a different space.

You can use this to bring points or vectors into a common space so that you can use them to perform meaningful calculations.

Input:

Vector: float3
The vector to transform.

Output:

Output: float3
The transformed vector.
From System
The native space of the vector.

To System
The space to transform the vector into.

Utility nodes

In the Shader Designer, utility nodes represent common, useful shader calculations that don't fit neatly into the other categories. Some utility nodes perform simple operations such as appending vectors together or choosing results conditionally, and others perform complex operations such as computing lighting contributions according to popular lighting models.

Utility node reference

Node Details Properties
Append Vector Creates a vector by appending the specified inputs together.

Input:

Vector: float, float2, or float3
The values to append to.

Value to Append: float
The value to append.

Output:

Output: float2, float3, or float4 depending on the type of input Vector
The new vector.
None
Fresnel Computes the Fresnel fall-off based on the specified surface normal.

The Fresnel fall-off value expresses how closely the surface normal of the current pixel coincides with the view vector. When the vectors are aligned, the result of the function is 0; the result increases as the vectors become less similar, and reaches its maximum when the vectors are orthogonal. You can use this to make an effect more or less apparent based on the relationship between the orientation of the current pixel and the camera.

Input:

Surface Normal: float3
The surface normal of the current pixel, defined in the current pixel's tangent space. You can use this to perturb the apparent surface normal, as in normal mapping.

Output:

Output: float
The reflectivity of the current pixel.
Exponent
The exponent that's used to calculate the Fresnel fall-off.
If Conditionally chooses one of three potential results per component. The condition is defined by the relationship between two other specified inputs.

For each component of the result, the corresponding component of one of the three potential results is chosen, based on the relationship between the corresponding components of the first two inputs.

Input:

X: float, float2, float3, or float4
The left-hand side value to compare.

Y: same type as input X
The right-hand side value to compare.

X > Y: same type as input X
The values that are chosen when X is greater than Y.

X = Y: same type as input X
The values that are chosen when X is equal to Y.

X < Y: same type as input X
The values that are chosen when X is less than Y.

Output:

Output: float3
The chosen result, per component.
None
Lambert Computes the color of the current pixel according to the Lambert lighting model, by using the specified surface normal.

This color is the sum of ambient color and diffuse lighting contributions under direct lighting. Ambient color approximates the total contribution of indirect lighting, but looks flat and dull without the help of additional lighting. Diffuse lighting helps add shape and depth to an object.

Input:

Surface Normal: float3
The surface normal of the current pixel, defined in the current pixel's tangent space. You can use this to perturb the apparent surface normal, as in normal mapping.

Diffuse Color: float3
The diffuse color of the current pixel, typically the Point Color. If no input is provided, the default value is white.

Output:

Output: float3
The diffuse color of the current pixel.
None
Mask Vector Masks components of the specified vector.

You can use this to remove specific color channels from a color value, or to prevent specific components from having an effect on subsequent calculations.

Input:

Vector: float4
The vector to mask.

Output:

Output: float4
The masked vector.
Red / X
False to mask out the red (x) component; otherwise, True.

Green / Y
False to mask out the green (y) component; otherwise, True.

Blue / Z
False to mask out the blue (z) component; otherwise, True.

Alpha / W
False to mask out the alpha (w) component; otherwise, True.
Reflection Vector Computes the reflection vector for the current pixel in tangent space, based on the camera position.

You can use this to calculate reflections, cubemap coordinates, and specular lighting contributions

Input:

Tangent Space Surface Normal: float3
The surface normal of the current pixel, defined in the current pixel's tangent space. You can use this to perturb the apparent surface normal, as in normal mapping.

Output:

Output: float3
The reflection vector.
None
Specular Computes the specular lighting contribution according to the Phong lighting model, by using the specified surface normal.

Specular lighting gives a shiny, reflective appearance to an object, for example, water, plastic, or metals.

Input:

Surface Normal: float3
The surface normal of the current pixel, defined in the current pixel's tangent space. You can use this to perturb the apparent surface normal, as in normal mapping.

Output:

Output: float3
The color contribution of specular highlights.
None

Filter nodes

In the Shader Designer, filter nodes transform an input—for example, a color or texture sample—into a figurative color value. These figurative color values are commonly used in non-photorealistic rendering or as components in other visual effects.

Filter node reference

Node Details Properties
Blur Blurs pixels in a texture by using a Gaussian function.

You can use this to reduce color detail or noise in a texture.

Input:

UV: float2
The coordinates of the texel to test.

Output:

Output: float4
The blurred color value.
Texture
The texture register that's associated with the sampler that's used during blurring.
Desaturate Reduces the amount of color in the specified color.

As color is removed, the color value approaches its gray-scale equivalent.

Input:

RGB: float3
The color to desaturate.

Percent: float
The percent of color to remove, expressed as a normalized value in the range [0, 1].

Output:

Output: float3
The desaturated color.
Luminance
The weights that are given to the red, green, and blue color components.
Edge Detection Detects edges in a texture by using a Canny edge detector. Edge pixels are output as white; nonedge pixels are output as black.

You can use this to identify edges in a texture so that you can use additional effects to treat edge pixels.

Input:

UV: float2
The coordinates of the texel to test.

Output:

Output: float4
White if the texel is on an edge; otherwise, black.
Texture
The texture register that's associated with the sampler that's used during edge detection.
Sharpen Sharpens a texture.

You can use this to highlight fine details in a texture.

Input:

UV: float2
The coordinates of the texel to test.

Output:

Output: float4
The blurred color value.
Texture
The texture register that's associated with the sampler that's used during sharpening.

Next steps

To learn more, see Create Shaders with Shader Designer in Visual Studio.