Unity Products:Amplify Shader Editor/Projection Matrix and Unity Products:Amplify Shader Editor/Refract: Difference between pages
(Difference between pages)
ampwiki>Amplify RnD Rick No edit summary |
ampwiki>Kebrus mNo 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]] | ||
== | == Refract Node == | ||
The | The Refract node calculates a refraction vector from a given [[#paramIncident|Incident]] vector, a surface [[#paramNormal|Normal]] vector and a ratio of [[#paramEta|Index of Refractions]] at the surface's interface. | ||
Both Normal and Incident vector should be normalized. | |||
A cast is done to match the input type with the most amount of channels if Normal and Incident vectors have different channel amounts. This will also determine the refracted vector size. | |||
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/RefractNode.gif"> | |||
<br/><font size="1">Nodes used: | |||
[[Unity_Products:Amplify_Shader_Editor/View_Dir|View Dir]], | |||
[[Unity_Products:Amplify_Shader_Editor/Negate|Negate]], | |||
[[Unity_Products:Amplify_Shader_Editor/World_Normal|World_Normal]], | |||
[[Unity_Products:Amplify_Shader_Editor/Float|Float]], | |||
[[Unity_Products:Amplify_Shader_Editor/Refract|Refract]], | |||
[[Unity_Products:Amplify_Shader_Editor/Texture Sample|Texture Sample]] | |||
</font> | |||
{| class="wikitable" style="width: 100%;" | |||
|- | |||
! style="width: 10%;" | Node Parameter !! Description !! style="width: 10%;" | Default Value | |||
|- style="background: #e5e5e5;" | | |||
| id="paramIncident" | Incident | |||
| Incident vector ( should be normalized beforehand ). Only visible if the respective input port is not connected. | |||
| 0,0,0,0 | |||
|- style="background: #e5e5e5;" | | |||
| id="paramNormal" | Normal | |||
| Normal vector ( should be normalized beforehand ). Only visible if the respective input port is not connected. | |||
| 0,0,0,0 | |||
|- style="background: #e5e5e5;" | | |||
| id="paramEta" | Eta | |||
| Ratio of index of refraction, determines amount of incident ray that is refracted. Only visible if the respective input port is not connected. | |||
| 0 | |||
|} | |||
{| class="wikitable" style="width: 100%;" | {| class="wikitable" style="width: 100%;" | ||
|- | |- | ||
! style="width: 10%;" | | ! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type | ||
|- | |||
| Incident | |||
| Incident vector ( should be normalized beforehand ). | |||
| Float4 <sup id="ref1">[[#anchor|[1]]]</sup> | |||
|- | |||
| Normal | |||
| Normal vector ( should be normalized beforehand ). | |||
| Float4 <sup id="ref1">[[#anchor|[1]]]</sup> | |||
|- | |- | ||
| | | Eta | ||
| | | Ratio of index of refraction, determines amount of incident ray that is refracted. | ||
| | | Float | ||
|} | |} | ||
---- | |||
# <span id="anchor1">'''[[#ref1|^]]'''</span> Port automatically adapts to all connection types except Matrices and [[Unity Products:Amplify Shader Editor/Texture Object|Sampler]] types. | |||
[[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:Vector Operators]] |
Revision as of 17:47, 24 October 2017
Refract Node
The Refract node calculates a refraction vector from a given Incident vector, a surface Normal vector and a ratio of Index of Refractions at the surface's interface. Both Normal and Incident vector should be normalized.
A cast is done to match the input type with the most amount of channels if Normal and Incident vectors have different channel amounts. This will also determine the refracted vector size.
Nodes used:
View Dir,
Negate,
World_Normal,
Float,
Refract,
Texture Sample
Node Parameter | Description | Default Value |
---|---|---|
Incident | Incident vector ( should be normalized beforehand ). Only visible if the respective input port is not connected. | 0,0,0,0 |
Normal | Normal vector ( should be normalized beforehand ). Only visible if the respective input port is not connected. | 0,0,0,0 |
Eta | Ratio of index of refraction, determines amount of incident ray that is refracted. Only visible if the respective input port is not connected. | 0 |
Input Port | Description | Type |
---|---|---|
Incident | Incident vector ( should be normalized beforehand ). | Float4 [1] |
Normal | Normal vector ( should be normalized beforehand ). | Float4 [1] |
Eta | Ratio of index of refraction, determines amount of incident ray that is refracted. | Float |