Unity Products:Amplify Shader Editor/Billboard and Unity Products:Amplify Shader Editor/Blend Normals: Difference between pages

From Amplify Creations Wiki
(Difference between pages)
Jump to navigation Jump to search
m (1 revision imported)
 
ampwiki>Amplify Borba
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]]
== Blend Normals Node ==


== Billboard Node ==
The Blend Normals node blends two normals using the [http://www.chrisoat.com/papers/Oat-Wrinkles(Siggraph07).pdf Whiteout Blend] method. Instead of just averaging both normal maps, they are calculated the following way:<br/>
'''BlendedNormal = normalize( float3( [[#paramA|A]].xy + [[#paramB|B]].xy, [[#paramA|A]].z*[[#paramB|B]].z )'''.
<br/>This way details, which would have been lost on an regular average, are better preserved.


The Billboard node will rotate vertex data ( position + normal ) to align object's axis to current camera.
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/BlendNormalsNode.jpg">
<br/>This node is a bit different from all others as it injects the necessary code into the vertex body and writes directly on the vertex position and normal. It outputs a value of 0 so it can be connected directly to a vertex port ( only if that port is a relative vertex offset ) or it can be used in an [[Unity_Products:Amplify_Shader_Editor/Add|Add]] node so further vertex operations can be placed.
<br/>Billboards can be set through its [[#paramType|Type]] either as '''Cylindrical''' where only the object '''X''' and '''Z''' axis are aligned with the camera ( useful when rendering trees ) or as '''Spherical''' where all axis are aligned.
<br/>Also, through the [[#paraIgnoreRotation|Ignore Rotation]] parameter an object's initial rotation can be either completely ignored and overridden, or it can be used as a delta rotation over the billboard final calculations.
 
'''NOTE:''' Billboard node should only be connected to vertex ports.
 
<img class="responsive-img" src="http://wiki.amplify.pt/images/NodeDetail/BillboardNode.jpg">
<br/><font size="1">Nodes used:  
<br/><font size="1">Nodes used:  
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],  
[[Unity_Products:Amplify_Shader_Editor/Float|Float]],
[[Unity_Products:Amplify_Shader_Editor/Billboard|Billboard]],
[[Unity_Products:Amplify_Shader_Editor/Texture_Sample|Texture Sample]],
[[Unity_Products:Amplify_Shader_Editor/Vertex_Position|Vertex Position]],
[[Unity_Products:Amplify_Shader_Editor/Blend_Normals|Blend Normals]]
[[Unity_Products:Amplify_Shader_Editor/Scale|Scale]],  
[[Unity_Products:Amplify_Shader_Editor/Add|Add]]
</font>
</font>


Line 22: Line 16:
|-
|-
! 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="paramType" | Type
| id="paramA" | A
| Defines which of the object's axis should be aligned with the camera
| First normal to blend. Only visible if the respective input port is not connected.
* '''Cylindrical:''' Only aligns object x and Z axis with camera
| 0,0,0
* '''Spherical:''' Completely aligns object axis with camera
|- style="background: #e5e5e5;" |
| Cylindrical
| id="paramB" | B
|-
| Second normal to blend. Only visible if the respective input port is not connected.
| id="paramIgnoreRotation" | Ignore Rotation
| 0,0,0
| If turned off, the object initial rotation will be used as a delta rotation on top of the billboard final calculated rotation.
|}
On the other way, if turned on the object initial rotation will be completely ignored and the final rotation will be only be set by the billboard result.
 
| False
 
{| class="wikitable" style="width: 100%;"
|-  
! style="width: 10%;" | Input Port !! Description !! style="width: 10%;" | Type
|-
| A
| First normal to blend.
| Vector3
|-
| B
| Second normal to blend.
| Vector3
|}
|}




[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Unity_Products:Amplify_Shader_Editor/Nodes | Back to Node List]]
[[Category:Nodes]][[Category:Miscellaneous]]
[[Category:Nodes]][[Category:Textures]]

Revision as of 11:06, 15 November 2017

Back to Node List

Blend Normals Node

The Blend Normals node blends two normals using the Whiteout Blend method. Instead of just averaging both normal maps, they are calculated the following way:
BlendedNormal = normalize( float3( A.xy + B.xy, A.z*B.z ).
This way details, which would have been lost on an regular average, are better preserved.


Nodes used: Float, Texture Sample, Blend Normals

Node Parameter Description Default Value
A First normal to blend. Only visible if the respective input port is not connected. 0,0,0
B Second normal to blend. Only visible if the respective input port is not connected. 0,0,0


Input Port Description Type
A First normal to blend. Vector3
B Second normal to blend. Vector3


Back to Node List