I am having an issue with the UV values being clamped to 1 in Custom Render Texture (CRT) shader. I am using the same code as I would in a regular shader, but in CRT, the information above 1 is lost. Is there any way to get the full UV values in CRT?
Here is the code I used:
Shader "CustomRenderTexture/S_Test"
{
Properties
{
_MainTex("InputTex", 2D) = "black" {}
}
SubShader
{
Blend One Zero
Pass
{
Name "S_Test"
CGPROGRAM
#include "UnityCustomRenderTexture.cginc"
#pragma vertex CustomRenderTextureVertexShader
#pragma fragment frag
#pragma target 3.0
sampler2D _MainTex;
float4 frag(v2f_customrendertexture IN) : SV_Target
{
float2 uv =IN.localTexcoord;
float4 color;
if(uv.x>1)
color = tex2D(_MainTex, uv);
else
color = float4(uv.x, uv.y, 0, 1);
return color;
}
ENDCG
}
}
}