Homesource Forums

Homeworld Source Editing Talk
It is currently Mon Sep 25, 2017 10:54 pm

All times are UTC - 5 hours




Post new topic Reply to topic  [ 20 posts ] 
Author Message
 Post subject: OpenGL ES
PostPosted: Wed Mar 30, 2011 6:23 pm 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
I've been playing around getting Homeworld to run on my N900, which wasn't too hard with all the fixes already done, managed it with a bit of wrapper code in gldll.c and a whole bunch of random hacks.

I'd like to do a much neater job before I commit anything though, is the conclusion of http://homesource.nekomimicon.net/sourceforum/viewtopic.php?f=7&t=266 still the plan? I can pull that code out first if that's the case.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Mar 30, 2011 6:48 pm 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
Yes cleaning up that code makes sense and should make things a lot neater. It will also make it easier to incorporate OpenGL functionality that the game currently doesn't take advantage of.

You've got Homeworld working on a N900? That's great! I demand YouTube footage! :D

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Mar 30, 2011 8:42 pm 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
I'll get started on pulling that code out then. :)

YouTube footage

Sorry about the poor webcam video quality, it's the only camera I've got apart from the one on the n900.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Mar 30, 2011 10:18 pm 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
Hmm, is RGL functional? If it is, it's probably not the best of ideas to get rid of gldll.[c,h]. If it isn't, I can get rid of RGL too..

edit: I'm increasingly becoming more in favour of keeping gldll.[c,h], and adding a much tidier gles.[c,h] instead of my current hack in gldll.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Thu Mar 31, 2011 1:26 am 
Offline
Site Admin
User avatar

Joined: Tue Dec 14, 2004 12:41 am
Posts: 326
pseudonym404 wrote:
Hmm, is RGL functional?


RGL is long gone, de facto deprecated by all the work done to port HW and src/rgl itself was removed in rev 604.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Thu Mar 31, 2011 2:56 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
pseudonym404 wrote:
Sorry about the poor webcam video quality, it's the only camera I've got apart from the one on the n900.
That was great. I have a 40 minute commute each way to work by train and this footage makes me wonder if I should be working on a mobile platform rather than Mac OS X! :D

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Thu Mar 31, 2011 10:13 am 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
zapkitty wrote:
RGL is long gone, de facto deprecated by all the work done to port HW and src/rgl itself was removed in rev 604.

OK, I'll pull out the trailing remnants of that too then. :)

lmop wrote:
That was great. I have a 40 minute commute each way to work by train and this footage makes me wonder if I should be working on a mobile platform rather than Mac OS X! :D

Glad you liked it. :)


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Sun Apr 03, 2011 1:03 am 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
Committed, I hope you're OK with it...

There's quite a lot of code changes, but there should be no discernible runtime change from previous behavior.

There's some wrapper code for GLES in glinc.h for now, to get something functional committed, it's just for immediate mode stuff (glBegin/glEnd), which is absent in GLES.

I hope to eventually replace all usage of glBegin/glEnd with glDrawArrays/glDrawElements, but that can now be done a little at a time.

Tested on my n900, x86 Linux and x86_64 Linux, all seems good. :)

edit: builds fine in xcode too, just remove gldll.c and glcaps.c and add OpenGL.framework. Amazingly, it even runs fine using unaccelerated OpenGL in OSX running under VirtualBox. ;)


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Sun Apr 03, 2011 5:14 am 
Offline
coder
User avatar

Joined: Tue Dec 14, 2004 3:24 pm
Posts: 324
Location: UK (UTC+0)
I had a (very brief) play and it seems OK. One thing does puzzle me though: on Mac OS X you have to link in OpenGL.framework, as you say. Previously I assumed that happened under the hood thanks to SDL.framework but that clearly isn't the case or I wouldn't need to do it now. I don't see any RGL-implementation of the referenced functions being deleted, so how did this work before?!

_________________
MacHomeworld | HomeworldSDL.org


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Sun Apr 03, 2011 6:58 am 
Offline

Joined: Mon Jul 07, 2008 6:24 pm
Posts: 14
Previously, the OpenGL library was loaded using SDL_GL_LoadLibrary (which ultimately uses dlopen on Linux and OSX), and all OpenGL functions were resolved using SDL_GL_GetProcAddress (which ultimately uses dlsym on Linux and OSX, via glXGetProcAddress or similar where appropriate), which is why the function pointers were needed.

Now the functions are not being resolved manually using SDL_GL_GetProcAddress at runtime, it's necessary to link against the OpenGL library at compile time (-lGL on Linux, or -framework OpenGL on OSX), and the OS's dynamic linker will perform function resolution at runtime.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Thu Jun 23, 2011 6:35 am 
Offline

Joined: Thu Jun 23, 2011 3:34 am
Posts: 1
Hi,

first of all great work on the OpenGL ES version! I built it for the pandora (www.openpandora.org) and it mostly works great.

I had to fudge the makefiles a little... when I've done a proper patch for that I'll submit upstream

Also, I changed it to render to display instead of gfxdisplay, as gfxdisplay caused a stuttering when moving the camera.

I have also made some changes to allow right shift and right control to be used as left and right mouse click, since these buttons are the pandoras shoulder pads. This could maybe be incorporated with a configure switch later.

However, it does seem to crash occasionally. I tried this morning to build a debug version, but wasn't successful - I'll try again later. It always crashes near to the end of the cut scene in the second level, where the raiders are found near the wreckage and fly towards the mothership.

Any clues why this might be?

There are a lot of sound buffer overrun errors too.

Thanks!


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Thu Jun 30, 2011 11:28 am 
Offline

Joined: Tue Oct 10, 2006 2:04 pm
Posts: 73
Location: North germany
I was playing around with OpenGL ES 2.0 a few months back and noticed that the majority of display code could probably be moved to a fragment shader (especially all this [team-]coloring).
I'm not sure though whether this is desirable since it would mean someone would have to write at least 2 shaders - one for OGLES and one for OGL (though they should be fairly similar)

_________________
.: The hardest punishment are the innocent eyes of a child searching for truth :.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Mon Jul 04, 2011 6:20 am 
Offline

Joined: Thu Dec 21, 2006 6:39 am
Posts: 7
Location: Edinburgh, UK
Only as an option as graphics cards without programmable shaders are still being used.

_________________
Alan.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Mon Jul 04, 2011 8:20 am 
Offline

Joined: Tue Oct 10, 2006 2:04 pm
Posts: 73
Location: North germany
I do not own a single "computer" that doesn't run at least OpenGL ES 2.0. Even my old HTC Dream could cope.
Besides AFAIK if the card does not support programmable shaders the driver converts them to ordinary OpenGL instructions.
The only valid point I think you could make is that OpenGL is broken in quite a number of linux drivers.

_________________
.: The hardest punishment are the innocent eyes of a child searching for truth :.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Jul 06, 2011 10:05 am 
Offline

Joined: Thu Dec 21, 2006 6:39 am
Posts: 7
Location: Edinburgh, UK
So? You don't but as an example I do and this laptops graphics cannot be updated. No Linux drivers, at least open source, "convert" shaders to fixed instuctions. Neither I believe would propriety drivers except by processing shaders rather slowly via the CPU.

Unless serious modifications are planned for Homeworld SDL, it would desirable to keep shaders optional for all potential users who aren't technology whores! Since when is three years old? (HTC Dream released 2008.) :)

_________________
Alan.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Jul 06, 2011 6:29 pm 
Offline

Joined: Tue Oct 10, 2006 2:04 pm
Posts: 73
Location: North germany
Swanny wrote:
You don't but as an example I do and this laptops graphics cannot be updated.

Come on - spill the beans - what kind of Hardware/Software combination are you running at.

Swanny wrote:
No Linux drivers, at least open source, "convert" shaders to fixed instuctions.

Don't get me started on the state of linux 3d drivers :)

Swanny wrote:
Neither I believe would propriety drivers except by processing shaders rather slowly via the CPU.

Quick google search and you'll find that they do. Even Google introduced a Software Mode for Shaders in Chrome (don't know about Mozilla though).

Swanny wrote:
Unless serious modifications are planned for Homeworld SDL, it would desirable to keep shaders optional for all potential users who aren't technology whores!

I don't think this will ever be changed - but one may dream about Displacement Mapping, Shadows, realistic lighting, etc. :)

_________________
.: The hardest punishment are the innocent eyes of a child searching for truth :.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Fri Jul 08, 2011 4:48 am 
Offline

Joined: Thu Dec 21, 2006 6:39 am
Posts: 7
Location: Edinburgh, UK
It's an old HP nx7010 2004 with a Radeon 9000. However am finally thinking of upgrading to perhaps an AMD A8-3530MX based laptop when they appear. My desktop is programmable through with a old X1650 Pro AGP 2006, enough to occasionally run Quake 4 and Doom 3 no problems with the drivers.

Not a huge game player so don't feel the need to constantly upgrade and waste resources.

Chrome has a "software" mode? That'll be on the CPU then! Except of course the problem being that, logically, systems with graphics cards without programmable shaders are going to be used with comparatively low power single core CPUs.

_________________
Alan.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Sun Aug 14, 2011 6:19 am 
Offline

Joined: Tue Oct 10, 2006 2:04 pm
Posts: 73
Location: North germany
I'm trying out the OpenGL ES code now and I wonder - is there any special reason why you used 1.x? Do the devices just support the old Standard?
And GL_LINE_STIPPLE is not included in OGES for me - it's in OGEW - but I haven't yet figured out how I can add both to the project.
Besides for me it chokes at calling EGL since Nvidia doesn't provide a EGL implementation for Linux. Curse them.

_________________
.: The hardest punishment are the innocent eyes of a child searching for truth :.


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Sun Mar 24, 2013 7:55 pm 
Offline

Joined: Sun Mar 24, 2013 7:52 pm
Posts: 1
Hi, I was just wondering what is the status of the N900 port? Or is it just that the main source code has been amended to be more N900-friendly?

I've looked in the Linux files download section and saw the tarballs. Is it necessary to compile the game from source?


Top
 Profile  
 
 Post subject: Re: OpenGL ES
PostPosted: Wed Jan 01, 2014 2:33 pm 
Offline

Joined: Wed Jan 01, 2014 2:07 pm
Posts: 1
If HomeworldSDL can be compiled with OpenGL ES and uses SDL then I bet it could be compiled with emscripten as well with a few tweaks. Imagine running Homeworld directly inside a web browser ;]

Edit: Woops, I knew LCID Fire was a familiar name! Started work years ago haha https://github.com/kripken/emscripten/pull/191


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group