summaryrefslogtreecommitdiffstats
path: root/interpolators.cginc
diff options
context:
space:
mode:
authoryum <yum.food.vr@gmail.com>2024-08-10 02:09:15 -0700
committeryum <yum.food.vr@gmail.com>2024-08-10 02:09:15 -0700
commit4e2422becccc311349325fe436f10326b7210c73 (patch)
tree7363ccbd1a6b9c428c82ed685114e99dfffaf9e6 /interpolators.cginc
parent1aa73f3471b12d5fed9feb76a25c40ccf3969ce8 (diff)
Decals can now use a secondary UV channel
This lets you efficiently create a shit ton of tattoos using a single texture. It also lets you place them over seamlines. Just create a secondary UV map in blender and export as FBX. The shader will pick up this secondary channel and use it, if instructed to do so in the decals UI.
Diffstat (limited to 'interpolators.cginc')
-rw-r--r--interpolators.cginc32
1 files changed, 17 insertions, 15 deletions
diff --git a/interpolators.cginc b/interpolators.cginc
index 1b04192..00cc5c6 100644
--- a/interpolators.cginc
+++ b/interpolators.cginc
@@ -10,7 +10,7 @@ struct appdata
float4 vertex : POSITION;
float3 normal : NORMAL;
float2 uv0 : TEXCOORD0;
- float2 uv1 : TEXCOORD1;
+ float2 uv2 : TEXCOORD1;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
@@ -19,14 +19,15 @@ struct v2f
{
float4 pos : SV_POSITION;
float2 uv0 : TEXCOORD0;
+ float2 uv2 : TEXCOORD1;
#if defined(LIGHTMAP_ON)
- float2 lmuv : TEXCOORD1;
+ float2 lmuv : TEXCOORD2;
#endif
- float3 worldPos : TEXCOORD2;
- float3 normal : TEXCOORD3;
- float3 objPos : TEXCOORD4;
+ float3 worldPos : TEXCOORD3;
+ float3 normal : TEXCOORD4;
+ float3 objPos : TEXCOORD5;
#if defined(SSR_ENABLED)
- float4 screenPos : TEXCOORD5;
+ float4 screenPos : TEXCOORD6;
#endif
UNITY_VERTEX_OUTPUT_STEREO
@@ -38,7 +39,7 @@ struct appdata
{
float4 vertex : POSITION;
float2 uv0 : TEXCOORD0;
- float2 uv1 : TEXCOORD1;
+ float2 uv2 : TEXCOORD1;
float3 normal : NORMAL;
float4 tangent : TANGENT;
@@ -49,20 +50,21 @@ struct v2f
{
float4 pos : SV_POSITION;
float2 uv0 : TEXCOORD0;
+ float2 uv2 : TEXCOORD1;
#if defined(LIGHTMAP_ON)
- float2 lmuv : TEXCOORD1;
+ float2 lmuv : TEXCOORD2;
#endif
- float3 normal : TEXCOORD2;
- float4 tangent : TEXCOORD3;
- float3 worldPos : TEXCOORD4;
- float3 objPos : TEXCOORD5;
+ float3 normal : TEXCOORD3;
+ float4 tangent : TEXCOORD4;
+ float3 worldPos : TEXCOORD5;
+ float3 objPos : TEXCOORD6;
- SHADOW_COORDS(6)
+ SHADOW_COORDS(7)
#if defined(VERTEXLIGHT_ON)
- float3 vertexLightColor : TEXCOORD7;
+ float3 vertexLightColor : TEXCOORD8;
#endif
#if defined(SSR_ENABLED)
- float4 screenPos : TEXCOORD8;
+ float4 screenPos : TEXCOORD9;
#endif
UNITY_VERTEX_OUTPUT_STEREO