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

Author Topic: Software blitting performance SFML/SDL  (Read 5203 times)

0 Members and 1 Guest are viewing this topic.

CharlieOne

  • Newbie
  • *
  • Posts: 2
    • View Profile
Software blitting performance SFML/SDL
« on: November 22, 2010, 10:30:24 pm »
Hi all,

I hope I'm not beating a dead horse here :wink: , but unfortunately I didn't find what I'm looking for by using my google-fu, so hopefully you guys can help me:

Did anyone of you benchmark of SFML's software rendering speed (i.e. simply blitting a 2d surface/pixel array to screen) vs. SDL on an average desktop/laptop system?

The thread at http://www.sfml-dev.org/forum/viewtopic.php?t=43&start=0&postdays=0&postorder=asc&highlight= is about rendering sprites and text, not exactly what I'm looking for (think ray tracer here).

Thanks for your help,

C1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Software blitting performance SFML/SDL
« Reply #1 on: November 22, 2010, 10:59:06 pm »
I think there's absolutely no problem to display one screen-size surface with very decent framerate, either with SFML or SDL. Or with Allegro, Clanlib, GDI, etc.

Your raytracing algorithms will probably be much slower.
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Software blitting performance SFML/SDL
« Reply #2 on: November 22, 2010, 11:38:25 pm »
You want to know benchmarks for blitting of 2D arrays of pixels? Well drawing a Sprite is equivalent if not exactly that.
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Disch

  • Full Member
  • ***
  • Posts: 220
    • View Profile
Software blitting performance SFML/SDL
« Reply #3 on: November 23, 2010, 01:33:04 am »
Quote
You want to know benchmarks for blitting of 2D arrays of pixels? Well drawing a Sprite is equivalent if not exactly that.


Not really.  Rendering sprites is hardware->hardware.  I think OP was talking about software->hardware which is going to be considerably slower.

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Software blitting performance SFML/SDL
« Reply #4 on: November 23, 2010, 06:39:05 am »
Quote from: "Disch"
Quote
You want to know benchmarks for blitting of 2D arrays of pixels? Well drawing a Sprite is equivalent if not exactly that.


Not really.  Rendering sprites is hardware->hardware.  I think OP was talking about software->hardware which is going to be considerably slower.



Aaah.... does SFML even support that?
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Software blitting performance SFML/SDL
« Reply #5 on: November 23, 2010, 07:57:28 am »
Quote
Aaah.... does SFML even support that?

Yes, using Image::LoadFromPixels (or UpdatePixels in SFML 2).
Laurent Gomila - SFML developer

Groogy

  • Hero Member
  • *****
  • Posts: 1469
    • MSN Messenger - groogy@groogy.se
    • View Profile
    • http://www.groogy.se
    • Email
Software blitting performance SFML/SDL
« Reply #6 on: November 23, 2010, 08:57:57 am »
Quote from: "Laurent"
Quote
Aaah.... does SFML even support that?

Yes, using Image::LoadFromPixels (or UpdatePixels in SFML 2).


Wait so, The sf::Image::LoadFromPixels will make Image behave kinda like a SDL_Surface with the SDL_SWSURFACE flag set? Did not know that, you learn something new every day ^^
Developer and Maker of rbSFML and Programmer at Paradox Development Studio

CharlieOne

  • Newbie
  • *
  • Posts: 2
    • View Profile
Software blitting performance SFML/SDL
« Reply #7 on: November 23, 2010, 08:26:17 pm »
Hi all,

thanks for your input!

Yes, I meant software->hardware rendering, if that's the way to put it. Sorry if that wasn't made clear; english is not my native language.

And of course the vast majority of runtime is spent in the actual algorithms with ray tracers in general, but I wanted to look in every direction regarding possible optimizations. But if you think the differences will be negligible, then perhaps I shouldn't spend too much time on this matter - and migrating the backend (my current implementation is using SDL) would certainly be some effort, too.

Thanks again,

C1

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
Software blitting performance SFML/SDL
« Reply #8 on: November 23, 2010, 09:37:27 pm »
Quote
Wait so, The sf::Image::LoadFromPixels will make Image behave kinda like a SDL_Surface with the SDL_SWSURFACE flag set?

I don't think you can compare them this way. LoadFromPixels just copies the pixels from system RAM to a texture in video memory, then you need a sprite to display this texture.
Laurent Gomila - SFML developer