FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Poll

Which FIFE renderbackend are you using? If you're using SDL tell us why.

SDL
- 3 (21.4%)
OpenGL
- 11 (78.6%)

Total Members Voted: 14


Author Topic: Renderbackends: do you use SDL or OpenGL?  (Read 10032 times)

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Renderbackends: do you use SDL or OpenGL?
« on: August 27, 2008, 02:32:16 pm »

Hello dear FIFE users. One of our new developers is currently digging through the FIFE sourcecode to find spots where the rendering performance of the engine could be improved. The same developer recently fixed a hard to track down segfault issue that affected some Linux users that tried to use the OpenGL renderbackend of FIFE. Now that a workaround is in SVN we're asking ourselves how many FIFE users are still running the SDL rendering backend that offers a poorer performance than the OpenGL one.

We're thinking about some optimizations that could really speed up things for all OpenGL users but these changes might break the support for the SDL renderbackend. How many of you are still using the SDL backend? Why are you using it? Do you think it's reasonable to remove the SDL backend in case this would help to vastly improve OpenGL performance?

Vote and discuss :-)
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #1 on: August 29, 2008, 01:08:10 am »

Currently the SDL backend does a much better job with the ffmpeg integration, since that's based on ffplay, which renders to an SDL surface.  Converting the SDL surface to use the OpenGL backend is a substantial performance hit.  This could of course be optimized to support OpenGL natively, whether side-by-side with SDL, or on its own.

fyi, here's a thread where I previously suggested moving to OpenGL only (http://forums.fifengine.net/index.php?topic=42.0).  As I conceded in that thread, there's actually some surprising places where OpenGL support is still lacking.  Those places could be a strong niche for FIFE-based gameplay, since there wouldn't be AAA uber-shiny titles competing.

Is there an actual need for improved performance in the graphics subsystem?  I know there's some memory concerns with object animations, and loading is frustratingly slow, but the frame rate seems perfectly fine to me on my aging wreck.
Logged

Yonibear

  • Developer
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #2 on: August 29, 2008, 10:58:04 am »

I don't know how Zero is behaving, but the performance of OpenAnno is desastrous. We have to render hundreds to thousands of tiles in every frame, which is handled really bad by the OpenGL immediate mode (glBegin/glEnd).
The first step in optimizing the renderer would be to restructure the code, so that large chunks of vertex data are generated and can be drawn with very few GL calls.
SDL could benefit from this too. It makes sense for OpenGL to abstract between vertex arrays and vertex buffer objects to get optimal performance on each OpenGL version, so the SDL could implement this interface too. For example, we can implement transforming in SSE, which is only possible if we have the vertex data in one big chunk.

I'm still researching what options we have to support video in OpenGL better. Some Platforms (Apple and Mesa) provide extensions to use YUV data directly. Another option with newer cards would be to do the color space transform in the pixel shader.
Logged

m64

  • Developer
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #3 on: August 29, 2008, 12:25:52 pm »

I've been using the SDL version due to a bug. On the AA1 (the Linux UMPC) I've managed to compile FIFE with OpenGL support.

The problem with OpenGL is that broken OpenGL setups are rather a rule than an exception under Linux, and for some potential players of FIFE based games this might pose a problem.

Therefore if we ditch SDL we should make sure non-accelerated or partially accelerated OpenGL installations can handle FIFE reasonably - that doesn't mean that they should be able to give identical performance, but that software renderers should be capable of handling a rather uncomplicated scenes.

That way an actual game author would be allowed to make decision how demanding should his game's graphics be, depending on his envisioned "target market".

Another possibility is keeping a half-assed SDL support that handles only some basic features - if a game author wants better SDL support, he is free to improve it.

Frankly speaking this should be based on the shape of our user base, so probably autors of the games using FIFE are the ones whose voices should be the most releveant ones in this discussion. I am constantly planning to create a game, but so far I have not gone out of the concept phase.
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #4 on: August 29, 2008, 01:14:55 pm »

I've been using the SDL version due to a bug.
AFAIR you were affected by the segfault when throwing an exception bug. This has been recently fixed by yonibear.
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #5 on: August 30, 2008, 01:08:01 am »

I'm still researching what options we have to support video in OpenGL better. Some Platforms (Apple and Mesa) provide extensions to use YUV data directly. Another option with newer cards would be to do the color space transform in the pixel shader.

I'm not quite sure what you are using for a base comparison on the video. I still get a reasonable framerate in SDL even doing the software RGB translation.  The trouble comes translating the SDL format to the OpenGL format.  I'm confident ffmpeg can go straight to OpenGL as well; that's just not what it does right now.

Are you using video for something right now?
Logged

Yonibear

  • Developer
  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #6 on: August 30, 2008, 08:45:57 am »

OK, i thought you were using the SDL YUV functions, which doesnt work in OpenGL mode. You should be able to easily upload SDL surfaces with glTexImage, or simply blit them with glDrawPixels. Allthough i'm not sure how the latter one behaves on different implementations.

One thing i discussed with barra is why you decided to use ffmpeg. It seems that it is rather complicated to use due to its universal nature, and therefore it is difficult to adapt the playback code to fife. Ogg, Vorbis and Theora would form a integrated solution that is very well suited for games, because developers can transcode their videos before shipping anyway.
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #7 on: August 31, 2008, 01:58:21 am »

One thing i discussed with barra is why you decided to use ffmpeg. It seems that it is rather complicated to use due to its universal nature, and therefore it is difficult to adapt the playback code to fife.

Yeah, from my memory we didn't really look beyond ffmpeg.  It may not be a perfect choice, but from working with it I would say it's not a bad one.
Logged

m64

  • Developer
  • Newbie
  • *
  • Posts: 22
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #8 on: September 02, 2008, 03:53:43 pm »

I've been using the SDL version due to a bug.
AFAIR you were affected by the segfault when throwing an exception bug. This has been recently fixed by yonibear.

That's correct - I only have not explicitly stated it in my post.
Logged

Yannick

  • Newbie
  • Posts: 2
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #9 on: November 18, 2008, 04:10:38 am »

I voted SDL here
But what i really would love to see is OpenGlide ES (for handheld devices, iphone, android, no fixed function, only shaders)
Logged

vtchill

  • Developer
  • Full Member
  • *
  • Posts: 206
    • View Profile
Re: Renderbackends: do you use SDL or OpenGL?
« Reply #10 on: November 18, 2008, 08:01:31 pm »

Most of the time I use OpenGL, but I also use SDL occasionally when i am running a fife based game in a virtual OS through a VM program such as virtual box or parallels. These VMs may have hardware acceleration
coming in the future, but I don't think they all support it yet.

@Yannick:
That is an interesting request I will keep it in mind.
Logged