Skip to content

Commit 290865b

Browse files
authored
Merge pull request #8260 from Unity-Technologies/internal/6000.0/staging
Mirror Internal/6000.0/staging
2 parents 31e89cf + 48a8a5b commit 290865b

File tree

439 files changed

+21974
-12336
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

439 files changed

+21974
-12336
lines changed

Packages/com.unity.render-pipelines.core/ShaderLibrary/CommonLighting.hlsl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ real ConvertLuminanceToEv(real luminance)
7979

8080
// Non physically based hack to limit light influence to attenuationRadius.
8181
// Square the result to smoothen the function.
82-
real DistanceWindowing(real distSquare, real rangeAttenuationScale, real rangeAttenuationBias)
82+
real DistanceWindowing(float distSquare, real rangeAttenuationScale, real rangeAttenuationBias)
8383
{
8484
// If (range attenuation is enabled)
8585
// rangeAttenuationScale = 1 / r^2

Packages/com.unity.render-pipelines.core/ShaderLibrary/Shadow/ShadowSamplingTent.hlsl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void SampleShadow_GetTexelWeights_Tent_7x7(real offset, out real4 texelsWeightsA
106106
}
107107

108108
// 3x3 Tent filter (45 degree sloped triangles in U and V)
109-
void SampleShadow_ComputeSamples_Tent_3x3(real4 shadowMapTexture_TexelSize, real2 coord, out real fetchesWeights[4], out real2 fetchesUV[4])
109+
void SampleShadow_ComputeSamples_Tent_3x3(real4 shadowMapTexture_TexelSize, float2 coord, out real fetchesWeights[4], out real2 fetchesUV[4])
110110
{
111111
// tent base is 3x3 base thus covering from 9 to 12 texels, thus we need 4 bilinear PCF fetches
112112
real2 tentCenterInTexelSpace = coord.xy * shadowMapTexture_TexelSize.zw;
@@ -186,7 +186,7 @@ void SampleShadow_ComputeSamples_Tent_3x3(real4 shadowMapTexture_TexelSize, real
186186
(fetchesWeights)[8] = fetchesWeightsU.z * fetchesWeightsV.z; \
187187
}
188188

189-
void SampleShadow_ComputeSamples_Tent_5x5(real4 shadowMapTexture_TexelSize, real2 coord, out real fetchesWeights[9], out real2 fetchesUV[9])
189+
void SampleShadow_ComputeSamples_Tent_5x5(real4 shadowMapTexture_TexelSize, float2 coord, out real fetchesWeights[9], out real2 fetchesUV[9])
190190
{
191191
SampleShadow_ComputeSamples_Tent_Filter_5x5(real, shadowMapTexture_TexelSize, coord, fetchesWeights, fetchesUV);
192192
}
@@ -254,7 +254,7 @@ void SampleShadow_ComputeSamples_Tent_5x5(real4 shadowMapTexture_TexelSize, real
254254

255255

256256

257-
void SampleShadow_ComputeSamples_Tent_7x7(real4 shadowMapTexture_TexelSize, real2 coord, out real fetchesWeights[16], out real2 fetchesUV[16])
257+
void SampleShadow_ComputeSamples_Tent_7x7(real4 shadowMapTexture_TexelSize, float2 coord, out real fetchesWeights[16], out real2 fetchesUV[16])
258258
{
259259
SampleShadow_ComputeSamples_Tent_Filter_7x7(real, shadowMapTexture_TexelSize, coord, fetchesWeights, fetchesUV);
260260
}

Packages/com.unity.render-pipelines.high-definition/Runtime/Lighting/LightEvaluation.hlsl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -455,12 +455,12 @@ float4 EvaluateCookie_Punctual(LightLoopContext lightLoopContext, LightData ligh
455455
return cookie;
456456
}
457457

458-
real PunctualLightAttenuationWithDistanceModification(real4 distances, real rangeAttenuationScale, real rangeAttenuationBias,
458+
real PunctualLightAttenuationWithDistanceModification(float4 distances, real rangeAttenuationScale, real rangeAttenuationBias,
459459
real lightAngleScale, real lightAngleOffset)
460460
{
461-
real distSq = distances.y;
462-
real distRcp = distances.z; //distance contains light size modification. See ModifyDistancesForFillLighting
463-
real distProj = distances.w;
461+
float distSq = distances.y;
462+
float distRcp = distances.z; //distance contains light size modification. See ModifyDistancesForFillLighting
463+
float distProj = distances.w;
464464
real cosFwd = distProj * rcp(distances.x); //we recompute inv distance here
465465

466466
real attenuation = min(distRcp, 1.0 / PUNCTUAL_LIGHT_THRESHOLD);

Packages/com.unity.shadergraph/Documentation~/Normal-Strength-Node.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
## Description
44

5-
Adjusts the strength of the normal map defined by input **In** by the amount of input **Strength**. A **Strength** value of 1 will return the input unaltered. A **Strength** value of 0 will return a blank normal map.
5+
Adjusts the strength of the normal map defined by input **In** by the amount of input **Strength**. A **Strength** value of 1 will return the input unaltered. A **Strength** value of 0 will return a blank (flat) tangent-space normal: vector (0, 0, 1). When encoded as a texture color in the 0–1 range, this corresponds to (0.5, 0.5, 1.0) or 128, 128, 255 in 8-bit.
66

77
## Ports
88

Packages/com.unity.shadergraph/Documentation~/Sample-Texture-2D-Node.md

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -27,23 +27,19 @@ The Sample Texture 2D [!include[nodes-inputs](./snippets/nodes-inputs.md)]
2727
| **Texture** | Texture 2D | None | The Texture 2D asset to sample.|
2828
| **UV** | Vector 2 | UV | The UV coordinates to use to sample the texture. |
2929
| **Sampler** | Sampler State | Default Sampler State | The Sampler State and settings to use to sample the texture.|
30-
| **LOD** | Float | LOD | The specific mip to use when sampling the Texture. **NOTE** The **LOD** Input port only displays if **Mip Sampling Mode** is **LOD**. For more information, refer to [Additional node settings](#additional-node-settings). |
31-
| **Bias** | Float | Bias | **NOTE**: The **Bias** Input port only displays if **Mip Sampling Mode** is **Bias**. For more information, refer to [Additional node settings](#additional-node-settings). If **Use Global Mip Bias** is enabled, Unity adds this Bias amount to the Global Mip Bias for a texture's mip calculation. If **Global Mip Bias** is disabled, Unity uses this Bias amount instead of the Global Mip Bias. |
32-
| **DDX** | Float | DDY | **NOTE**: The DDX Input port only displays if **Mip Sampling Mode** is **Gradient**. For more information, refer to [Additional node settings](#additional-node-settings). The specific DDX value to use to calculate the texture's mip when sampling. For more information on DDX values for mipmaps, refer to [Mipmaps introduction](https://docs.unity3d.com/Documentation/Manual/texture-mipmaps-introduction.html) in the Unity User Manual. |
33-
| **DDY** | Float | DDY | **NOTE** The **DDY** Input port only displays if **Mip Sampling Mode** is **Gradient**. For more information, refer to [Additional node settings](#additional-node-settings). The specific DDY value to use to calculate the texture's mip when sampling. For more information on DDY values for mipmaps, refer to [Mipmaps introduction](https://docs.unity3d.com/Documentation/Manual/texture-mipmaps-introduction.html)> in the Unity User Manual. |
30+
| **LOD** | Float | LOD | The specific mip to use when sampling the Texture.<br/>**Note**: The **LOD** Input port only displays if **Mip Sampling Mode** is **LOD**. For more information, refer to [Additional node settings](#additional-node-settings). |
31+
| **Bias** | Float | Bias | When you enable **Use Global Mip Bias**, Unity adds this Bias amount to the Global Mip Bias for a texture's mip calculation. When you disable **Global Mip Bias**, Unity uses this Bias amount instead of the Global Mip Bias. <br/>**Note**: The **Bias** Input port only displays if **Mip Sampling Mode** is **Bias**. For more information, refer to [Additional node settings](#additional-node-settings). |
32+
| **DDX** | Float | DDY | The specific DDX value to use to calculate the texture's mip when sampling. For more information on DDX values for mipmaps, refer to [Mipmaps introduction](https://docs.unity3d.com/Documentation/Manual/texture-mipmaps-introduction.html) in the Unity User Manual.<br/>**Note**: The DDX Input port only displays if **Mip Sampling Mode** is **Gradient**. For more information, refer to [Additional node settings](#additional-node-settings). |
33+
| **DDY** | Float | DDY | The specific DDY value to use to calculate the texture's mip when sampling. For more information on DDY values for mipmaps, refer to [Mipmaps introduction](https://docs.unity3d.com/Documentation/Manual/texture-mipmaps-introduction.html)> in the Unity User Manual.<br/>**Note**: The **DDY** Input port only displays if **Mip Sampling Mode** is **Gradient**. For more information, refer to [Additional node settings](#additional-node-settings). |
3434

3535
## Controls
3636

3737
The Sample Texture 2D [!include[nodes-controls](./snippets/nodes-controls.md)]
3838

39-
| **Name** | **Type** | **Subtype** | **Description** |
40-
|----------|--------------|-------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
41-
| **Type** | **Dropdown** | N/A | Select whether the texture is a Texture asset or a normal map. |
42-
| N/A | N/A | **Default** | The texture is a Texture asset. |
43-
| N/A | N/A | **Normal** | The texture is a normal map. |
44-
| Space | Dropdown | N/A | Select whether the texture is a Texture asset or a normal map. |
45-
| N/A | N/A | **Tangent** | Use a Tangent normal map whenever the mesh for a geometry needs to deform or change, such as when animating a character. With Tangent Space, the normal map's normals are relative to the existing vertex normals of any geometry rendered with your Shader Graph. Your Shader Graph only adjusts the vertex normals and not override them. |
46-
| N/A | N/A | **Object** | Use an Object normal map whenever the mesh for a geometry is static and doesn't deform. With Object Space, the normal map's normals are explicit and override the normals of any geometry rendered with your Shader Graph. Because a static mesh's normals never change, an Object normal map also maintains consistent lighting across different levels of detail (LODs). <br> For more information about normal maps, refer to Normal map (Bump mapping) in the User manual. |
39+
| **Name** | **Description** |
40+
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
41+
| **Type** | Select whether the texture is a Texture asset or a normal map. The options are:<ul><li>**Default**: Outputs the raw texture data according to the imported texture format or the format specified when the texture/render texture was created. For more information, refer to [GraphicsFormat](https://docs.unity3d.com/Documentation/ScriptReference/Experimental.Rendering.GraphicsFormat.html).</li><li>**Normal**: Interprets the texture as a normal map and outputs RGB in the range [&minus;1, 1]. |
42+
| Space | Select the space used when Type is Normal. Behavior varies based on whether the blue channel is used. The options are:<ul><li>**Tangent**: Assumes an imported Normal Map format where only X and Y are stored. The blue channel is ignored. Use Tangent space for deforming meshes (for example, animated characters). Normals are relative to the mesh’s vertex normals. Shader Graph adjusts but does not override them.</li><li>**Object**: Uses the blue channel and expects the texture to be UNorm in Linear color space. Use Object space for static meshes. Normals override mesh normals and maintain consistent lighting across LODs. |
4743

4844
## Additional node settings
4945

@@ -65,7 +61,7 @@ If the Sample Texture 2D node uses the **Standard** Mip Sampling Mode, the Textu
6561

6662
![An image of the Graph window, that displays a UV Lat Long Subgraph node connected to the UV input port on a Sample Texture 2D node. The Sample Texture 2D provides its RGBA output to the Base Color Block node in the Master Stack. The Main Preview of the sampled Texture has a noticeable seam along the middle of the sphere.](images/sg-sample-texture-2d-node-example.png)
6763

68-
When the Mip Sampling Mode is set to **Gradient**, the Sample Texture 2D node can use the standard set of UVs for the model in the mip level calculation, instead of the latitude and longitude UVs needed for sampling the texture. The new UV coordinates passed into the **DDX** and **DDY** input ports result in a continuous mip level, and remove the seam.
64+
When you set the Mip Sampling Mode to **Gradient**, the Sample Texture 2D node can use the standard set of UVs for the model in the mip level calculation, instead of the latitude and longitude UVs needed for sampling the texture. The new UV coordinates passed into the **DDX** and **DDY** input ports result in a continuous mip level, and remove the seam.
6965

7066
![An image of the Graph window, that displays the same Sample Texture 2D node as the previous image. This time, the Mip Sampling Mode in the Graph Inspector has been set to Gradient. The new DDX and DDY input ports on the Sample Texture 2D node receive input from a DDX and DDY node, with input from a UV node. The seam on the Main Preview of the Texture has disappeared.](images/sg-sample-texture-2d-node-example-2.png)
7167

Packages/com.unity.shadergraph/Documentation~/Shader-Graph-Sample-UGUI-Shaders.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ We have two main objectives with this sample set:
2424
Documentation for this set of samples is broken into the following pages:
2525

2626
* [Getting started](Shader-Graph-Sample-UGUI-Shaders-Getting-Started.md)
27-
* [Custom UI componenents](Shader-Graph-Sample-UGUI-Shaders-Custom-UI-components.md)
27+
* [Custom UI components](Shader-Graph-Sample-UGUI-Shaders-Custom-UI-components.md)
2828
* [Custom nodes](Shader-Graph-Sample-UGUI-Shaders-Custom-nodes.md)
2929
* [Subgraph nodes](Shader-Graph-Sample-UGUI-Shaders-Subgraph-nodes.md)
3030
* [Examples](Shader-Graph-Sample-UGUI-Shaders-Examples.md)

Packages/com.unity.shadergraph/Documentation~/Swizzle-Node.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ Creates a new [vector](https://docs.unity3d.com/Manual/VectorCookbook.html) from
77
To specify how input elements should be swizzled, enter a formatting string in the input mask.
88
To invert the order of the input elements, for example, use the string "wzyx" or "abgr".
99

10-
The length of the input mask determines the dimensions of the output vector. The error "Invalid Mask" indicates an input mask value which includes one or more channels that do not exist in the input vector.
10+
The length of the input mask determines the dimensions of the output vector, while the channels used by the input mask determine the dimensions of the input vector.
1111

12-
To output a vector3 with the x, y and z elements of the input vector, for example, use the input mask “xyz” or “rgb”.
12+
For example;
13+
* To output a vector4 that contains two copies of a vector2 input, set **Mask** to `xyxy`.
14+
* To output the alpha value from a vector4 input, set **Mask** to `a`.
1315

1416

1517

0 commit comments

Comments
 (0)