I’m new to pixel shaders and I’ve created this very simple stencil shader that works as expected when run from a windows desktop client, but not on Android. Any idea what I am doing wrong?
First of all: Not an android dev, but maybe i can help.
before drawing do you change the blendstate of your graphicsDevice?
It should be AlphaBlend, Additive or NonPremultiplied, but maybe it’s not default on Android.
You could also change the pixelshader to 3_0 instead of 2_0, maybe that makes a difference, since it seems like the second texture overwrites the first one.
@nebosite Can you try explicitly assigning a register to the textures? The texture you pass to the spritebatch call should be in t0. E.g. Texture2D TextureBase : register(t0); if that’s the texture you pass to spritebatch.
(I also tried switching the register assignments) The output is unchanged. This is true for windows too. This shader is working in windows, but not Android.