Quantcast
Channel: Active questions tagged xna-4.0 - Game Development Stack Exchange
Viewing all articles
Browse latest Browse all 33

SpriteBatch, trying to reduce draw calls

$
0
0

This my main draw call:

       Matrix Camera_transformation = player_camera_.GetTransformation();        // Background - AlphaBlend        spritebatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Camera_transformation);        background_.Draw(spritebatch);        spritebatch.End();        // Particles (of a player power, I want them behind him!) - Additive        spritebatch.Begin(SpriteSortMode.Deferred, BlendState.Additive, null, null, null, null, Camera_transformation);        player_.DrawParticles(spritebatch);        spritebatch.End();        // Player - Alpha Blend        spritebatch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend, null, null, null, null, Camera_transformation);        player_.Draw(spritebatch);        spritebatch.End();        // Hub/Ui - Not to be influenced by the camera, but always on top        spriteBatch.Begin();         UI.Draw(spritebatch)        spriteBatch.End();

Is there a way to reduce the number of calls here?If my particle system didn't need an additive drawing, I would have merged the first three calls, but I can't. Is there something I am missing about spritebatch ordering?


Viewing all articles
Browse latest Browse all 33

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>