Vectors always showing as Vector4 in inspector

Node-based Shader Editor
Post Reply
AndrewMyriad
Posts: 9
Joined: Wed Aug 08, 2018 1:57 am

Vectors always showing as Vector4 in inspector

Post by AndrewMyriad »

Not sure if this is a known issue, did a quick forum search but pretty common term. Is there a reason why regardless of if you create a Vector2, Vector3 or Vector4 node and make it a property, it always shows X, Y, Z and W values in the inspector?
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Vectors always showing as Vector4 in inspector

Post by Amplify_Borba »

Hello, vector2 and vector3 properties displaying as a vector4 is an expected behavior, the reason behind this is due to the way that Unity handles shaders, as it only receives single float or float4 values.

This means that the last two values for the Vector2 and the last value for the Vector3 are ignored and do nothing.

Please let me know if you have any further questions, thanks!
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!
AndrewMyriad
Posts: 9
Joined: Wed Aug 08, 2018 1:57 am

Re: Vectors always showing as Vector4 in inspector

Post by AndrewMyriad »

That makes sense! Thanks!
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Vectors always showing as Vector4 in inspector

Post by Amplify_Borba »

Glad to help, don't hesitate to get back in touch if you have any further questions!
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!
Post Reply