res-avatar-unity/Assets/_PoiyomiShaders/Shaders/7.3/Patreon/VoxelCubed/Includes/PoiVert.cginc
2023-07-15 19:51:23 -07:00

32 lines
1.1 KiB
HLSL
Executable file

#ifndef POIVERT
#define POIVERT
v2f vert(appdata v)
{
v2f o;
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
UNITY_TRANSFER_INSTANCE_ID(v, o);
#ifdef FUN
applyFun(v.vertex);
#endif
TANGENT_SPACE_ROTATION;
o.localPos = v.vertex;
o.pos = UnityObjectToClipPos(o.localPos);
//o.screenPos = ComputeScreenPos(o.pos);
o.worldPos = mul(unity_ObjectToWorld, o.localPos);
o.uv = v.texcoord.xy + _GlobalPanSpeed.xy * _Time.y;
o.normal = UnityObjectToWorldNormal(v.normal);
#if defined(BINORMAL_PER_FRAGMENT)
o.tangent = float4(UnityObjectToWorldDir(v.tangent.xyz), v.tangent.w);
#else
o.tangent = UnityObjectToWorldDir(v.tangent.xyz);
o.binormal = CreateBinormal(o.normal, o.tangent, v.tangent.w);
#endif
UNITY_TRANSFER_SHADOW(o, o.uv);
UNITY_TRANSFER_FOG(o, o.pos);
o.vertexId = v.vertexId;
return o;
}
#endif