I’m fairly new to using shaders in MonoGame. Basically, I’m trying to figure out how to use a shader to render a background effect (e.g. a starfield). All of the shaders I’ve done have a pattern like:
Effect effect = ... Game.SpriteBatch.Begin(SpriteSortMode.Deferred, null, null, null, null, effect); effect.CurrentTechnique.Passes.Apply(); // sprite drawing happens here, and runs through shader // ... Game.SpriteBatch.End();
…where the shader applies to any sprites drawn during the batch.
But what if I don’t want my shader to operate on textures, but rather just use it to blat pixels to the screen algorithmically? (e.g. https://www.shadertoy.com/view/Md2SR3)
I guess I could create a texture that is the size of the screen, and just draw it during the batch, but that seems like a waste of memory.
Thanks in advance.