Jump to content


Photo

OpenGL implementation (tl;dr more games)


  • Please log in to reply
372 replies to this topic

#1 OFFLINE   lunixbochs

lunixbochs

    Advanced Member

  • Moderators
  • 625 posts
  • Local time: 02:39 AM

Donator

Posted 11 January 2013 - 10:09 AM

What is this?
A performant library implementing major parts of OpenGL 1.x by internally translating to OpenGL ES and filling the gap where necessary.

 
Does this mean I will be able to compile any OpenGL program and have it work perfectly on the Pandora?
No. Some GL calls are extremely impractical or slow to emulate/wrap.
 
Which calls *does* it implement?
This lib exposes a rough glX ~1.3 interface for apps to initialize GL, all calls available in GL ES, and the following:

  • display lists
  • gl immediate mode (glBegin/End)
  • dashed/dotted lines (glLineStipple)
  • raster operations (glBitmap, glDrawPixels)
  • texture/pixel swizzling
  • glPush/PopAttrib
  • evaluators (glMap, glEvalCoord, glEvalMesh)

I also have a precompiled libGLU.so from https://github.com/lunixbochs/glues/ for your convenience.
 
Does that mean it's finished?
Not even close.
 
Why do I want this?
Many GL apps will compile out of the box + start and render accurately/quickly with zero modification. This means a porter can spend most of his/her time on better controls, UI, and optimization without as much worrying about how to implement line stipples or display lists.
If an app *does* need rendering changes, the created context is completely compatible with ES code. You can optimize slow parts of the app's rendering pipeline and leave SDL / GL init code alone.
 
What about all the resulting crappy "compile and forget" ports?
If this library enables *one* good newly-released title, it was worth it.
If you don't like an app on the repo, downvote it to oblivion.
 
Do you have any gameplay videos?
There's a YouTube playlist.
 
Where can I find the source?
https://github.com/lunixbochs/glshim
 
Any known issues?
Yes! It's still missing parts of the GL spec.

  • It only supports GL 1.x, without shaders.
  • raster operations are pretty fast, but don't respect Z-order
  • glTexGen only implements SPHERE_MAP and OBJECT_LINEAR
  • glPush/PopAttrib is incomplete

Some issues are fixed by LD_PRELOAD'ing the included libpreload.so or setting LIBGL_FB=1:

  • Multiple XOpenDisplay() connections can break the SGX driver.
  • SDL_SetGamma crashes.

If your app freezes anyway, preload might not work for X11. In this case, set the direct framebuffer environment variable.

 

Compatibility issues:

  • GLUT: I had to use GLUT_DOUBLE in glutInitDisplayMode() (double buffering), and set glutIdleFunc(render function);

Where can I get it?
http://bochs.info/pnd/.gl/ - This is probably not for the faint of Linux.
Test thoroughly before you release anything with it. Obscure GL states can cause undefined behavior.
 
How do I use it?

  • Download libGL.so.1 and libGLU.so.1.
  • Put them in a library directory like "$HOME/lib". I don't recommend putting them in /usr/lib.
  • In your .bashrc, do `export LD_LIBRARY_PATH="$HOME/lib"` to enable them.

Environment variable options:

  • LIBGL_DEBUG=1 - enable additional debug output.
  • LIBGL_FB=1 - force rendering to the framebuffer instead of an X11 window. Make sure the application sets a resolution of 800x480 first.
  • LIBGL_FPS=1 - print fps to command line.
  • LIBGL_SHRINK=1 - do a very bad job of shrinking textures on load. I don't recommend it  ;)
  • LIBGL_STACKTRACE=1 - generate a stacktrace on crash. This only works if you compile your app with -funwind-tables.
  • LIBGL_TEXDUMP=1 - dump all loaded textures to /tmp/*.ppm. You should really use PVRTrace instead.
  • LIBGL_VSYNC=1 - wait for vsync on fb0 each frame. You should probably just use powervr.ini and LIBGL_FB=1 for this.
  • LIBGL_XREFRESH=1 - call `xrefresh` on exit. Be careful, as this is preliminary and might break signal handlers in the app.

I enabled vsync. Why do I still see tearing with framebuffer output!?
You need to put a file in your current directory named powervr.ini with the following contents:

[default]
WindowSystem=libpvrPVR2D_FLIPWSEGL.so

Do you have any example apps?



#2 OFFLINE   crow_riot

crow_riot

    Advanced Member

  • Members
  • PipPipPip
  • 618 posts
  • Local time: 10:39 AM

Donator

Posted 11 January 2013 - 10:15 AM

wow this is awesome!


finished: audiorace | dragonbox compo: apkenv | alive&kicking compo: flashenv

#3 OFFLINE   ingoreis

ingoreis

    X86 Qemu Knower

  • Members
  • PipPipPip
  • 1859 posts
  • Local time: 10:39 AM
  • Location49.491276,8.423518

Donator

Posted 11 January 2013 - 10:16 AM

Wooooow so Cool ^_^

I waited for Years for a working OpenGL Wrapper for the Pandora

(naturaly not fully working but very very cool) That help us many more than that slowly OpenGL Mesa Emulation :)

 

Many THX for Releasing this ;)

Now i must make a New Dev SD Card with newest Firmware here to try :D


Over 240 Pandora Youtubevideos on my Account,see here: Klick here

Many Many free Pandora Qemu Games are here with Youtube Videos Klick here

The Pandora Qemu Wiki has many Answers for your Questions Klick Here

Here are all Premade Qemu Images optimized for Pandora:Klick here

 


#4 OFFLINE   ptitSeb

ptitSeb

    Serial Porter

  • Members
  • PipPipPip
  • 3990 posts
  • Local time: 10:39 AM
  • LocationFrance, near Lyon

Posted 11 January 2013 - 10:24 AM

Wohoooo ! That's great ! I'm grabing this and trying some experiments with that !

 

(I'll start with simples things, like Jumpman and catatiles, and then I'll try to mess with blender / blenderplayer).



#5 OFFLINE   ingoreis

ingoreis

    X86 Qemu Knower

  • Members
  • PipPipPip
  • 1859 posts
  • Local time: 10:39 AM
  • Location49.491276,8.423518

Donator

Posted 11 January 2013 - 10:27 AM

Yeah much much more easy possible Games ^_^

Maybe i release a Pandora DEV Image with it for all when finished ^_^

 

Edit: Oh ok i readed the thread again and the Developer dont want to Release anything with it,its for testing Things.

Ok then i try only for me and when i success anything i can write it here :)


Over 240 Pandora Youtubevideos on my Account,see here: Klick here

Many Many free Pandora Qemu Games are here with Youtube Videos Klick here

The Pandora Qemu Wiki has many Answers for your Questions Klick Here

Here are all Premade Qemu Images optimized for Pandora:Klick here

 


#6 OFFLINE   ptitSeb

ptitSeb

    Serial Porter

  • Members
  • PipPipPip
  • 3990 posts
  • Local time: 10:39 AM
  • LocationFrance, near Lyon

Posted 11 January 2013 - 11:22 AM

So, first try, with an already compiled Jumpman.

 

First the good news:

 * The games works, and it has got the right Speed :) !

 * All is presents, fonts (used ftgl) and gfx.

 

The Bad news:

 * Gfx were upside-downs. I have to check more precisely what kind of trnsformation (is it miror or rotation 180° ?), or just do a screen shot, it will be easier. I also have to check what the game is using draw is pixels (but I think "sprites" are a bunch of pixel, and each pixel is a quad, so a sprite is a bunch of quads stored in a glList...

 * I couldn't exits the game properly. I select Quit, but the screen stayed the same, the mouse was mouving, but no exit of full screen.

 

 

Still, very very very promising ! I'll try other stuff (allegro 5.0.8 is next, with Meka 0.80 as target).



#7 OFFLINE   ingoreis

ingoreis

    X86 Qemu Knower

  • Members
  • PipPipPip
  • 1859 posts
  • Local time: 10:39 AM
  • Location49.491276,8.423518

Donator

Posted 11 January 2013 - 11:35 AM

Plz can you try Tux Racer?

That Game would be fun like BillardGL ^_^


Over 240 Pandora Youtubevideos on my Account,see here: Klick here

Many Many free Pandora Qemu Games are here with Youtube Videos Klick here

The Pandora Qemu Wiki has many Answers for your Questions Klick Here

Here are all Premade Qemu Images optimized for Pandora:Klick here

 


#8 ONLINE   elwing

elwing

    Advanced Member

  • Members
  • PipPipPip
  • 2061 posts
  • Local time: 10:39 AM

Donator

Posted 11 January 2013 - 12:07 PM

wow, something I was hopeing to see even more than psp or DS emulation... we really gets some nice treats for christmas this year...


... DM3730...
Aditionally, if your Pandora can clock to 900MHz, there's not much difference anymore.


#9 OFFLINE   ingoreis

ingoreis

    X86 Qemu Knower

  • Members
  • PipPipPip
  • 1859 posts
  • Local time: 10:39 AM
  • Location49.491276,8.423518

Donator

Posted 11 January 2013 - 12:12 PM

Yeah that thought i too :)

Cool News since one Month :lol:

But we shall not forget this is in Beta Phase too,but seem to work very Fine ;)

Many THX again for releasing that ^_^


Over 240 Pandora Youtubevideos on my Account,see here: Klick here

Many Many free Pandora Qemu Games are here with Youtube Videos Klick here

The Pandora Qemu Wiki has many Answers for your Questions Klick Here

Here are all Premade Qemu Images optimized for Pandora:Klick here

 


#10 ONLINE   elwing

elwing

    Advanced Member

  • Members
  • PipPipPip
  • 2061 posts
  • Local time: 10:39 AM

Donator

Posted 11 January 2013 - 12:23 PM

now I'dd need an arx libertatis port...


... DM3730...
Aditionally, if your Pandora can clock to 900MHz, there's not much difference anymore.


#11 OFFLINE   PokeParadox

PokeParadox

    Advanced Member

  • Moderators
  • 2121 posts
  • Local time: 09:39 AM

Donator

Posted 11 January 2013 - 12:34 PM

OMG This is just the sex!

Congratulations I guess eventually the lib can come as default in the firmware?



Tired of the infamous preorder queue? Donate and help get this queue cleared!
Twitter: @PokeParadox
If you like my work, please consider leaving a rating or feedback or donating, every little "thank you" is appreciated!
My Pandora Apps - My Development Blog - Pirate Games


#12 OFFLINE   ptitSeb

ptitSeb

    Serial Porter

  • Members
  • PipPipPip
  • 3990 posts
  • Local time: 10:39 AM
  • LocationFrance, near Lyon

Posted 11 January 2013 - 12:34 PM

Plz can you try Tux Racer?

That Game would be fun like BillardGL ^_^

 

Hey, Tux and BillardGL was in my "I'll try to ports those when I have ported the ones I'm working on"... I try not to have too many ports going on at the same time.



#13 OFFLINE   _wb_

_wb_

    Microbe

  • Moderators
  • 4465 posts
  • Local time: 10:39 AM
  • LocationBrussels, Belgium

Posted 11 January 2013 - 12:39 PM

How will you decide whether or not to make this an open source project?

 

Anyway, this is a very interesting and promising project, and not just for the Pandora.

 

Too bad the (proprietary) GPU driver we are stuck with seems to be kind of crappy. I wonder if it would be an interesting approach to try to make an OpenGL implementation that doesn't use GL|ES, but hand-optimized NEON code?

 

Are you planning to submit this to the coding compo? I'm not sure what category this would be, but it certainly deserves a prize!


pandora.png

#14 OFFLINE   PokeParadox

PokeParadox

    Advanced Member

  • Moderators
  • 2121 posts
  • Local time: 09:39 AM

Donator

Posted 11 January 2013 - 12:43 PM

How will you decide whether or not to make this an open source project?

 

Anyway, this is a very interesting and promising project, and not just for the Pandora.

 

Too bad the (proprietary) GPU driver we are stuck with seems to be kind of crappy. I wonder if it would be an interesting approach to try to make an OpenGL implementation that doesn't use GL|ES, but hand-optimized NEON code?

 

Are you planning to submit this to the coding compo? I'm not sure what category this would be, but it certainly deserves a prize!

In extension to this - would it possible to have a wrapper that uses stable GPU functionality where possible and optimised NEON where not possible?



Tired of the infamous preorder queue? Donate and help get this queue cleared!
Twitter: @PokeParadox
If you like my work, please consider leaving a rating or feedback or donating, every little "thank you" is appreciated!
My Pandora Apps - My Development Blog - Pirate Games


#15 OFFLINE   Farox

Farox

    Advanced Member

  • Members
  • PipPipPip
  • 950 posts
  • Local time: 10:39 AM
  • LocationItaly

Donator

Posted 11 January 2013 - 12:54 PM

OMG this is great  :)

Can't wait to try it with my unfinished port of GL117


Read also my Blog http://farox.rbnet.it/

#16 OFFLINE   ptitSeb

ptitSeb

    Serial Porter

  • Members
  • PipPipPip
  • 3990 posts
  • Local time: 10:39 AM
  • LocationFrance, near Lyon

Posted 11 January 2013 - 03:50 PM

I tried with catatiles (i.e. cataclym roguelike TileMap mod), but it need glDrawBuffer. I have to see what is this function...



#17 OFFLINE   skeezix

skeezix

    Advanced Member

  • Official OpenPandora Team
  • PipPipPip
  • 2706 posts
  • Local time: 04:39 AM

Posted 11 January 2013 - 04:35 PM

Really great project, thank you for undertaking it :)

 

jeff



#18 OFFLINE   mcobit

mcobit

    Does this thing work?

  • Members
  • PipPipPip
  • 5763 posts
  • Local time: 10:39 AM
  • LocationFrankfurt a.M., Germany

Donator

Posted 11 January 2013 - 06:02 PM

Released at last :)
Now if somebody finds some unimplemented stuff, they can report it here or give you hints or code on how to implement it.

#19 OFFLINE   lunixbochs

lunixbochs

    Advanced Member

  • Moderators
  • 625 posts
  • Local time: 02:39 AM

Donator

Posted 11 January 2013 - 07:24 PM

now I'dd need an arx libertatis port...

I got it to compile, but it runs horribly.

I tried with catatiles (i.e. cataclym roguelike TileMap mod), but it need glDrawBuffer. I have to see what is this function...

I'l take a look at glDrawBuffer.

Tip for anyone trying a port that doesn't work - if you make the binaries available for me, I can try to fix whatever's broken in the lib that prevents it from rendering properly.

I already have GL builds of aquaria, armagetron, arx libertatis, cube, foobillard, jumpman, neverball, octaspire crates, trigger rally, and uplink I've been using to test.

#20 OFFLINE   Linux-SWAT

Linux-SWAT

    Advanced Member

  • Members
  • PipPipPip
  • 6423 posts
  • Local time: 10:39 AM
  • LocationParis, France

Posted 11 January 2013 - 07:31 PM

Great !




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users