The half-vector (halfway between lighting direction and view vector) is computed and normalized per vertex, and the lighting function receives the half-vector as a parameter instead of the view vector.
https://docs.unity3d.com/Manual/SL-Shad ... mance.html
Getting the Half-Vector
Getting the Half-Vector
I know that in Unity there's a way to get the half-vector but didn't find a node for it in ASE. I come from Shader Forge and was doing a test and that one has a node for it. So any help to get a half vector would be appreciated.
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: Getting the Half-Vector
Hello,Liraco wrote:I know that in Unity there's a way to get the half-vector but didn't find a node for it in ASE. I come from Shader Forge and was doing a test and that one has a node for it. So any help to get a half vector would be appreciated.The half-vector (halfway between lighting direction and view vector) is computed and normalized per vertex, and the lighting function receives the half-vector as a parameter instead of the view vector.
https://docs.unity3d.com/Manual/SL-Shad ... mance.html
Thank you for using ASE, we really appreciate it. I strongly recommend checking the Custom Lighting sample included in the Official Example folder. There's no specific node for that purpose but you can get that value by using the dot product of the lighting direction and view vector.

Let me know if the information above helps, we would be happy to help.
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Getting the Half-Vector
Yes, I believe I had to set the view vector to tangent to get it to work. I imagine it doesn't see much use which is why there's no node.Ricardo Teixeira wrote:There's no specific node for that purpose but you can get that value by using the dot product of the lighting direction and view vector.
I don't know if I should open a separate thread but is the bitangent node the same as getting the binormal direction?
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: Getting the Half-Vector
Hello,Liraco wrote:Yes, I believe I had to set the view vector to tangent to get it to work. I imagine it doesn't see much use which is why there's no node.Ricardo Teixeira wrote:There's no specific node for that purpose but you can get that value by using the dot product of the lighting direction and view vector.
I don't know if I should open a separate thread but is the bitangent node the same as getting the binormal direction?
Glad to know it's working, you can always create your own node with Shader Functions.
Which node exactly?
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Getting the Half-Vector
Yes, I was thinking of SFs as a way to make something resusable.
As for my other question, ASE has this node: http://wiki.amplify.pt/index.php?title= ... _Bitangent
I wanted to know if it works like the binormal described in the Unity documentation (since the node's Wiki doesn't go in depth as to what goes into making it)
https://docs.unity3d.com/Manual/SL-Vert ... nputs.html
As for my other question, ASE has this node: http://wiki.amplify.pt/index.php?title= ... _Bitangent
I wanted to know if it works like the binormal described in the Unity documentation (since the node's Wiki doesn't go in depth as to what goes into making it)
https://docs.unity3d.com/Manual/SL-Vert ... nputs.html
- Ricardo Teixeira
- Posts: 954
- Joined: Fri Aug 09, 2013 2:26 pm
Re: Getting the Half-Vector
They are fairly similar but our node includes a few extra corrections that the Unity sample does not. Be sure to let us know if you run into any issues, any feedback would be extremely welcome.Liraco wrote:Yes, I was thinking of SFs as a way to make something resusable.
As for my other question, ASE has this node: http://wiki.amplify.pt/index.php?title= ... _Bitangent
I wanted to know if it works like the binormal described in the Unity documentation (since the node's Wiki doesn't go in depth as to what goes into making it)
https://docs.unity3d.com/Manual/SL-Vert ... nputs.html
Feel free to create a new thread dedicated to any problems that you might encounter.
Thanks!
Sales & Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!