Quantcast
Channel: Community | MonoGame - Latest topics
Viewing all articles
Browse latest Browse all 6821

How to handle depth when using multiple shaders.

$
0
0

@mgtaa wrote:

I'm wondering if anyone has any suggestions or articles that may give me a good idea of how to approach this. I'm looking for how to structure my draw calls when I want to handle multiple shaders, or only want to apply a shader to a single sprite.

From my understanding you can only apply a single shader to a spritebatch call, so I'm interested in how to ensure depth is maintained between different spritebatch calls.

Right now I'm using the build in depth parameter for spriteBatch.Draw

spriteBatch.Draw(Animation.Sprite, location, drawRect, Color.White, 0f, origin, 1f, SpriteEffects.None, Layer);
and everything is being drawn in one spriteBatch call to maintain depth between all objects.

Any assistance or direction would be appreciated. :slight_smile:

Posts: 2

Participants: 2

Read full topic


Viewing all articles
Browse latest Browse all 6821

Trending Articles