I am working on a Monogame Projekt with a few People for University. Its basically a Colony simulator similar to Rimworld.
The Map is seperated in Tiles with a resolution of 32px * 32px.
In the GameRenderer i am Rendering each Layer to a RenderTarget using SpriteBatch and then just Combinig it in the Final Draw call. I am also using TextureAtlasses.
Now heres the Problem:
until now i Have Rendered the Ground Textures of the Tiles on the Map into one big RenderTarget (since they dont change), wich i could then just render using a Translation Matrix. This worked well for small Map sizes (128 * 128) But since our Goal is more around 10241024 or even 20482048 i ran into the Problem, that the Ground is simply not displayed anymore, when using those Mapsizes. I imagine this is because the RenderTarget is simply getting to big.
I tried to switch it so only the Textures currently on Screen are getting Rendered one by one, wich works great when zoomed in but gives massive Spikes when zooming out.
So in short i am trying to figure out whats the Best way to accomplish the Drawing of the GroundTextures for large Maps.
I am quite new to working with Graphics and optimizing them for Performance.
One Idea i had was to create a Collection of RenderTargets that contains prerendered chunks of Ground Textures, and only draw those affected by the View Matrix. But i dont know if this will impact memory usage negatively.
If anybody has any Input on how to work with this kind of issue it would be greatly appreciated.
(the Game is supposed to run on a PC with a dedicated Graphics Card)