Author Topic: OpenGL ES2 and Linux and pi - now with patches!  (Read 35474 times)

0 Members and 1 Guest are viewing this topic.

Re: OpenGL ES2 and Linux and pi - now with patches!
I just tried to run FSO with the CPU end on my R-Pi and the graphics end on a spare PC that has a Radeon X1650 Pro.  It didn't work as well as I was hoping - but that was because it refused to forward the GL commands over the network as I was hoping, but instead rendered it all in software and then pushed the completed frames over the network.  As you can imagine, this was unusably slow.

This isn't the R-Pi's fault.  I got exactly the same results (and similar performance) when trying to forward FSO from my nettop.  This is despite the nettop having an allegedly better CPU (well, Atom, so arguable either way) and a much faster Ethernet chipset.

So I think I'd better get on with actually porting this stuff to run natively.  I was hoping to get an idea of the CPU load first, but oh well.

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
yup, i think you where creating your own "Virtu" over there :P
Oh, and ALSA Sound works perfectly on HDMI with A10, Alsa support is embedded on the kernel for A10 last time i checked when i builded one.

Now that i got my Linaro armhf build ready, im trying to get OpenGL ES to work on Mali, it should be possible as long the game use the framebuffer directly, as X11 dont like Mali very much for wharever reason -.-

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: OpenGL ES2 and Linux and pi - now with patches!
BTW, as of revision 8998 (It's UNDER 9000!!) all the rest of the glBegin()/glEnd() pairs have been removed.
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
I wonder if is posible to use Theorarm instead of Theora for ARM builds? I think it will be the only way to make those .ogg vids to play OK on almost any ARM cpu...
« Last Edit: July 07, 2012, 08:35:24 am by ShivanSpS »

 
Re: OpenGL ES2 and Linux and pi - now with patches!
Most OpenGL ES implementations aren't integrated properly with X11.  I think the possibility of having to deal with a partially occluded window and more than one context active at a time gives them hives.  The obvious exceptions are GLES implementations that are just reconfigurations of full desktop GL implementations.

Personally I'm not using the Theora movies, but the original MVEs.  They look better and are much less CPU intensive to decode.  Only problem is they take more disk space.  However, if you install Theorarm I don't see why it wouldn't be possible to link FSO to it.
« Last Edit: July 07, 2012, 09:45:45 am by Kromaatikse »

 
Re: OpenGL ES2 and Linux and pi - now with patches!
Oh and excellent news about Begin/End pairs.  Now we can start on the other things that are not supported by GLES, such as QUADS and QUAD_STRIP.  I think that is the main thing likely to lead to a compile failure against ES1.

QUAD_STRIP is not much of a problem.  As long as the number of vertices is even (which it should be anyway), identical behaviour will be produced by TRIANGLE_STRIP.  If the number is odd, TRIANGLE_STRIP will add a spurious triangle on the end, but that would be a problem in the vertex data so I hope it isn't there.  It should be easy to implement, anyway.

QUADS is trickier.  Each QUAD can be replaced by two triangles, either in TRIANGLE_STRIP or TRIANGLES mode, but the vertex order required is different in each case, and 50% more vertices are required (repeating the first and last vertex for TRIANGLE_STRIP to flush the vertex buffer between quads, or repeating the middle pair in TRIANGLES to butt one half against the other).  I suggest using TRIANGLES because it means less work for the GPU, since it doesn't have to delete the degenerate triangles.

As an aside, POINTS is always implemented by point-sprites on GLES.  This may or may not matter, we'll see.  Possibly, many previously valid uses of QUADS can be replaced by point-sprites - I'm thinking of the radar here.

In a couple of places, the polygon mode is set by external data.  In these cases, a stopgap solution might be to dump a warning to the console when QUADS is used, and then just render with TRIANGLE_STRIP for now.  This should produce halfway sane but obvious rendering artefacts to tell us that it needs to be fixed properly.  We can also breakpoint on the console print call to figure out where the request is coming from.

The other major task is to rework the startup code to obtain a GL context via EGL.  EGL in turn requires a valid framebuffer handle to attach to, the precise form depending on the EGL implementation (ie. could be a Broadcom DispmanX handle on the R-Pi, an X11 window where X11 integration exists, or at least two other ways of attaching to fbdev).  This would be a good opportunity to introduce a configure flag and #define to distinguish ES builds from normal GL.  Note also that normal GL contexts can be obtained through EGL too (where a full GL implementation exists on the platform), so we can test EGL separately from GLES.

 

Offline The E

  • He's Ebeneezer Goode
  • Moderator
  • 213
  • Nothing personal, just tech support.
    • Steam
    • Twitter
Re: OpenGL ES2 and Linux and pi - now with patches!
Okay, I'll leave that in your capable hands then :P
If I'm just aching this can't go on
I came from chasing dreams to feel alone
There must be changes, miss to feel strong
I really need lifе to touch me
--Evergrey, Where August Mourns

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
The other major task is to rework the startup code to obtain a GL context via EGL.  EGL in turn requires a valid framebuffer handle to attach to, the precise form depending on the EGL implementation (ie. could be a Broadcom DispmanX handle on the R-Pi, an X11 window where X11 integration exists, or at least two other ways of attaching to fbdev).  This would be a good opportunity to introduce a configure flag and #define to distinguish ES builds from normal GL.  Note also that normal GL contexts can be obtained through EGL too (where a full GL implementation exists on the platform), so we can test EGL separately from GLES.

If you make it to no depend on X11 it might be easier to (later on) make it work on android too, if it can attach to the device directly and take over the framebuffer i think it will need little more than compiling it with NDK GCC and using android version of the libs.
So if you can avoid X11 better, if no, it does not matter.

  
Re: OpenGL ES2 and Linux and pi - now with patches!
On the R-Pi, the GLES implementation is not integrated with X11 at all.  Indeed, X11 is unaccelerated.  So to make FSO work on the R-Pi, I have to divorce it from X11 anyway.

Actually this means either divorcing it from SDL in that respect, or patching SDL to handle the new situation, since currently SDL is what provides the OpenGL context.  Meanwhile SDL also provides mouse and joystick support, which are rather useful.  Fortunately I think we can use those parts of SDL without using it for display.

 

Offline achtung

  • Friendly Neighborhood Mirror Guy
  • 210
  • ****in' Ace
    • Minecraft
    • Freespacemods.net
Re: OpenGL ES2 and Linux and pi - now with patches!
I'll finally be getting my Pi in the next few days. I'll gladly volunteer it for any testing needed. Looks like there may not be a need though.
FreeSpaceMods.net | FatHax | ??????
In the wise words of Charles de Gaulle, "China is a big country, inhabited by many Chinese."

Formerly known as Swantz

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
i finally managed to get me a pi. its in the mail.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline mjn.mixael

  • Cutscene Master
  • 212
  • Chopped liver
    • Steam
    • Twitter
Re: OpenGL ES2 and Linux and pi - now with patches!
Just got a few for the studio.

Cutscene Upgrade Project - Mainhall Remakes - Between the Ashes
Youtube Channel - P3D Model Box
Between the Ashes is looking for committed testers, PM me for details.
Freespace Upgrade Project See what's happening.

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
yea, im probibly gonna build a lipo powered switch mode psu for the thing. i want it to put out enough juice to power the pi (750ma), a small composite video screen (100ma), a powered usb hub (500ma per device), and a wifi dongle (unknown ampage) and a bluetooth dongle for input. im going to build a pitop. i cant get any dc-dc converter chips till next month though. i could do a 555 based supply but i dont want to trust my pi to a hack.

for the short term im just going to build a linear regulated supply. it ought to put out enough juice for the screen and pi.
« Last Edit: September 03, 2012, 09:02:23 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
Maybe this will be an option to the PI?
http://www.j1nx.nl/cubieboard-about-to-get-released/

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
these arm boards are popping up like daises. there has been a boom in the electronics hobbyist community where arm processors are becoming rabidly more accessible. once we have an arm build then it should be trivial to compile freespace to run on any of them. i think they just need to support opengl es and sdl, and most of them do already when used with an arm linux distro.
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline Thaeris

  • Can take his lumps
  • 211
  • Away in Limbo
Re: OpenGL ES2 and Linux and pi - now with patches!
You should grab one of those old-school giant military laptops - you know, the olive-drab, metal, brief-case-sized computers they used to have. Dekker had a link for an old one once upon a time. With all the small hardware now, you could easily make a pretty substantial computer due to all the room in that case.
"trolls are clearly social rejects and therefore should be isolated from society, or perhaps impaled."

-Nuke



"Look on the bright side, how many release dates have been given for Doomsday, and it still isn't out yet.

It's the Duke Nukem Forever of prophecies..."


"Jesus saves.

Everyone else takes normal damage.
"

-Flipside

"pirating software is a lesser evil than stealing but its still evil. but since i pride myself for being evil, almost anything is fair game."


"i never understood why women get the creeps so ****ing easily. i mean most serial killers act perfectly normal, until they kill you."


-Nuke

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
if you know enough about switch mode power supply design you could probibly build a lipo based psu that you could power a mini-itx mobo, an ssd and a smallish screen and throw in a keyboard and trackball mouse for good measure. just stick all that into a breifcase, and you have a laptop that is as good as a desktop. actually i want to do something like that with my pi.
« Last Edit: September 05, 2012, 05:52:43 pm by Nuke »
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN

 

Offline ShivanSpS

  • 210
Re: OpenGL ES2 and Linux and pi - now with patches!
these arm boards are popping up like daises. there has been a boom in the electronics hobbyist community where arm processors are becoming rabidly more accessible. once we have an arm build then it should be trivial to compile freespace to run on any of them. i think they just need to support opengl es and sdl, and most of them do already when used with an arm linux distro.


Not only that, i need to take a look at the avalible libs in the Android NDK toolchain, but if FS2 on OpenGL ES runs from framebuffer, running on Android should not that far away from that...
« Last Edit: September 09, 2012, 11:51:04 am by ShivanSpS »

 

Offline Nuke

  • Ka-Boom!
  • 212
  • Mutants Worship Me
Re: OpenGL ES2 and Linux and pi - now with patches!
looks like the gpu on the pi is completely open source now:

http://hackaday.com/2014/02/28/raspberry-pi-gpu-goes-open-source-10000-bounty-for-quake-3/

does this help make a raspberry pi run freespace?
I can no longer sit back and allow communist infiltration, communist indoctrination, communist subversion, and the international communist conspiracy to sap and impurify all of our precious bodily fluids.

Nuke's Scripting SVN