參數節點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: float4Output: 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: float3Output: 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: float4Output: 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: float4Output: 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: float4Output: 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: float4Output: 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: floatOutput: 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 秒數,標準化為範圍 [0, 1],如此,當時間達到 1 時,就會重設為 0。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: floatOutput: float
標準化時間,以秒為單位。The normalized time, in seconds.
None
TimeTime 時間 (秒)。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: floatOutput: float
時間,以秒為單位。The time, in seconds.
None