yum-archive/2ner
A toon shader for Unity's BIRP.
git clone https://git.yummers.dev/yum-archive/2ner
ffb4b6b
master
1#include "UnityCG.cginc" 2 3#include "custom30.cginc" 4#include "features.cginc" 5#include "interpolators.cginc" 6 7v2f vert(appdata v) 8{ 9 10#if !defined(_CAST_SHADOWS) 11 return (v2f) (0.0/0.0); 12#endif 13#if defined(_RAYMARCHED_FOG) 14 return (v2f) (0.0/0.0); 15#endif 16 v2f o = (v2f)0; 17 UNITY_SETUP_INSTANCE_ID(v); 18 UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o); 19 TRANSFER_SHADOW_CASTER_NORMALOFFSET(o) 20 o.uv01.xy = v.uv0; 21 o.uv01.zw = v.uv1; 22 o.uv23.xy = v.uv2; 23 o.uv23.zw = v.uv3; 24 o.objPos = v.vertex; 25#if defined(V2F_COLOR) 26 o.color = v.color; 27#endif 28 return o; 29} 30 31float4 frag (v2f i) : SV_Target 32{ 33 UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i); 34 35#if defined(_DEPTH_PREPASS) 36 return 0; 37#endif 38 39#if defined(_CUSTOM30) 40 Custom30Output c30_out = (Custom30Output)0; 41#if defined(_CUSTOM30_BASICCUBE) 42 c30_out = BasicCube(i); 43#elif defined(_CUSTOM30_BASICWEDGE) 44 c30_out = BasicWedge(i); 45#elif defined(_CUSTOM30_BASICPLATFORM) 46 c30_out = BasicPlatform(i); 47#elif defined(_CUSTOM30_RAINBOW) 48 c30_out = Rainbow(i); 49#endif 50 51 i.pos = UnityObjectToClipPos(c30_out.objPos); 52#endif 53 54 return 0; 55} 56