That worked! There were two Stencil sections in STM UI.shader and the first one seemed identical to what you posted, so I replaced the second one with that, and now it renders as I would expect. Thanks a bunch, Kai!