I am currently working on an implementation for footprints etc.
To get this working I have created a struct which I keep in a vector and let it render every frame.
Since the texture does not change but is kept in the GPU memory, I assume it is quite fast although the game will produce thousands of footprints during a level. Every footprint is 1 sprite.
int vectorsize = m_Tracks.size();
for(int iterator = 0; iterator < vectorsize; ++iterator;){
m_Window.draw(m_Tracks[iterator]->getComponent<RenderComponent>()->getSprite());
}
What is the best
optimization (rendering time) for this?
- Create an image and add the footprint every frame (direct manipulation of the pixel via getPixel, setPixel) and apply the image to the render texture of 1 sprite?
- Use a texturerender instead of direct pixel manipulation?
- Keep the current implementation and optimize to only render sprites in current view rect?
I coudl not find any good result in the forum search.
Best regards
Martin