I’m bashing my head against my desk trying to figure out why, after packaging this shader in asset bundles, it’s showing up in my Frame Debugger as not having the correct properties, culling settings, etc.
Is there something here that is incompatible with Metal?
(Note: the mesh being passed in, is already in view volume coordinates and the mesh has been tested and works in another metal application on device)
Shader "AFoldApart/PaperProjection/PrepareScreenOverlayWithScaledGameBlit"
{
// Command buffers write to global keywords so "white" will always take priority because it is more specific than the global
//Properties
//{
// _MainTex ("Texture", 2D) = "white" {}
//}
SubShader
{
Tags{ "Queue" = "Geometry" "PreviewType" = "Plane" }
CGINCLUDE
#pragma target 3.0
#include "UnityCG.cginc"
struct appdata
{
float3 vertex : POSITION;
float2 uv : TEXCOORD0;
};
struct v2f
{
float2 uv : TEXCOORD0;
float4 vertex : SV_POSITION;
};
sampler2D _MainTex;
v2f vert(appdata v)
{
v2f o;
o.vertex = float4(v.vertex, 1);
o.uv = v.uv;
#ifndef UNITY_UV_STARTS_AT_TOP
o.uv.y = 1 - o.uv.y;
#endif
return o;
}
fixed4 frag(v2f i, out float out_depth : SV_Depth) : SV_Target
{
out_depth = Linear01Depth(1.0);
return tex2D(_MainTex, i.uv);
}
ENDCG
Pass
{
ZWrite on
ZTest always
Cull back
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
ENDCG
}
}
}
Notice that the parameters are wrong and the texture is missing. If I run without asset bundles, the texture shows up and things work as expected. On PC, Switch, XBox, and PS4, the same shader runs as expected with the same AssetBundle configuration.