I would like to use a custom effect with a regular XNA
SpriteBatch. I have a 2D camera which computes a transform matrix, so I need my shader to take this into account.
I have put a world matrix property into my shader:
However, it does not get set by
spriteBatch.Begin(spriteSortMode, blendState, samplerState, depthStencilState, rasterizerState, effect, camera.WorldToScreen);
Everything is rendered properly if I set it manually in the draw loop:
How can I set up my shader parameters to make
SpriteBatch set them up correctly?