Hi rick0!
Thank you very much for purchasing the Gen5 Toolkit and for your feedback! May I ask which Unity version you’re using? Meanwhile, here are some workarounds you can try:
Problem 1: World Space UI not being occluded Try disabling depth buffer clearing: Scene Volume Profile > Camera Volume > disable “Is Clear Depth Before UI Enabled”. This preserves the depth buffer before UI rendering, allowing proper occlusion. Let me know if it works.
Problem 2: Masks not working with “Screen Space - Camera” You can try using multiple canvases — one in Screen Space - Overlay (using masks) and another in Screen Space - Camera (using shaders). If that doesn’t work for your case, you can test a custom shader that preserves the stencil buffer, like this one:
Shader "Custom/UI-ScreenSpaceCamera"
{
Properties
{
[PerRendererData] _MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
[MaterialToggle] PixelSnap ("Pixel snap", Float) = 0
[HideInInspector] _RendererColor ("RendererColor", Color) = (1,1,1,1)
[HideInInspector] _Flip ("Flip", Vector) = (1,1,1,1)
[HideInInspector] _AlphaTex ("External Alpha", 2D) = "white" {}
[HideInInspector] _EnableExternalAlpha ("Enable External Alpha", Float) = 0
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex SpriteVert
#pragma fragment SpriteFrag
#pragma target 2.0
#pragma multi_compile_instancing
#pragma multi_compile_local _ PIXELSNAP_ON
#pragma multi_compile _ ETC1_EXTERNAL_ALPHA
#include "UnitySprites.cginc"
ENDCG
}
}
}
If none of these solve the issue, just let me know and I’ll test it on my side and implement a fix as soon as possible :D Thanks again for the support and your patience!
Best regards, Holomind