res-avatar-unity/Assets/_PoiyomiShaders/Shaders/7.3/Patreon/VoxelCubed/Includes/PoiOutlineVert.cginc

28 lines
763 B
HLSL
Raw Normal View History

2023-07-16 02:51:23 +00:00
#ifndef OutlineVert
#define OutlineVert
v2f vert(VertexInput 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
o.uv = v.texcoord0 + _OutlineGlobalPan.xy * _Time.y;
o.normal = UnityObjectToWorldNormal(v.normal);
float3 offset = o.normal * (_LineWidth/100);
o.worldPos = mul(unity_ObjectToWorld, v.vertex) + float4(offset,0);
o.pos = UnityWorldToClipPos(o.worldPos);
UNITY_TRANSFER_SHADOW(o, o.uv);
UNITY_TRANSFER_FOG(o, o.pos);
return o;
}
#endif