Unity Products:Amplify Shader Editor/Camera Depth Fade and Unity Products:Amplify Shader Editor/Camera To World Matrix: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
ampwiki>Amplify RnD Rick
No edit summary
 
ampwiki>Amplify RnD Rick
No edit summary
 
Line 1: Line 1:
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]


== Camera Depth Fade Node ==
== Camera To World Matrix Node ==
 
The Camera Depth Fade node outputs the difference between a surface depth and the cameras near plane. The calculated value is set on a linear '''[0,1]''' range and can be tweaked via the [[#paramLength|Length]] and [[#paramOffset|Offset]] parameters.
 
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/CameraDepthFadeNode.jpg">
<br/><font size="1">Nodes used:
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Camera_Depth_Fade|Camera Depth Fade]]
</font>
 
 
{| class="wikitable" style="width: 100%;"
|-
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value
|- style="background: #e5e5e5;" |
| id="paramVertexPosition" | Vertex Position
| Don't use this internal data as it's ignored internally. Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
| id="paramLength" | Length
| Defines the distance in view coordinates over which the fade between 0 and 1 values should occur. Only visible if the respective input port is not connected.
| 0
|- style="background: #e5e5e5;" |
| id="paramOffset" | Offset
| Defines an offset in view coordinates to the cameras near plane on which the fade from 0 to 1 should start. Only visible if the respective input port is not connected.
| 0
|}
 


The Camera To World Matrix node returns something in the likes of the inverse view matrix which can be used to transform a position or direction from View to World space.<br/>
This is ''in the likes'' as for rendering, view space's forward is -z and camera matrices matches the script component's matrices(+z forward).
<br/><br/>
'''NOTE 1:''' We advise using either the [[Unity_Products:Amplify_Shader_Editor/Transform_Position|Transform Position]] or [[Unity_Products:Amplify_Shader_Editor/Transform_Direction|Transform Direction]] as they are easier to use and you wont need to do an explicit multiplication between matrix and position/direction value.
<br/>
'''NOTE 2:''' This matrix for the time this documentation was created returned identity as it internally makes use of unity_CameraToWorld variable which isn't used by Unity's main rendering systems, only for post processing. For the current Inverse view Matrix you can use [[Unity_Products:Amplify_Shader_Editor/Inverse_View_Matrix|this]], node.
<br/>
<img class="responsive-img" src="http://wiki.amplify.pt/images/Nodes/CameraToWorldMatrix.jpg">
<br/><br/>
{| class="wikitable" style="width: 100%;"
{| class="wikitable" style="width: 100%;"
|-  
|-  
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
! style="width: 10%;" | Output Port !! Description !! style="width: 10%;" | Type
|-  
|-  
| Vertex Position
| Out
| Allow the specification of a custom vertex position. Uses current vertex position if left unconnected.
| Returns current inverse camera to world matrix value.
| Float3
| Matrix4x4
|-
| Length
| Defines the distance in view coordinates over which the fade between 0 and 1 values should occur.
| Float
|-
| Offset
| Defines an offset in view coordinates to the cameras near plane on which the fade from 0 to 1 should start.
| Float
|}
|}




[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Camera and Screen]]
[[Category:Nodes]][[Category:Matrix Transform]]

Revision as of 16:02, 24 August 2021

Back to Node List

Camera To World Matrix Node

The Camera To World Matrix node returns something in the likes of the inverse view matrix which can be used to transform a position or direction from View to World space.
This is in the likes as for rendering, view space's forward is -z and camera matrices matches the script component's matrices(+z forward).

NOTE 1: We advise using either the Transform Position or Transform Direction as they are easier to use and you wont need to do an explicit multiplication between matrix and position/direction value.
NOTE 2: This matrix for the time this documentation was created returned identity as it internally makes use of unity_CameraToWorld variable which isn't used by Unity's main rendering systems, only for post processing. For the current Inverse view Matrix you can use this, node.


Output Port Description Type
Out Returns current inverse camera to world matrix value. Matrix4x4


Back to Node List