1
Graphics / Re: Draw calls for text and performance
« on: January 23, 2025, 01:02:23 am »For normal sf::Texture you "use" them by calling draw of a sprite, shape or passing it via render state.
For sf::RenderTexture the situation is slightly different, because there's a render time for the contents of the RT and then there's the usage of the texture itself that was rendered.
In the end there isn't an exact limit and sometimes paying the price is the right move.
All I'm trying to say is, that you shouldn't design a system with hundreds of textures and/or render textures.
Use a few as possible (e.g. via texture atlas) and as many as you need.
And use GPU and CPU profilers to find true bottlenecks if you do run into performance issues.
I don't think that really answers the original question of what causes a texture to switch, but I suppose it's not the shortest explanation.
And yeah of course, I wasn't going to try making a rendertexture per object or anything, and did take into consideration the atlas thing.
Thanks for all the answers, both from you and kojack