|
|
|
|
|
|
Properties |
|
|
|
{ |
|
|
|
[PerObjectData] LabelingId("Labeling Id", Vector) = (0,0,0,1) |
|
|
|
_MainTex ("Main Texture", 2D) = "white" { } |
|
|
|
HLSLINCLUDE |
|
|
|
|
|
|
|
#pragma target 4.5 |
|
|
|
#pragma only_renderers d3d11 ps4 xboxone vulkan metal switch |
|
|
|
|
|
|
|
//enable GPU instancing support |
|
|
|
#pragma multi_compile_instancing |
|
|
|
|
|
|
|
ENDHLSL |
|
|
|
|
|
|
|
Tags { "RenderType"="Opaque" } |
|
|
|
Tags { "Queue"="Transparent" "RenderType"="Transparent" } |
|
|
|
|
|
|
|
ZWrite on |
|
|
|
Blend SrcAlpha OneMinusSrcAlpha |
|
|
|
Tags { "LightMode" = "SRP" } |
|
|
|
|
|
|
|
Blend Off |
|
|
|
ZWrite On |
|
|
|
ZTest LEqual |
|
|
|
|
|
|
|
Cull Back |
|
|
|
//Tags { "LightMode" = "SRP" } |
|
|
|
|
|
|
|
CGPROGRAM |
|
|
|
|
|
|
|
|
|
|
#include "UnityCG.cginc" |
|
|
|
|
|
|
|
float4 LabelingId; |
|
|
|
sampler2D _MainTex; |
|
|
|
float4 _MainTex_ST; |
|
|
|
float2 uv : TEXCOORD0; |
|
|
|
float2 uv : TEXCOORD0; |
|
|
|
}; |
|
|
|
|
|
|
|
vertexToFragment semanticSegmentationVertexStage (in_vert vertWorldSpace) |
|
|
|
|
|
|
vertScreenSpace.uv = TRANSFORM_TEX(vertWorldSpace.uv, _MainTex); |
|
|
|
// sample the texture |
|
|
|
fixed4 col = tex2D(_MainTex, vertScreenSpace.uv); |
|
|
|
if (col.a == 0) |
|
|
|
return fixed4(0, 0, 0, 0); |
|
|
|
|
|
|
|
return LabelingId; |
|
|
|
} |
|
|
|
|
|
|
|