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

Author Topic: Tilemap : drawing out of window  (Read 1818 times)

0 Members and 1 Guest are viewing this topic.

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Tilemap : drawing out of window
« on: July 28, 2013, 10:47:31 pm »
Hi,

I've just a simple question : I've a tilemap that is bigger than the window (the view has a viewport equal to window size) and I render it every frame. What happen to things that are out of the window ? Are they rendered too by GPU or is it automatically skiped ?

binary1248

  • SFML Team
  • Hero Member
  • *****
  • Posts: 1405
  • I am awesome.
    • View Profile
    • The server that really shouldn't be running
Re: Tilemap : drawing out of window
« Reply #1 on: July 28, 2013, 11:34:18 pm »
The data is transferred to the GPU and it will look at it and find out that it isn't allowed to render some primitives which lie outside of the clipping area. In that sense, yes they are automatically skipped, but if your tilemap is large enough, you will notice a considerable performance drop because you are transferring a lot more data every frame than you need to. If you can, decide what will really be seen on screen and only draw that. If needed, you might want to split your tilemap up into multiple pieces for this, or even construct the visible portion anew every frame.

See: http://en.sfml-dev.org/forums/index.php?topic=12349.0
SFGUI # SFNUL # GLS # Wyrm <- Why do I waste my time on such a useless project? Because I am awesome (first meaning).

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Tilemap : drawing out of window
« Reply #2 on: July 29, 2013, 12:04:14 am »
Very helpful, thank you =)

 

anything