New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenGL 3.x update #3219

Merged
merged 36 commits into from Nov 18, 2014

Conversation

Projects
None yet
5 participants
@fluffyfreak
Contributor

fluffyfreak commented Oct 16, 2014

Description:

Updating the OpenGL renderer to require & use OpenGL version 3.x plus newer GLSL syntax requiring us to build our own matrices, use shader attributes and remove deprecated functionality.

NEW -> Purpose:

With this update to 3.x I've removed almost all of the old fixed function pipeline. In fact it creates a forward compatible profile that raises GL errors if you try to use old functions. This means that I had to recreate all of the matrix transformation code, light, material and other structures in GLSL.
The benefit of all this is that it is now much easier to port to OpenGL ES 2.0+ platforms like tablets and smartphones. Or to use bgfx with support for other renderers (DirectX/ES/etc) in the future.
All of which means we can port it to run on devices like the RaspberryPi, Amazon Fire TV et al.

Work-In-Progress:

I haven't even decided whether to go straight to 3.3 (GLSL 330) or stick at 3.2 / 3.1 (GLSL 150). That decision will come down to how well everything runs across all 3 OS's that we support. Getting them all to work and give me the correct context has proven to be horribly fragile and convoluted at times.

Bugs / Notes:

There are probably many more but these I know of:

  • FresnelSphere - the hyperjump sphere renders opaque in the SectorView screen.
  • glLineWidth - is deprecated and causes runtime errors, needs a new line shader writing.
  • ModelViewer - tested and working.

Posting so people can get a heads up of what's coming, ask questions etc.

Andy

fluffyfreak added some commits Oct 7, 2014

Initial super-commit of port to OpenGL 3.3 - ported shaders, made sha…
…der version 150 from 120, refactored maths to calculate shader matrices slightly, fixed up call sites and main UI rendering issues.
New UI and VtxColor materials and shaders.
Don't bother to cleanup the shader programs on destroying the renderer they'll be released automatically.
Mac and Linux seem to require both glewExperimental and cannot handle…
… 3.3 reliably, gone back to GLSL 150, OpenGL 3.2 etc
Note why we're having to force the CORE OpenGL profile.
Disable the GL_EXT_texture_compression_s3tc everywhere.
Remove duplicate Material / MaerialParameters.
Fix planetrings shaders for modern GLSL.

@laarmen laarmen added the in progress label Oct 16, 2014

@lwho lwho added the WIP label Oct 16, 2014

@fluffyfreak fluffyfreak added New feature To do and removed To do labels Oct 16, 2014

@fluffyfreak fluffyfreak self-assigned this Oct 16, 2014

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Oct 18, 2014

Contributor

@impaktor you mentioned on the forum that this changeover might give you problems.
I've run it successfully on a MacMini with an Intel HD3000 GPU and a Linux box with a low-end AMD GPU with MESA drivers.
Would you be able to try it out and report what problems/errors you have?

Contributor

fluffyfreak commented Oct 18, 2014

@impaktor you mentioned on the forum that this changeover might give you problems.
I've run it successfully on a MacMini with an Intel HD3000 GPU and a Linux box with a low-end AMD GPU with MESA drivers.
Would you be able to try it out and report what problems/errors you have?

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Oct 18, 2014

Member
SDL Version 2.0.3
Failed to set video mode. (Could not create GL context). Re-trying with 16-bit depth buffer
error: Failed to set video mode: Could not create GL context
Member

impaktor commented Oct 18, 2014

SDL Version 2.0.3
Failed to set video mode. (Could not create GL context). Re-trying with 16-bit depth buffer
error: Failed to set video mode: Could not create GL context
@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Oct 18, 2014

Contributor

Damn, that's your Intel 950 GPU yeah? I guess we'll have to start accepting donations towards the impaktor-needs-a-newer-laptop fund on the website ;)

Contributor

fluffyfreak commented Oct 18, 2014

Damn, that's your Intel 950 GPU yeah? I guess we'll have to start accepting donations towards the impaktor-needs-a-newer-laptop fund on the website ;)

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Oct 18, 2014

Member

Damn, that's your Intel 950 GPU yeah?

yeah, that's my thinkpad X201

I guess we'll have to start accepting donations towards the impaktor-needs-a-newer-laptop fund on the website ;)

Don't worry too much about it. Me (and my boss) do a lot of procrastinating at work, where I have a modern machine, so that can still run pioneer. I just won't be able to test things out from home. So I'll run pioneer while my boss plays Star Craft (in wine) with open office door and loud volume on. Colleagues would expect nothing less from us.

However, since I will not be the only one "out in the cold" with a switch to OpenGL3, if possible, I'd like there to be one last build of pioneer before we make the move. Preferably a build where #3202 is fixed (which we might suspect it already is?), so that players with old computers can have a somewhat last working version of pioneer which we can refer them to.

If this PR is holding you back, then merge it. I am looking forward to seeing what you will be able to do in the future when running on OpenGL3.x.

Member

impaktor commented Oct 18, 2014

Damn, that's your Intel 950 GPU yeah?

yeah, that's my thinkpad X201

I guess we'll have to start accepting donations towards the impaktor-needs-a-newer-laptop fund on the website ;)

Don't worry too much about it. Me (and my boss) do a lot of procrastinating at work, where I have a modern machine, so that can still run pioneer. I just won't be able to test things out from home. So I'll run pioneer while my boss plays Star Craft (in wine) with open office door and loud volume on. Colleagues would expect nothing less from us.

However, since I will not be the only one "out in the cold" with a switch to OpenGL3, if possible, I'd like there to be one last build of pioneer before we make the move. Preferably a build where #3202 is fixed (which we might suspect it already is?), so that players with old computers can have a somewhat last working version of pioneer which we can refer them to.

If this PR is holding you back, then merge it. I am looking forward to seeing what you will be able to do in the future when running on OpenGL3.x.

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Oct 18, 2014

Contributor

Is that the correct link because it says you have an Intel HD 3000 in that?
#3202 will probably be fixed when @robn updates the build servers MXE environment and I won't be merging it that quickly. It's a big step up.

Contributor

fluffyfreak commented Oct 18, 2014

Is that the correct link because it says you have an Intel HD 3000 in that?
#3202 will probably be fixed when @robn updates the build servers MXE environment and I won't be merging it that quickly. It's a big step up.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Oct 18, 2014

Member

I'm not sure what I have. I do remember the figure "950", which must be from my old x60. Sorry, my bad. I can't imagine that computer even running current pioneer (I've never actually tried).

So what the heck do I have? Are you saying the error is not my (not as old as initially thought) graphics card, but due to the branch? If I read wikipedia correct, an Intel HD 3000 suports OpenGL 3.3?

lspci -vnn | /usr/bin/grep VGA -A15
00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
    Subsystem: Lenovo Device [17aa:215a]
    Flags: bus master, fast devsel, latency 0, IRQ 40
    Memory at f2000000 (64-bit, non-prefetchable) [size=4M]
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 1800 [size=8]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915

and

glxinfo | /usr/bin/grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
OpenGL version string: 2.1 Mesa 10.3.1
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
Member

impaktor commented Oct 18, 2014

I'm not sure what I have. I do remember the figure "950", which must be from my old x60. Sorry, my bad. I can't imagine that computer even running current pioneer (I've never actually tried).

So what the heck do I have? Are you saying the error is not my (not as old as initially thought) graphics card, but due to the branch? If I read wikipedia correct, an Intel HD 3000 suports OpenGL 3.3?

lspci -vnn | /usr/bin/grep VGA -A15
00:02.0 VGA compatible controller [0300]: Intel Corporation Core Processor Integrated Graphics Controller [8086:0046] (rev 02) (prog-if 00 [VGA controller])
    Subsystem: Lenovo Device [17aa:215a]
    Flags: bus master, fast devsel, latency 0, IRQ 40
    Memory at f2000000 (64-bit, non-prefetchable) [size=4M]
    Memory at d0000000 (64-bit, prefetchable) [size=256M]
    I/O ports at 1800 [size=8]
    Expansion ROM at <unassigned> [disabled]
    Capabilities: <access denied>
    Kernel driver in use: i915
    Kernel modules: i915

and

glxinfo | /usr/bin/grep OpenGL
OpenGL vendor string: Intel Open Source Technology Center
OpenGL renderer string: Mesa DRI Intel(R) Ironlake Mobile 
OpenGL version string: 2.1 Mesa 10.3.1
OpenGL shading language version string: 1.20
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 2.0 Mesa 10.3.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 1.0.16
OpenGL ES profile extensions:
@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Oct 19, 2014

Contributor

@impaktor ah ha, IronLake looks like they're DirectX 10 parts but the drivers only go upto OpenGL 2.1 seemingly because they're too busy to update them :/

Let discuss this on the forum anyway and keep this remotely on technical topic.

Contributor

fluffyfreak commented Oct 19, 2014

@impaktor ah ha, IronLake looks like they're DirectX 10 parts but the drivers only go upto OpenGL 2.1 seemingly because they're too busy to update them :/

Let discuss this on the forum anyway and keep this remotely on technical topic.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Oct 27, 2014

Member

On the plus side: This branch does work on my work computer. No issues what I could see.

Member

impaktor commented Oct 27, 2014

On the plus side: This branch does work on my work computer. No issues what I could see.

@fluffyfreak fluffyfreak referenced this pull request Nov 6, 2014

Closed

crash on startup OSX #3241

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Nov 15, 2014

Contributor

Hi @eloquentmess, would you be able to try this out on OSX and compare performance between the existing build and this one?

I have a Mac Mini with an Intel HD 3000 GPU in it which doesn't perform spectacularly in any situation and it would be good for another OSX user to test it. Especially as you do the builds :)

If you need to now anything about how to test it just ask.

Contributor

fluffyfreak commented Nov 15, 2014

Hi @eloquentmess, would you be able to try this out on OSX and compare performance between the existing build and this one?

I have a Mac Mini with an Intel HD 3000 GPU in it which doesn't perform spectacularly in any situation and it would be good for another OSX user to test it. Especially as you do the builds :)

If you need to now anything about how to test it just ask.

@eloquentmess

This comment has been minimized.

Show comment
Hide comment
@eloquentmess

eloquentmess Nov 16, 2014

Sure! I'll need to know how to pull this particular branch so I can rebuild from source and give it a try. I'm still not super versed with Git.

eloquentmess commented Nov 16, 2014

Sure! I'll need to know how to pull this particular branch so I can rebuild from source and give it a try. I'm still not super versed with Git.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Nov 16, 2014

Member
git checkout -b GL33 master
git pull https://github.com/fluffyfreak/pioneer.git GL33
Member

impaktor commented Nov 16, 2014

git checkout -b GL33 master
git pull https://github.com/fluffyfreak/pioneer.git GL33
@eloquentmess

This comment has been minimized.

Show comment
Hide comment
@eloquentmess

eloquentmess Nov 17, 2014

Alright, just ran the program. It started up with no problems. The version reported as 53680cc. Is this the correct version? If so, it looks good (though I haven't tested actual gameplay yet).

eloquentmess commented Nov 17, 2014

Alright, just ran the program. It started up with no problems. The version reported as 53680cc. Is this the correct version? If so, it looks good (though I haven't tested actual gameplay yet).

@eloquentmess

This comment has been minimized.

Show comment
Hide comment
@eloquentmess

eloquentmess Nov 17, 2014

Gameplay seems to be great so far! I'm playing on my highest resolution with the lowest quality settings though since I'm on my Macbook Air. It can play with higher settings, but I like max framerate.

eloquentmess commented Nov 17, 2014

Gameplay seems to be great so far! I'm playing on my highest resolution with the lowest quality settings though since I'm on my Macbook Air. It can play with higher settings, but I like max framerate.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Nov 17, 2014

Member

The version reported as 53680cc. Is this the correct version?

Yes. It's the last (current) commit on this branch.

Member

impaktor commented Nov 17, 2014

The version reported as 53680cc. Is this the correct version?

Yes. It's the last (current) commit on this branch.

@eloquentmess

This comment has been minimized.

Show comment
Hide comment
@eloquentmess

eloquentmess Nov 17, 2014

Everything seems to be working fine. :D

eloquentmess commented Nov 17, 2014

Everything seems to be working fine. :D

fluffyfreak added a commit that referenced this pull request Nov 18, 2014

@fluffyfreak fluffyfreak merged commit 51b4432 into pioneerspacesim:master Nov 18, 2014

1 check passed

continuous-integration/travis-ci The Travis CI build passed
Details

@laarmen laarmen removed the in progress label Nov 18, 2014

@fluffyfreak fluffyfreak deleted the fluffyfreak:GL33 branch Nov 18, 2014

fluffyfreak added a commit that referenced this pull request Nov 18, 2014

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Nov 18, 2014

Contributor

@eloquentmess it might be a good time to try releasing a new OSX build :)

Contributor

fluffyfreak commented Nov 18, 2014

@eloquentmess it might be a good time to try releasing a new OSX build :)

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Nov 18, 2014

Contributor

@impaktor this has been merged so I imagine it's the end for your laptop.

Contributor

fluffyfreak commented Nov 18, 2014

@impaktor this has been merged so I imagine it's the end for your laptop.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Nov 19, 2014

Member

this has been merged so I imagine it's the end for your laptop.

Yep.

Everything seems to be working fine. :D

Does this mean Mac OSX build is back? Or have they been before? I see there's a recent version on the download page, instead of the last known working one from September.

Member

impaktor commented Nov 19, 2014

this has been merged so I imagine it's the end for your laptop.

Yep.

Everything seems to be working fine. :D

Does this mean Mac OSX build is back? Or have they been before? I see there's a recent version on the download page, instead of the last known working one from September.

@impaktor

This comment has been minimized.

Show comment
Hide comment
@impaktor

impaktor Nov 19, 2014

Member

OK, seems like I got my answer by @fluffyfreak here: http://quantum-thoughts.net/?p=1527

Member

impaktor commented Nov 19, 2014

OK, seems like I got my answer by @fluffyfreak here: http://quantum-thoughts.net/?p=1527

@fluffyfreak

This comment has been minimized.

Show comment
Hide comment
@fluffyfreak

fluffyfreak Nov 19, 2014

Contributor

:)

Contributor

fluffyfreak commented Nov 19, 2014

:)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment