I have a set of sprite drawn in FrontToBack sortmode. In XNA 4.0, the effect must be as an input argument of
Begin() function of
SpriteBatch. However, If I reinvoke the function, then the sprite sorting is lost. Therefore, I have to find a way to implement the pixel shader within the
End() for specific texture drawn. I tried to use
effect.CurrentTechnique.Passes.Apply(), but no pixel was shaded when I invoke this. On the other hand, if I put effect as an argument, then all of the sprites would be effected. Therefore, is there any convenient way to approach this?
By the way, what I am trying to do is to provide an overlay on an isometric tile using some kind of masking. Therefore, I want to draw such masking and programmatically change it to optional color.
Something like this (from final fantasy tactics):
I am not sure if pixel shader is the right way to approach it, but then I have to tackle the fact that I want to be able to specify optional color dynamically. Other than that, I really want it to animate, which I might approach this by creating several grayscale animated masking and saturate it using pixel shader.