Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Martin Sand

Pages: [1]
1
Graphics / [SOLVED] Best approach for rendering footprints
« on: February 18, 2018, 09:28:58 am »
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

Pages: [1]
anything