Hi,
How would I go about flipping this shader on the x? I want the camera image to be flipped as to mirror…
Thanks.
Shader “WebCamShader” {
Properties {
//_MainTex (“Base (RGB) Trans (A)”, 2D) = “white” {}
_MainTex (“Base (RGB)”, 2D) = “white” {}
}
SubShader {
//Tags {“Queue”=“Transparent” “IgnoreProjector”=“True” “RenderType”=“Transparent”}
//Tags { “Queue”=“Background” “RenderType”=“Background” }
//Tags { “Queue” = “Geometry+10” “RenderType”=“Background” }
//Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off }
Pass {
//ZWrite off ZTest Equal Lighting Off Cull Off Fog { Mode Off } // seems to break render on mobiles
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include “UnityCG.cginc”
sampler2D _MainTex;
struct appdata
{
float4 vertex : POSITION;
float2 texcoord : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float2 uv : TEXCOORD0;
};
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
o.pos.z = 1.0;
return o;
}
half4 frag(v2f i) : COLOR
{
return tex2D(_MainTex, i.uv);
}
ENDCG
}
}
}