Skip to content

Commit 8587521

Browse files
svc-reach-platform-supportEvergreen
authored andcommitted
[Port] [6000.0] DOCG-7285: Improve clarity on Sample Texture 2D node settings
1 parent bc37fe7 commit 8587521

2 files changed

Lines changed: 16 additions & 23 deletions

File tree

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

0 commit comments

Comments
 (0)