Skip to content

[2021.2] Updates to documentation before release - GSG-581 #5712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions com.unity.shadergraph/Documentation~/Getting-Started.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Getting started with Shader Graph

Shader Graph is only compatible with the Scriptable Render Pipelines (SRPs), namely the High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP). These two SRPs are available in Unity 2018.1 and later. The legacy built-in render pipeline does not support Shader Graph.
As of 2021.2, Shader Graph is compatible with Unity's built-in render pipeline, and the Scriptable Render Pipelines (SRPs): the High Definition Render Pipeline (HDRP) and the Universal Render Pipeline (URP). These two SRPs are available in Unity 2018.1 and later.

Shader Graph now comes included with the HDRP and URP packages. When you add either SRP to your project, Unity automatically loads Shader Graph.
Shader Graph is included with the HDRP and URP packages. When you add either SRP to your project, Unity automatically installs the Shader Graph package. If you are on Unity version 2021.2 and later, you can use Shader Graph with the built-in render pipeline by installing Shader Graph through the Package Manager. For more information on how to install a package, see [Adding and removing packages](https://docs.unity3d.com/Manual/upm-ui-actions.html) in the Unity User Manual.

For more information about setting up either SRP, see [Getting started with HDRP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Getting-started-with-HDRP.html) or [Getting started with URP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html?subfolder=/manual/InstallingAndConfiguringURP.html).
For more information about setting up an SRP, see [Getting started with HDRP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@latest/index.html?subfolder=/manual/Getting-started-with-HDRP.html) or [Getting started with URP](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@latest/index.html?subfolder=/manual/InstallingAndConfiguringURP.html).
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# Graph Settings Menu
# Graph Settings Tab

## Description

The **Graph Settings** tab on the **[Graph Inspector](Internal-Inspector.md)** make it possible to change settings that affect the Shader Graph as a whole.

![](images/GraphSettings_Menu.png)

### Graph Settings Menu
### Graph Settings options

| Menu Item | Description |
|:----------|:------------|
| Precision | A [Precision Type](Precision-Types.md) drop-down menu that lets you set the precision for the entire graph. |
| Preview Mode | Your options are **Inherit**, **Preview 2D**, and **Preview 3D**. |
| Precision | A [Precision Mode](Precision-Modes.md) drop-down menu that lets you set the default precision for the entire graph. You can override the Precision setting here at the node level in your graph.|
| Preview Mode | (Subgraphs only) Your options are **Inherit**, **Preview 2D**, and **Preview 3D**. |
| Active Targets | A list that contains the Targets you've selected. You can add or remove entries using the Add (**+**) and Remove (**-**) buttons. <br/>Shader Graph supports three targets: the [Universal Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@12.0/manual/index.html), the [High Definition Render Pipeline](https://docs.unity3d.com/Packages/com.unity.render-pipelines.high-definition@12.0/manual/index.html), and [Built-In Render Pipeline](https://docs.unity3d.com/2020.3/Documentation/Manual/render-pipelines.html). Target-specific settings appear below the standard setting options. The displayed Target-specific settings change according to which Targets you select. |
14 changes: 8 additions & 6 deletions com.unity.shadergraph/Documentation~/Precision-Modes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@

Shader Graph provides specific [data precision modes](https://en.wikipedia.org/wiki/Precision_(computer_science)) for nodes, graphs, and Sub Graphs to help you optimize your content for different platforms.

To set the precision of an entire graph, open the [Graph Settings](Graph-Settings-Menu) menu and adjust the **Precision** control. You can then use the [context menu](Node) to adjust the precision of individual nodes.
To set the precision of an entire graph, select the [**Graph Settings**](Graph-Settings-Menu) tab in the [Graph Inspector](Internal-Inspector.md) and adjust the **Precision** control. Select a node in your graph and select the **Node Settings** tab in the Graph Inspector to adjust the precision of individual nodes.

## Precision mode settings
| Name | Description |
|------:|------------|
| Single | This is a high-precision floating point value. The number of bits is platform-specific. For modern desktop computers, it is 32 bits.<br/>This mode is useful for world space positions, texture coordinates, and scalar computations that involve complex functions such as trigonometry, power, and exponentiation. |
| Half | This is a low-precision floating point value. The number of bits is platform-specific. For modern desktop computers, it is 16 bits.<br/>This mode is useful for short vectors, directions, object space positions, and many high dynamic range colors, but not very strong light sources, such as the sun.|
| Switchable | This mode is only for Sub Graphs. When you enable this mode for a Sub Graph Node, that node determines the precision of the Sub Graph that it references. See Sub Graph precision within other graphs for more information. |
| Inherit | This mode determines a node's precision based on a set of inheritance rules. See the Precision inheritance section.|
| Switchable | This mode is only for Sub Graphs. When you enable this mode for a Sub Graph, the default precision of the Sub Graph is decided by its Sub Graph node. See **Use Graph Precision** below. |
| Inherit | This mode determines a node's precision based on a set of inheritance rules. See [Precision inheritance](#precision-inheritance).|
| Use Graph Precision | This mode forces this node to use the same precision setting as the graph.<br/>If this is a node in a Sub Graph, and that Sub Graph’s **Precision** is set to **Switchable**, then the precision of this node is the precision of the Sub Graph node representing this Sub Graph. |

## Using Precision Modes
Expand Down Expand Up @@ -88,14 +88,16 @@ Precision behavior and user interface elements for [Sub Graphs](Sub-graph) and t

#### Outputs

To manually determine the precision of a Sub Graph's output, modify the **Output** node’s **Sub Graph Output** setting.
To manually determine the precision of a Sub Graph's output, modify the **Output** node’s **Precision Mode** setting.

#### Inputs

To manually determine the precision of **Sub Graph Inputs**, open the [Internal Inspector](Internal-Inspector) and set precision modes for each individual [Property](Property-Types). Properties that use the Inherit option take on the **Graph Precision** you set for the Sub Graph.
To manually determine the precision of **Sub Graph Inputs**, open the [Graph Inspector](Internal-Inspector) and set precision modes for each individual [Property](Property-Types). Properties that use the Inherit option take on the **Graph Precision** you set for the Sub Graph.

#### Sub Graph Precision within other graphs

By default, you cannot change the precision of a [Sub Graph Node](Sub-graph-Node) in a Shader Graph. This is because the input and output precision you set in a Sub Graph define the precision of its associated Sub Graph Node. However, if you set the **Sub Graph Precision** to **Switchable**, you can adjust Sub Graph Node precision values via your Shader Graph.
By default, a Sub Graph has a Precision Mode of `Switchable`. You can modify Precision Mode of any [Sub Graph node](Sub-graph-Node) for that Sub Graph, as long as you set the Precision Mode on the Sub Graph as `Switchable`.

Shader Graph won't allow you to change the Precision Mode for any Sub Graph node that doesn't have its Sub Graph set to `Switchable`. This is because the input and output precision you set in a Sub Graph define the precision of its associated Sub Graph Node.

For example, let's say that Sub Graph A is **Switchable**. You open Graph 1, which includes a Sub Graph Node referencing Sub Graph A. Like all other nodes, Sub Graph Node A defaults to **Inherit**. You change the precision of Sub Graph Node A to **Half**. The precision of Sub Graph A also becomes **Half**.
2 changes: 1 addition & 1 deletion com.unity.shadergraph/Documentation~/TableOfContents.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* [Main Preview](Main-Preview)
* [Graph Inspector](Internal-Inspector.md)
* [Create Node Menu](Create-Node-Menu)
* [Graph Settings Menu](Graph-Settings-Menu.md)
* [Graph Settings Tab](Graph-Settings-Tab.md)
* [Master Stack](Master-Stack)
* [Sticky Notes](Sticky-Notes)
* [Sub Graph](Sub-graph)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ If you want to keep using the old behavior in URP outside of object space, repla

| Name | Direction | Type | Binding | Description |
|:------------ |:-------------|:-----|:---|:---|
| Out | Output | Vector 3 | None | **View Direction** for the Mesh Vertex/Fragment. |
| Out | Output | Vector 3 | None | View Vector for the Mesh Vertex/Fragment. |

## Controls

Expand Down
4 changes: 2 additions & 2 deletions com.unity.shadergraph/Documentation~/View-Vector-Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

## Description

This node provides access to the mesh vertex or fragment's **View Direction** vector. It does not normalize any of the values it stores. For a normalized option, see [View Direction Node](View-Direction-Node.md).
This node provides access to an unnormalized version of the mesh vertex or fragment's **View Direction** vector. It does not normalize any of the values it stores. For a normalized option, see [View Direction Node](View-Direction-Node.md).

Select a **Space** to modify the output value's coordinate space.

## Ports

| Name | Direction | Type | Binding | Description |
|:------------ |:-------------|:-----|:---|:---|
| Out | Output | Vector 3 | None |View Direction for the Mesh Vertex/Fragment. |
| Out | Output | Vector 3 | None |View Vector for the Mesh Vertex/Fragment. |


## Controls
Expand Down