yum/3ner

A toon shader for Unity's BIRP.

git clone https://git.yummers.dev/yum/3ner

yumFix tessellation shadows, and potential lighting NaNs9219901

master
1.2 KiB48 linesraw
1#ifndef __INTERPOLATORS_INC
2#define __INTERPOLATORS_INC
3
4#include "AutoLight.cginc"
5
6struct appdata {
7  float4 vertex   : POSITION;
8#if defined(_RAY_MARCHING_BAKED_ORIGINS)
9  float4 color    : COLOR;  // vertex color
10#endif
11  float3 normal   : NORMAL;
12  float4 tangent  : TANGENT;
13
14  float2 uv0      : TEXCOORD0;
15  float2 uv1      : TEXCOORD1;
16  float2 uv2      : TEXCOORD2;
17  float2 uv3      : TEXCOORD3;
18
19  UNITY_VERTEX_INPUT_INSTANCE_ID
20};
21
22struct v2f {
23#if defined(_TESSELLATION)
24	float4 tpos         : INTERNALTESSPOS;
25#endif
26  float4 pos         : SV_POSITION;
27	float4 uv01        : TEXCOORD0;
28	float4 uv23        : TEXCOORD1;
29	float3 objPos      : TEXCOORD2;
30  float3 worldPos    : TEXCOORD3;
31  float4 eyeVec      : TEXCOORD4; // eyeVec.xyz | fogCoord
32  float3 normal      : TEXCOORD5;
33  float4 tangent     : TEXCOORD6;
34  UNITY_LIGHTING_COORDS(7,8)
35  // TODO figure out some metaprogramming or preprocessor to better allocate optional texcoords :(
36#if defined(_VERTEX_DEFORMATION_FRAGMENT_NORMALS) || \
37    defined(_VERTEX_DEFORMATION_TESSELLATION)
38  float3 objPos_orig : TEXCOORD9;
39#endif
40#if defined(_RAY_MARCHING_BAKED_ORIGINS)
41  float4 color : TEXCOORD10;
42#endif
43
44  UNITY_VERTEX_INPUT_INSTANCE_ID
45  UNITY_VERTEX_OUTPUT_STEREO
46};
47
48#endif  // __INTERPOLATORS_INC