Tuesday, October 10, 2017

C# XNA Make rendered screen a texture2d



I am working on a cool little city generator which makes cities in the isometric perspective. However, a problem arose where if the grid size was over a certain limit it would have awful lag. I found the main problem to be in the draw method. So I took the precautionary step of rendering only items that were onscreen. This fixed the lag but, not by much.


The idea I have is to render the frame once and take a snapshot. Then, display that as a texture2d on screen. This way I don't have to render 1,000,000 objects every frame since they don't change anyways.


TL;DR - I want to



  1. Take a snapshot of an already rendered frame

  2. Turn it into a Texture2D

  3. Render that to the screen instead of all the objects.


Any help appreciated.




No comments:

Post a Comment

Simple past, Present perfect Past perfect

Can you tell me which form of the following sentences is the correct one please? Imagine two friends discussing the gym... I was in a good s...