Unity Products:Amplify Shader Editor/World Space Light Dir and Unity Products:Amplify Shader Editor/World Space View Dir: Difference between pages
(Difference between pages)
ampwiki>Amplify RnD Rick |
AmplifyWiki (talk | contribs) m (1 revision imported) |
||
Line 1: | Line 1: | ||
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | [[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | ||
== World Space View Dir Node == | |||
The World Space View Dir node calculates a non-normalized direction in world space from a position in object/local space given by its [[#paramInput|''Input'']] towards the camera. This node will also return the direction from the current game object to the camera if ''Input'' is left unconnected and its default internal value of (0,0,0,1) is used. | |||
<img class="responsive-img" src="http://wiki.amplify.pt/images/Nodes/WorldSpaceViewDir.jpg"> | |||
<img class="responsive-img" src="http://wiki.amplify.pt/images/ | |||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
|- | |- | ||
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value | ! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value | ||
|- | |- style="background: #e5e5e5;" | | ||
| id=" | | id="paramInput" | ''Input'' | ||
| | | Position in object/local space. Only visible if the respective input port is not connected. | ||
| | | 0,0,0,1 | ||
|} | |} | ||
{| class="wikitable" style="width: 100%;" | |||
|- | |||
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type | |||
|- | |||
| ''Input'' | |||
| Position in object/local space. | |||
| Float4 | |||
|} | |||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
Line 27: | Line 28: | ||
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type | ! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type | ||
|- | |- | ||
| XYZ | |||
| Returns the | | Returns the non-normalized direction in world space from the specified position towards the camera. | ||
| Float3 | | Float3 | ||
|- | |- | ||
| X | |||
| Returns the X component of the | | Returns only the X component of the calculated direction. | ||
| Float | | Float | ||
|- | |- | ||
| Y | |||
| Returns the Y component of the | | Returns only the Y component of the calculated direction. | ||
| Float | | Float | ||
|- | |- | ||
| Z | |||
| Returns the Z component of the | | Returns only the Z component of the calculated direction. | ||
| Float | | Float | ||
|} | |} | ||
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | [[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]] | ||
[[Category:Nodes]][[Category: | [[Category:Nodes]][[Category:Object Transform]] |
Latest revision as of 00:06, 2 December 2023
World Space View Dir Node
The World Space View Dir node calculates a non-normalized direction in world space from a position in object/local space given by its Input towards the camera. This node will also return the direction from the current game object to the camera if Input is left unconnected and its default internal value of (0,0,0,1) is used.
Node Parameter | Description | Default Value |
---|---|---|
Input | Position in object/local space. Only visible if the respective input port is not connected. | 0,0,0,1 |
Input Port | Description | Type |
---|---|---|
Input | Position in object/local space. | Float4 |
Output Port | Description | Type |
---|---|---|
XYZ | Returns the non-normalized direction in world space from the specified position towards the camera. | Float3 |
X | Returns only the X component of the calculated direction. | Float |
Y | Returns only the Y component of the calculated direction. | Float |
Z | Returns only the Z component of the calculated direction. | Float |