Parameter Nodes

 

The new home for Visual Studio documentation is Visual Studio 2017 Documentation on docs.microsoft.com.

The latest version of this topic can be found at 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.

NodeDetailsProperties
Camera World PositionThe position of the camera in world space.

 Output:

 Output: float4
The position of the camera.
None
Light DirectionThe 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 AmbientThe 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 DiffuseA 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 EmissiveThe 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 SpecularA 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 PowerA 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 TimeThe 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
TimeThe 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
Show: