LWJGL Forum

Programming => Lightweight Java Gaming Library => Topic started by: spasi on March 25, 2009, 17:51:53

Title: OpenGL 3.1 support and new extensions
Post by: spasi on March 25, 2009, 17:51:53
Hi all,

Support for OpenGL 3.1 has just been added to LWJGL, together with a bunch of new extensions. I haven't been able to find the values for 2 tokens (COPY_READ_BUFFER and COPY_WRITE_BUFFER), but this should be resolved soon.

Features added/promoted to 3.1 core:

- Signed Normalized Textures
- ARB_draw_instanced
- EXT_copy_buffer (the spec for this is currently missing)
- NV_primitive_restart
- ARB_texture_buffer_object
- ARB_texture_rectangle
- ARB_uniform_buffer_object

New extensions supported:

- AMD_performance_monitor
- AMD_texture_texture4
- AMD_vertex_shader_tesselator
- ARB_compatibility
- ARB_uniform_buffer_object
- ATI_meminfo
- EXT_provoking_vertex
- EXT_texture_swizzle
- EXT_vertex_array_bgra
- NV_explicit_multisample
- NV_transform_feedback2
Title: Re: OpenGL 3.1 support and new extensions
Post by: Matzon on March 25, 2009, 19:59:28
Quick! as usual!

However, we should probably think about disabling some things, when you activate the OGL 3.1 path - as per specs:
"Unlike earlier versions of OpenGL, OpenGL 3.1 is not upward compatible with earlier versions. The commands and interfaces identified as deprecated in OpenGL 3.0 (see appendix F) have been removed from OpenGL 3.1 entirely,"
Title: Re: OpenGL 3.1 support and new extensions
Post by: elias on March 25, 2009, 20:30:34
...unless ARB_compatibility is supported
Title: Re: OpenGL 3.1 support and new extensions
Post by: spasi on March 25, 2009, 20:35:15
Disabling deprecated functionality is already supported with the forward compatible mode. I'll try and see what changes we need to handle this elegantly. There's the issue with LineWidth too, which has been un-deprecated. :)
Title: Re: OpenGL 3.1 support and new extensions
Post by: elias4444 on March 26, 2009, 03:30:22
Where do you find out what's been deprecated (and un-deprecated) anyway? I'm desperately trying to keep up these days, but am having a hard time finding good information.
Title: Re: OpenGL 3.1 support and new extensions
Post by: spasi on March 26, 2009, 08:35:24
This (http://www.opengl.org/registry/doc/glspec31undep.20090324.pdf) version of the OpenGL specification has all deprecated features highlighted. There's also a nice summary in Appendix E.
Title: Re: OpenGL 3.1 support and new extensions
Post by: spasi on March 26, 2009, 11:21:16
OK, I've committed another change. If OpenGL version is 3.1 or higher and ARB_compatibility isn't supported, the forward compatible mode will be forced, which means LWJGL won't try to load deprecated function addresses and a runtime exception will be thrown if they are called. The user still has the option to enable forward compatible mode, even when the driver exposes everything.

I've also added the new context creation stuff in the linux implementation. I didn't implement the actual calls though, I don't really feel comfortable in that code without a compiler. Is it possible for Elias to pick that up? The extension is GLX_ARB_create_context (http://www.opengl.org/registry/specs/ARB/glx_create_context.txt), the new context creation function is glXCreateContextAttribsARB. It requires GLX 1.4 (http://www.opengl.org/documentation/specs/glx/glx1.4.pdf), not sure if that's important (I've added it in the version detection code anyway).
Title: Re: OpenGL 3.1 support and new extensions
Post by: spasi on March 27, 2009, 12:59:38
OK, ARB_copy_buffer (http://www.opengl.org/registry/specs/ARB/copy_buffer.txt) was released and it's in LWJGL now.
Title: Re: OpenGL 3.1 support and new extensions
Post by: elias on March 27, 2009, 16:54:56
I can probably do the ogl 3 changes for linux, but I'm too busy at the moment. Maybe I'll have the time when ubuntu 9.04 is out, hopefully with ogl 3 nvidia drivers.

- elias
Title: Re: OpenGL 3.1 support and new extensions
Post by: elias on April 04, 2009, 06:10:48
In the meantime, is it possible to add a basic gl3/gl3.1 test to the lwjgl svn for me to work from?

- elias
Title: Re: OpenGL 3.1 support and new extensions
Post by: spasi on April 04, 2009, 19:23:22
Done. Run with VersionTest <majorVersion> <minorVersion>. Also supports 3 more optional arguments, "debug" for enabling debug mode in a 3.x context, "fc" for enabling forward compatibility mode and for setting the layer plane.

e.g. VersionTest 3 1 0 debug fc - will create a 3.1 context at layer 0, with debug and forward compatible mode on.

Title: Re: OpenGL 3.1 support and new extensions
Post by: elias on April 24, 2009, 20:31:21
Linux support for the new context creation method is comitted.

- elias