Hi everyone,
I am working on a 2D project and encounter serious FPS drops in occasions where hundreds of texture draws happen in a frame. Most of the sprites draws are static and only change with an interaction.
However a weather system is dynamic and changes each frame (with 500 draw each frame)
I read some articles about RenderTargets and got several thoughts.
1- The weather system isn’t a big issue, just for my interest does someone know of way to calculate each particle and draw all particles at once (my particles got different values: alpha, speed, angle). Or an entirely different solution?
2- if I understood correctly a once drawn RenderTarget must not be calculated each frame and can normally be drawn the following frames in one SpriteBatch cycle?
3- I am thinking about using with a 2nd SpriteBatch instance. Where the RenderTarget is prepared with the 2nd and drawn on the first?
3.5- Does question 3 even make a difference since the graphics device is still in use of the first SpriteBatch?
4- As for the static draws i’m thinking of parting the screen (or rather chunks) into 16 separated RenderTargetsts.
For 3 layer so 48 in total.
Previously search results mentioned that there shouldn’t be more than 16 interruptions with SpriteBatch.begin() and SpriteBatch.end() in one frame. In this case i would divide the creation of a chunk into several frames.
5- People also pointed out that a once drawn RenderTarget should not be partly undated (overriding the texture on x, y position or try to clear a location with alpha), but instead fully be redrawn.
Anyone who experienced otherwise?
6- Maybe there is also an different solution, like merging sprites into one before even drawing on the SpriteBatch as example?
Any useful productive thoughts / comments are welcome. As i need a lot of there to make decisions.
Even if only one question is answered or if they are off the questions, but somehow related to the topics.
Thank in Advance