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

Author Topic: [Solved] Why are my VertexArray graphics so much slower when zoomed in?  (Read 1357 times)

0 Members and 1 Guest are viewing this topic.

Futochu

  • Newbie
  • *
  • Posts: 7
  • Now with 50% more gelatin
    • View Profile
    • Email
Hey all, I've recently been working on a map generator as an experiment with VertexArrays.  Originally I had been working with sprites, but at higher zoom levels I found that the rendering process was so resource intensive there was no way I could implement anything else.

As a result, I switched to VertexArray drawing which initially seemed to work quite well.  However, if I am to zoom in the rendering seems even slower than before (!?).  Unless I'm doing something wrong, this seems completely counter-intuitive to me.  Could someone point me in the right direction?

The code in question (The RenderArray work is in this branch).

The offending code is probably in Tilemap.cpp

Thanks.

EDIT: This was due to textures being loaded every draw cycle.  Higher zoom = larger images.  Who knew texture loading was so resource hungry?
« Last Edit: March 18, 2015, 08:31:01 am by Futochu »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11033
    • View Profile
    • development blog
    • Email
Use a profiler and find out what's the problem.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Futochu

  • Newbie
  • *
  • Posts: 7
  • Now with 50% more gelatin
    • View Profile
    • Email
Did not know these existed!  Thanks.

EDIT: Super easy to use to solve this issue.
« Last Edit: March 18, 2015, 08:31:19 am by Futochu »