From 59438f680d4e3373b075daab8152e2d6a8260c0d Mon Sep 17 00:00:00 2001 From: sarah-welton <82842355+sarah-welton@users.noreply.github.com> Date: Mon, 30 Aug 2021 17:03:36 -0400 Subject: [PATCH 1/2] Backport of changes from Val's work on DOC-2627 For ticket DOC-3319/GSG-543 --- com.unity.shadergraph/CHANGELOG.md | 4 +++- .../Documentation~/View-Direction-Node.md | 13 +++++++++++-- .../Documentation~/View-Vector-Node.md | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 com.unity.shadergraph/Documentation~/View-Vector-Node.md diff --git a/com.unity.shadergraph/CHANGELOG.md b/com.unity.shadergraph/CHANGELOG.md index 5050275a992..b0df3bb5b47 100644 --- a/com.unity.shadergraph/CHANGELOG.md +++ b/com.unity.shadergraph/CHANGELOG.md @@ -8,12 +8,14 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Added - Added subshadergraphs for SpeedTree 8 shadergraph support: SpeedTree8Wind, SpeedTree8ColorAlpha, SpeedTree8Billboard. -- Added an HLSL file implementing a version of the Unity core LODDitheringTransition function which can be used in a Shader Graph +- Added an HLSL file implementing a version of the Unity core LODDitheringTransition function which can be used in a Shader Graph\ +- Added View Vector Node doc ### Changed - Only ShaderGraph keywords count towards the shader permutation variant limit, SubGraph keywords do not. ### Fixed +- Updated/corrected View Direction doc - Fixed an issue where horizontal scrollbars in graph sub windows could not have their lower scroll button used due to being overlapped by the resize handles [1320993] - Fixed an issue where nodes with ports on one side would appear incorrectly on creation [1262050] - Fixed a broken link in the TOC to Main Preview diff --git a/com.unity.shadergraph/Documentation~/View-Direction-Node.md b/com.unity.shadergraph/Documentation~/View-Direction-Node.md index ec1e8cc6802..e3a29e78153 100644 --- a/com.unity.shadergraph/Documentation~/View-Direction-Node.md +++ b/com.unity.shadergraph/Documentation~/View-Direction-Node.md @@ -2,7 +2,16 @@ ## Description -Provides access to the mesh vertex or fragment's **View Direction** vector. This is the vector from the vertex or fragment to the camera. The coordinate space of the output value can be selected with the **Space** dropdown parameter. +Provides access to the mesh vertex or fragment's **View Direction** vector. This is the vector from the vertex or fragment to the camera. Select a **Space** to modify the coordinate space of the output value. +In versions prior to version 11.0, the **View Direction Node** works differently in HDRP than in URP. In URP, it only stored Object space vectors normalized. HDRP stores all vectors normalized. + +From 11.0 onwards, this node stores all vectors normalized in both the **High-Definition Render Pipeline** and the **Universal Render Pipeline**. + +If you want to keep using the old behavior in URP outside of object space, replace this node with a **View Vector Node**. + + + + ## Ports @@ -14,4 +23,4 @@ Provides access to the mesh vertex or fragment's **View Direction** vector. This | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| -| Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. | +| Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. | \ No newline at end of file diff --git a/com.unity.shadergraph/Documentation~/View-Vector-Node.md b/com.unity.shadergraph/Documentation~/View-Vector-Node.md new file mode 100644 index 00000000000..dfe7f0cfa62 --- /dev/null +++ b/com.unity.shadergraph/Documentation~/View-Vector-Node.md @@ -0,0 +1,19 @@ +# View Vector Node + +## 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. +Select a **Space** to modify the coordinate space of the output value. + +## Ports + +| Name | Direction | Type | Binding | Description | +|:------------ |:-------------|:-----|:---|:---| +| Out | Output | Vector 3 | None |View Direction for the Mesh Vertex/Fragment. | + + +## Controls + +| Name | Type | Options | Description | +|:------------ |:-------------|:-----|:---| +| Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of View Direction to output. | From ec73d2905f0fd3e839d63b21aa7d57cb9956be88 Mon Sep 17 00:00:00 2001 From: sarah-welton <82842355+sarah-welton@users.noreply.github.com> Date: Tue, 31 Aug 2021 17:51:07 -0400 Subject: [PATCH 2/2] Added new line at end of file --- com.unity.shadergraph/Documentation~/View-Direction-Node.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/com.unity.shadergraph/Documentation~/View-Direction-Node.md b/com.unity.shadergraph/Documentation~/View-Direction-Node.md index e3a29e78153..72a6369c262 100644 --- a/com.unity.shadergraph/Documentation~/View-Direction-Node.md +++ b/com.unity.shadergraph/Documentation~/View-Direction-Node.md @@ -23,4 +23,4 @@ If you want to keep using the old behavior in URP outside of object space, repla | Name | Type | Options | Description | |:------------ |:-------------|:-----|:---| -| Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. | \ No newline at end of file +| Space | Dropdown | Object, View, World, Tangent | Selects coordinate space of **View Direction** to output. |