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

Author Topic: RenderTexture.create() is slow  (Read 1462 times)

0 Members and 1 Guest are viewing this topic.

artelius

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
RenderTexture.create() is slow
« on: March 02, 2016, 02:57:46 am »
Hi,


RenderTexture.create() takes about 40ms on my machine, even for small textures (e.g. 16x16). Since I am creating a lot of these it is taking several seconds.

I'm just wondering if this is normal, or if it's once again an Intel HD Graphics problem.

I have tried this on SFML 2.1 and 2.3.2. Running Ubuntu 14.04.


Thanks!

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10901
    • View Profile
    • development blog
    • Email
Re: RenderTexture.create() is slow
« Reply #1 on: March 02, 2016, 08:25:09 am »
It is not recommended to create a lot of render textures! Rather try to reuse a handful of render textures and create them at the start up.

Depends where exactly the time is wasted, but chances are high that it's wasted in your graphics driver.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

artelius

  • Newbie
  • *
  • Posts: 3
    • View Profile
    • Email
Re: RenderTexture.create() is slow
« Reply #2 on: March 04, 2016, 09:48:38 pm »
Thanks eXpl0it3r!

There are plenty of ways to achieve what I'm after; I'm just trying to do something conceptually simple because I'm planning to create a teaching tool based on SFML.

All I'm really trying to do is prepare a lot of textures for later use, using texture-to-texture copying, which I figure should be faster than CPU-based rendering.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10901
    • View Profile
    • development blog
    • Email
AW: RenderTexture.create() is slow
« Reply #3 on: March 04, 2016, 10:29:52 pm »
What do you understand under "texture-to-texture copying"?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/