It seems like this should be quite simple, I have added a command buffer for “BeforeLighting”, and am simply trying to see if I can overwrite the normals in the normal render target, but it is failing to write to any target but the output one. Does anyone know where I am going wrong here? Thanks, searches turned up nothing.
Shader "Unlit/Test"
{
Properties
{
_MainTex ("Texture", 2D) = "white" {}
}
SubShader
{
Tags { "RenderType"="Opaque" }
Fog{ Mode Off }
Zwrite Off
Offset -1,-1
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#pragma target 3.0
#pragma exclude_renderers nomrt
#include "UnityCG.cginc"
struct appdata
{
float4 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
float4 _MainTex_ST;
v2f vert (appdata v)
{
v2f o;
o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = TRANSFORM_TEX(v.uv, _MainTex);
return o;
}
void frag (v2f i, out half4 outNormal : COLOR2 )
{
outNormal = half4(1,0,0,1);
}
ENDCG
}
}
}