Answers for "Unlit shader get the direction of camera UNity"

C#
0

Unlit shader get the direction of camera UNity

struct v2f {     
 float4 pos : SV_POSITION;     
 float3 normal : TEXCOORD0; //you don't need these semantics except for XBox360     
 float3 viewT : TEXCOORD1; //you don't need these semantics except for XBox360 
 }; 
 
 v2f vert (appdata_base v) {     
 v2f o;     
 o.pos = mul (UNITY_MATRIX_MVP, v.vertex);    
 o.normal = normalize(v.normal);     
 o.viewT = normalize(WorldSpaceViewDir(v.vertex));//ObjSpaceViewDir is similar, but localspace.     
 return o; 
 }
Posted by: Guest on February-06-2020

Code answers related to "Unlit shader get the direction of camera UNity"

C# Answers by Framework

Browse Popular Code Answers by Language