You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

44 lines
1.2 KiB

Shader "UltraCombos/Composite"
{
Properties
{
_LeftTex ("Left", 2D) = "black" {}
_CenterTex ("Center", 2D) = "black" {}
_RightTex ("Right", 2D) = "black" {}
}
SubShader
{
Blend One Zero
Pass
{
Name "Composite"
CGPROGRAM
#include "UnityCustomRenderTexture.cginc"
#pragma vertex CustomRenderTextureVertexShader
#pragma fragment frag
#pragma target 3.0
sampler2D _LeftTex;
sampler2D _CenterTex;
sampler2D _RightTex;
float4 frag(v2f_customrendertexture IN) : SV_Target
{
float2 uv = IN.localTexcoord.xy;
float x = uv.x;
const float third = 1.0 / 3.0;
if (x < third)
return tex2D(_LeftTex, float2(x * 3.0, uv.y));
else if (x < 2.0 * third)
return tex2D(_CenterTex, float2((x - third) * 3.0, uv.y));
else
return tex2D(_RightTex, float2((x - 2.0 * third) * 3.0, uv.y));
}
ENDCG
}
}
}