mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

3D OpenGL games?

Tue May 28, 2013 2:42 am

How to enable 3D in games?


[email protected] ~ $ glxgears
Error: couldn't get an RGB, Double-buffered visual
[email protected] ~ $ glxinfo
name of display: :0
Error: couldn't find RGB GLX visual or fbconfig
[email protected] ~ $ neverball
Couldn't find matching GLX visual
[email protected] ~ $ supertuxkart
Irrlicht Engine version 1.7.3
Linux 3.6.11+ #456 PREEMPT Mon May 20 17:42:15 BST 2013 armv6l
[FileManager] Data files will be fetched from: '/usr/share/games/supertuxkart'
[FileManager] Addons files will be stored in '/home/pi/.local/share/supertuxkart/addons'.
[translate] Env var LANGUAGE = 'en_GB.UTF-8'
[translate] Env var LANGUAGE = 'en_GB.UTF-8', which corresponds to 'English (Great Britain)'
Adding language fallback en
[IrrDriver] Trying OpenGL rendering.
[IrrDriver Temp Logger] Level 2: Fatal error, could not get visual.
Segmentation fault
[email protected] ~ $ warzone2100
info |03:36:09: [wzMain2:1156] Using colour depth of 16 instead of 32.
info |03:36:09: [wzMain2:1157] You will experience graphics glitches!
error |03:36:09: [wzMain2:1177] SDL_SetVideoMode failed (Couldn't find matching GLX visual).
[email protected] ~ $

SirLagz
Posts: 1705
Joined: Mon Feb 20, 2012 8:53 am
Location: Perth, Australia
Contact: Website

Re: 3D OpenGL games?

Tue May 28, 2013 4:20 am

You need to recode anything that uses OpenGL to use OpenGL ES instead.
My Blog - http://www.sirlagz.net
Visit my blog for Tips, Tricks, Guides and More !
WiFi Issues ? Have a look at this post ! http://www.raspberrypi.org/phpBB3/viewtopic.php?f=28&t=44044

frikosal
Posts: 12
Joined: Tue May 28, 2013 7:12 am

Re: 3D OpenGL games?

Tue May 28, 2013 7:16 am

How can that be done ?
I'm trying to run stellarium and I have the same problem.
Thanks !

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Tue May 28, 2013 8:13 am

If you are really desperate , try

Code: Select all

sudo apt-get install libgl1-mesa-swx11 libgl1-mesa-glx
I can't guarantee that it works , though.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

Re: 3D OpenGL games?

Tue May 28, 2013 11:32 am

@ghans

doesnt install, dependencies conflict.

@SirLagz

why me? Im not a coder :mrgreen:

Im not a gamer, y'know, I play sometimes on my debian core-duo laptop - mainly neverball and warzone and I was curious how Pi would handle it, performance-wise, fps.

Does opengl it work in Arch?

I read somewhere that Pi's GPU is well supported in linux (unlike Allwinner's Mail400).

frikosal
Posts: 12
Joined: Tue May 28, 2013 7:12 am

Re: 3D OpenGL games?

Tue May 28, 2013 11:52 am

If I understand, it seems that there are many raspbian packages that depend on opengl, and aren't working. Is it so ?
Can you please explain me what is the problem ?

User avatar
PeterO
Posts: 4517
Joined: Sun Jul 22, 2012 4:14 pm

Re: 3D OpenGL games?

Tue May 28, 2013 12:00 pm

The problem is that the packages are designed to run on a linux with "desktop open GL" support. The PI has "mobile device open GL" (callled open GS ES) support, and the two are not the same.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: 3D OpenGL games?

Tue May 28, 2013 12:39 pm

If someone would write an OGL 2 wrapper for the the open source glue code, a lot of things would work. Eben was confident that it could work this way, but obviously no one came out with something like that thus far :( .
Rocket Scientist.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5230
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: 3D OpenGL games?

Tue May 28, 2013 1:36 pm

thradtke wrote:If someone would write an OGL 2 wrapper for the the open source glue code, a lot of things would work. Eben was confident that it could work this way, but obviously no one came out with something like that thus far :( .
I'm pretty sure this is not possible for arbitrary code. A lots of GL constructs just don't exist in GL ES.
Display lists would be one example that would be hard to implement.
Sure you could have software emulation of the tricky bits, but that's not really going to be usable.

Remember, GL ES is used on many platforms where a GL->GL ES wrapper would be useful (think iPhone and getting a GL game to run to sell in the appstore). So far no one has achieved it.

To get decent performance on GL ES you want to use the right contructs (like VBOs), and you're not going to get that with a GL game that does something like:

Code: Select all

for (surfnum=0;surfnum < surftotal;surfnum++){
             for (i=0;i<triNum[surfnum];i++){
                glBegin(GL_POLYGON);
                glNormal3fv(triArray[surfnum][i].normpt1);
                glVertex3fv(triArray[surfnum][i].pt1);
                glNormal3fv(triArray[surfnum][i].normpt2);
                glVertex3fv(triArray[surfnum][i].pt2);
                glNormal3fv(triArray[surfnum][i].normpt3);
                glVertex3fv(triArray[surfnum][i].pt3);
                glEnd();
                glFlush();
            }   
    }

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: 3D OpenGL games?

Tue May 28, 2013 1:53 pm

Ok I see, dom. Pity!
Rocket Scientist.

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Wed May 29, 2013 2:47 pm

@mt12345

What happens if you try to install only the first package ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

Re: 3D OpenGL games?

Wed May 29, 2013 10:14 pm

[email protected] ~ $ sudo apt-get install libgl1-mesa-swx11 libgl1-mesa-glx
Reading package lists... Done
Building dependency tree
Reading state information... Done
libgl1-mesa-glx is already the newest version.
libgl1-mesa-glx set to manually installed.
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
libgl1-mesa-glx : Conflicts: libgl1
libgl1-mesa-swx11 : Conflicts: libgl1
E: Unable to correct problems, you have held broken packages.


[email protected] ~ $ sudo apt-get install libgl1-mesa-swx11
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
fonts-sil-gentium fonts-sil-gentium-basic frozen-bubble-data
libcapture-tiny-perl libclass-inspector-perl libcompress-bzip2-perl
libfile-sharedir-perl libfile-which-perl libgnome-bluetooth10
libnl-route-3-200 libnm-glib-vpn1 libnm-glib4 libnm-gtk-common libnm-gtk0
libnm-util2 libparams-util-perl libpcap0.8 libsdl-gfx1.2-4 libsdl-net1.2
libsdl-pango1 libtie-simple-perl network-manager ttf-sil-gentium-basic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
libosmesa6
The following packages will be REMOVED:
frozen-bubble libalien-sdl-perl libgl1-mesa-glx libsdl-perl
The following NEW packages will be installed:
libgl1-mesa-swx11 libosmesa6
0 upgraded, 2 newly installed, 4 to remove and 0 not upgraded.
Need to get 1,729 kB of archives.
After this operation, 8,851 kB of additional disk space will be used.
Do you want to continue [Y/n]?

mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

Re: 3D OpenGL games?

Wed May 29, 2013 10:20 pm

it works.
oh now I see what you mean by 'desperate' hahaha.

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Thu May 30, 2013 7:59 am

Hey cool. You're the first one which actually got
software rendering to work AFAIK. Obviously not of
much use on a 700MHz ARMv6 CPU.

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

Re: 3D OpenGL games?

Thu May 30, 2013 8:57 am

I assume no hardware accelerated graphics in other distros either?

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Thu May 30, 2013 8:59 am

Yes , everything has to be rewritten for Broadcoms
OpenGL ES implementation.


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

mt12345
Posts: 11
Joined: Sun Jun 03, 2012 6:41 pm

Re: 3D OpenGL games?

Thu May 30, 2013 10:25 am

does it mean won't enjoy warzone2100 on raspberry this year ? (ever??)

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Thu May 30, 2013 1:06 pm

If the engine is not open-source and nobody rewrites
it for Open GL ES , yes , never at all .


ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

thradtke
Posts: 492
Joined: Wed May 16, 2012 5:16 am
Location: Germany / EL

Re: 3D OpenGL games?

Fri May 31, 2013 5:47 am

mt12345 wrote:does it mean won't enjoy warzone2100 on raspberry this year ? (ever??)
Open GL code is here: /lib/ivis_opengl (http://buildbot.wz2100.net/files/doxygen/files.html).

Deriving /lib/ivis_opengles from it would be a quite rewarding exercise :D .
Rocket Scientist.

frikosal
Posts: 12
Joined: Tue May 28, 2013 7:12 am

Re: 3D OpenGL games?

Wed Jun 05, 2013 6:12 pm

I think I'm a bit confused.
As I understand, there are many packages that depend on OpenGL and these packages can be installed in Raspbian, but then they don't work and it is not easy to fix them. Is it so ?

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5230
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: 3D OpenGL games?

Wed Jun 05, 2013 6:21 pm

frikosal wrote:I think I'm a bit confused.
As I understand, there are many packages that depend on OpenGL and these packages can be installed in Raspbian, but then they don't work and it is not easy to fix them. Is it so ?
They can be run using software emulated OpenGL libs, but anything non-trivial won't keep up.

Converting OpenGL code to OpenGL ES is non-trivial, but if the original code is well written, and the implementor knows OpenGL and OpenGL ES, then it may take a few days.

If the app already has an OpenGL ES port (like Quake 3 did), then adapting that for the Pi is fairly trivial (add some standard initialisation code and rebuild), maybe a couple of hours.

frikosal
Posts: 12
Joined: Tue May 28, 2013 7:12 am

Re: 3D OpenGL games?

Thu Jun 06, 2013 7:29 am

But the idea of the packages systems is that if you can install the software, then it runs (except maybe some minor bugs).
Don't you think that for the codes that don't run, the package should be removed to avoid confusing the users ?

LlyrP
Posts: 22
Joined: Tue May 21, 2013 3:31 pm
Location: Edinburgh
Contact: Website

Re: 3D OpenGL games?

Thu Jun 06, 2013 10:33 am

It doesn't always work like that, even on the desktop distros.

It's entirely possible someone will write a GL-ES wrapper in the future, which is why I suspect the packages are still in the repos.
Use your own judgement when following any instructions from the forum. I take no responsibility if you fry anything...
--
LlyrP :: http://llyrpenrose.com/

ghans
Posts: 7850
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany

Re: 3D OpenGL games?

Thu Jun 06, 2013 11:52 am

AFAIK some things which are used in Desktop OpenGL won't beable to be
realized through OpenGL ES wrappers (without using a lot of CPU anyway).
Of course Murphys Law dictates that the Apps we want are using those features ...

Not that people did not try it:

http://www.raspberrypi.org/phpBB3/viewt ... 68&t=30207
http://code.google.com/p/gl-wes-v2/
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5230
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: 3D OpenGL games?

Fri Jun 07, 2013 12:13 pm

frikosal wrote:But the idea of the packages systems is that if you can install the software, then it runs (except maybe some minor bugs).
Don't you think that for the codes that don't run, the package should be removed to avoid confusing the users ?
Well, they do all run using the software rendered mesa library. It's just they run very slowly.
I may think that software running at 2 fps is pointless, but others may disagree.

I don't think removing packages from Debian for performance reasons is done on any platform.
If it's part of Debian and it builds, then you can install it.

Remember there are 35,000 packages in raspbian. It's hardly a simple job to test every one for how well it runs.

Return to “Troubleshooting”