Skip to content
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
2 changes: 2 additions & 0 deletions com.unity.shadergraph/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

### Added
- Stereo Eye Index, Instance ID, and Vertex ID nodes added to the shadergraph library.
- Added View Vector Node doc

### Changed
- Updated/corrected View Direction doc
- Change Asset/Create/Shader/Blank Shader Graph to Asset/Create/Shader Graph/Blank Shader Graph
- Change Asset/Create/Shader/Sub Graph to Asset/Create/Shader Graph/Sub Graph
- Change Asset/Create/Shader/VFX Shader Graph to Asset/Create/Shader Graph/VFX Shader Graph
Expand Down
11 changes: 9 additions & 2 deletions com.unity.shadergraph/Documentation~/View-Direction-Node.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +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**.




NOTE: In versions prior to 11.0, the **View Direction** vector was not normalized in the **Universal Render Pipeline**. Version 11.0 changed this behavior, and this vector is now normalized in both the **High-Definition Render Pipeline** and the **Universal Render Pipeline**. To mimic old behavior, you can use the [Position Node](Position-Node.md) in **World** space and subtract the **Position** output of the [Camera Node](Camera-Node.md).

## Ports

Expand Down
19 changes: 19 additions & 0 deletions com.unity.shadergraph/Documentation~/View-Vector-Node.md
Original file line number Diff line number Diff line change
@@ -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.
Copy link
Contributor

@elizabeth-legros elizabeth-legros Mar 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe add "unnormalized", just to help distinguish it from the View Direction node?

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. |