Hi, Im trying to get direction from camera to pixel but It is slightly shifted around the edges of the screen in comparison to default mesh objects thus causing artifacts. I have no idea why it would do that.
struct appdata {
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float4 pos : SV_POSITION;
float3 wPos : TEXCOORD1;
float2 uv : TEXCOORD0;
};
v2f vert(appdata v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.uv = v.uv;
o.wPos = mul(unity_ObjectToWorld, v.vertex).xyz;
return o;
}
fixed4 frag (v2f i) : SV_Target
{
float3 viewDirection = normalize(i.wPos - _WorldSpaceCameraPos);
}