]>
git.tdb.fi Git - libs/gl.git/log
Mikko Rasa [Sat, 5 Nov 2016 23:37:55 +0000 (01:37 +0200)]
Detect deprecation versions for extensions
If the core profile is in use, deprecated extensions will be made
unavailable unless the driver explicitly advertises them. In particular,
MSP_legacy_features is made unavailable so code that tries to access
legacy features with a core profile context will throw an exception.
Additionally no enable/disable calls will be generated for textures, as
they are only used for legacy texture units.
Mikko Rasa [Sat, 5 Nov 2016 23:37:11 +0000 (01:37 +0200)]
Add a function to determine the active GL profile
Mikko Rasa [Sat, 5 Nov 2016 23:28:58 +0000 (01:28 +0200)]
Be smarter when detecting the core version of extensions
Mikko Rasa [Sat, 5 Nov 2016 22:20:40 +0000 (00:20 +0200)]
Use an orthographic camera for rendering the shadow map
Mikko Rasa [Sat, 5 Nov 2016 22:10:59 +0000 (00:10 +0200)]
Properly compute frustum culling for orthographic cameras
It's still incorrect for skewed frustums but I'll fix that later.
Mikko Rasa [Sat, 5 Nov 2016 15:12:20 +0000 (17:12 +0200)]
Also convert RenderBuffer formats to sized variants if possible
Mikko Rasa [Thu, 3 Nov 2016 11:12:06 +0000 (13:12 +0200)]
Prefer RG pixelformats over LUMINANCE
LUMINANCE formats were deprecated in OpenGL 3.0. ARB_texture_swizzle
was not promoted to core until 3.3, so it's possible this won't work on
some transition period hardware.
SLUMINANCE formats are marked as deprecated in mspgl since it's not
possible to properly emulate them through swizzling.
Mikko Rasa [Thu, 3 Nov 2016 10:50:35 +0000 (12:50 +0200)]
Expand the PixelFormat conversion API
Get_sized_pixelformat now takes an explicit size parameter. The decision
between 16-bit and 32-bit depth component formats has been moved to
Texture::set_internal_format.
Get_unsized_pixelformat was added as an intermediate step for
get_base_pixelformat. It preserves sRGB information.
Mikko Rasa [Thu, 3 Nov 2016 08:29:08 +0000 (10:29 +0200)]
Fix Texture2D::get_data_size to use get_pixel_size
Mikko Rasa [Thu, 3 Nov 2016 08:27:50 +0000 (10:27 +0200)]
Have get_component_size return zero for unsized formats
Get_pixel_size still assumes a component size of at least one byte.
Mikko Rasa [Thu, 3 Nov 2016 08:08:29 +0000 (10:08 +0200)]
Move internal format management to the Texture base class
Mikko Rasa [Wed, 2 Nov 2016 22:23:08 +0000 (00:23 +0200)]
Use indexed string query to get extensions on OpenGL 3.0 and above
Mikko Rasa [Wed, 2 Nov 2016 20:57:10 +0000 (22:57 +0200)]
Add the ARB_texture_rg extension
Mikko Rasa [Sat, 29 Oct 2016 17:02:10 +0000 (20:02 +0300)]
Add properties to export materials as texture array layers
Mikko Rasa [Fri, 28 Oct 2016 17:03:54 +0000 (20:03 +0300)]
Use ARB_direct_state_access to avoid some bind calls
Mikko Rasa [Fri, 28 Oct 2016 16:34:10 +0000 (19:34 +0300)]
Refactor TextureCube face information functions with lookup tables
Mikko Rasa [Fri, 28 Oct 2016 15:54:39 +0000 (18:54 +0300)]
Refactor Framebuffer::update_attachment for less indentation
Mikko Rasa [Fri, 28 Oct 2016 12:31:47 +0000 (15:31 +0300)]
Use the correct form of glTexParameter to set maximum anisotropy
Mikko Rasa [Fri, 28 Oct 2016 12:21:03 +0000 (15:21 +0300)]
Rearrange texture bind calls to keep them closer to where they're needed
Mikko Rasa [Fri, 28 Oct 2016 11:55:23 +0000 (14:55 +0300)]
Prefer explicit mipmap generation with glGenerateMipmap
Implicit generation with the texture parameter was deprecated in
OpenGL 3.0 and removed in OpenGL 3.2.
Mikko Rasa [Thu, 27 Oct 2016 22:52:13 +0000 (01:52 +0300)]
Use ARB_texture_storage for defining texture storage
Mikko Rasa [Thu, 27 Oct 2016 22:49:59 +0000 (01:49 +0300)]
Add some utility functions for textures
Mikko Rasa [Thu, 27 Oct 2016 22:38:34 +0000 (01:38 +0300)]
Implement sub_image for TextureCube also
I thought it was already implemented but in turned out there was only a
declaration.
Mikko Rasa [Thu, 27 Oct 2016 22:13:02 +0000 (01:13 +0300)]
Prefer sized internal formats when possible
Mikko Rasa [Thu, 27 Oct 2016 22:02:40 +0000 (01:02 +0300)]
Pull in sized depth component formats from ARB_depth_texture
Mikko Rasa [Thu, 27 Oct 2016 08:13:39 +0000 (11:13 +0300)]
Implement 2D array textures
Mikko Rasa [Thu, 27 Oct 2016 08:07:57 +0000 (11:07 +0300)]
Cosmetic tweaks
Mikko Rasa [Thu, 27 Oct 2016 08:01:19 +0000 (11:01 +0300)]
Remove the obsolete storage statement with border
Mikko Rasa [Thu, 27 Oct 2016 07:59:34 +0000 (10:59 +0300)]
Add a datafile statement to use an external image for a texture
It can be useful for non-2D textures which can't be loaded directly from
an image file by the resource collection.
Mikko Rasa [Thu, 27 Oct 2016 07:58:35 +0000 (10:58 +0300)]
Implement sub_image for Texture1D
Mikko Rasa [Thu, 27 Oct 2016 07:48:32 +0000 (10:48 +0300)]
Implement loading functionality for texture classes that were missing it
Mikko Rasa [Thu, 27 Oct 2016 07:06:16 +0000 (10:06 +0300)]
Move srgb handling to storage_pixelformat_from_graphics
Mikko Rasa [Wed, 26 Oct 2016 19:13:38 +0000 (22:13 +0300)]
Use the core version of primitive restart if possible
Mikko Rasa [Wed, 26 Oct 2016 19:02:23 +0000 (22:02 +0300)]
Pick the correct source for an extension function if there's multiple
Mikko Rasa [Wed, 26 Oct 2016 18:48:49 +0000 (21:48 +0300)]
Use correct form of GET_PROC_ADDRESS for unpromoted functions
None compares as less than any list.
Mikko Rasa [Wed, 26 Oct 2016 18:42:38 +0000 (21:42 +0300)]
Use ARB_geometry_shader4 rather than the EXT version
The ARB version is what actually got promoted.
Mikko Rasa [Wed, 26 Oct 2016 18:33:21 +0000 (21:33 +0300)]
Be smarter about detecting backport extensions
Sometimes a more recent and completely unrelated extension reuses some
tokens with their core names, causing them to seem like backport
extensions to the script.
Mikko Rasa [Wed, 26 Oct 2016 17:30:15 +0000 (20:30 +0300)]
Give the LIGHTING and CLIPPING flags a LEGACY prefix
Mikko Rasa [Wed, 26 Oct 2016 17:29:54 +0000 (20:29 +0300)]
Track whether implicit shader data needs to be re-applied
Mikko Rasa [Wed, 26 Oct 2016 15:16:34 +0000 (18:16 +0300)]
Always print shader and program info logs in debug mode
They may contain useful warnings even if the code was accepted.
Mikko Rasa [Wed, 26 Oct 2016 15:11:06 +0000 (18:11 +0300)]
Add uniform integer vectors of 2, 3 and 4 elements
Mikko Rasa [Mon, 24 Oct 2016 20:55:58 +0000 (23:55 +0300)]
Fix Camera::unproject
It was lacking un-perspective division. There's also a Vector3 overload
now.
Mikko Rasa [Sun, 23 Oct 2016 12:35:24 +0000 (15:35 +0300)]
Check glGetString result for being null
Mikko Rasa [Sun, 16 Oct 2016 11:30:51 +0000 (14:30 +0300)]
Add a geometry flag to ProgramBuilder
It does not generate a geometry shader yet but allows one to be manually
inserted into the program.
Mikko Rasa [Sun, 16 Oct 2016 08:16:38 +0000 (11:16 +0300)]
Add basic support for geometry shaders
Mikko Rasa [Fri, 7 Oct 2016 12:38:09 +0000 (15:38 +0300)]
Perform culling in eye space and account for Renderer's matrix
This allows container renderables to apply intermediate transforms to the
Renderer. Sometimes it may be inconvenient to propagate every matrix
change down through the hierarchy.
Mikko Rasa [Fri, 7 Oct 2016 12:37:39 +0000 (15:37 +0300)]
Add a convenience method to get the aspect ratio of View
Mikko Rasa [Fri, 7 Oct 2016 12:37:11 +0000 (15:37 +0300)]
Inherit View from sigc::trackable
It connects to the resize signal of Window.
Mikko Rasa [Tue, 4 Oct 2016 08:34:44 +0000 (11:34 +0300)]
Add new matrix manipulation functions to VertexBuilder
For symmetry with Renderer.
Mikko Rasa [Fri, 16 Sep 2016 23:15:20 +0000 (02:15 +0300)]
Add some accessors to View
Mikko Rasa [Fri, 16 Sep 2016 22:36:54 +0000 (01:36 +0300)]
Fix some #defines for Windows
Mikko Rasa [Fri, 16 Sep 2016 22:35:56 +0000 (01:35 +0300)]
Require libsigc++-2.0 since View connects to a signal
Mikko Rasa [Thu, 15 Sep 2016 21:09:13 +0000 (00:09 +0300)]
Add a new View class to tie up some presentation tasks
Mikko Rasa [Thu, 15 Sep 2016 14:49:15 +0000 (17:49 +0300)]
Don't attempt to create buffers by default if they are not supported
Rendering from client memory is a relic from the past but since the
change is rather trivial might as well support it.
Mikko Rasa [Thu, 15 Sep 2016 14:47:27 +0000 (17:47 +0300)]
Align batches at the index size
Mikko Rasa [Thu, 15 Sep 2016 14:46:10 +0000 (17:46 +0300)]
Add check for more modern AMD video cards
They no longer have "Radeon" as part of the renderer string, at least
with the amdgpu driver.
Mikko Rasa [Mon, 12 Sep 2016 12:08:35 +0000 (15:08 +0300)]
Support loading uniform arrays from data files
Mikko Rasa [Mon, 12 Sep 2016 12:08:10 +0000 (15:08 +0300)]
Add aliases for uniform statements without the type suffix
Mikko Rasa [Sun, 11 Sep 2016 10:36:04 +0000 (13:36 +0300)]
Consistently use the same spelling for diffuse_map and normal_map
It appears that spelling them as two separate words is more correct than
a compound word.
Mikko Rasa [Thu, 1 Sep 2016 13:41:15 +0000 (16:41 +0300)]
Access clipping through the extension mechanism
It's not supported on OpenGL ES.
Mikko Rasa [Fri, 26 Aug 2016 23:29:41 +0000 (02:29 +0300)]
Use RAII to restore the output FBO in Pipeline::render
Mikko Rasa [Fri, 26 Aug 2016 23:29:16 +0000 (02:29 +0300)]
Do not attempt to unwatch a mesh that was already removed
Mikko Rasa [Fri, 26 Aug 2016 23:27:16 +0000 (02:27 +0300)]
Notify watchers of a resource being removed from the manager
Most likely this is a consequence of it being deleted.
Mikko Rasa [Fri, 26 Aug 2016 23:26:11 +0000 (02:26 +0300)]
Fix some uninitialized variables
Mikko Rasa [Mon, 22 Aug 2016 17:19:41 +0000 (20:19 +0300)]
Add integer overload of ProgramData::uniform1_array
Mikko Rasa [Mon, 22 Aug 2016 12:33:42 +0000 (15:33 +0300)]
Support custom functions in ProgramBuilder
Mikko Rasa [Sun, 14 Aug 2016 20:29:49 +0000 (23:29 +0300)]
Add a new API to Pipeline that ties Renderables and passes together
The old API is now deprecated and will eventually go away. There are
two reasons for this change:
1. Pipeline was a sort of pseudo-scene, and in many simple use cases it
was not clear which should be used to hold Renderables. Scenes are
intended as grouping primitives.
2. It was possible to add multiple passes with the same tag and different
rendering state, but there was no way to add a Renderable for only one of
them. This led to tags doubling as a way to filter different passes at
the level of individual Renderables. The intended purpose of tags is to
select between different presentations of a Renderable.
Mikko Rasa [Sun, 14 Aug 2016 15:24:33 +0000 (18:24 +0300)]
Unbind Clipping in Renderer::end
Mikko Rasa [Sun, 14 Aug 2016 08:45:56 +0000 (11:45 +0300)]
Fully unbind Clipping when legacy mode changes
Failing to do so may leave ClipPlanes bound to ClipUnits, leading to
undesirable behaviour later on.
Mikko Rasa [Sat, 13 Aug 2016 15:30:27 +0000 (18:30 +0300)]
Require legacy features when binding plain clip planes
Mikko Rasa [Sat, 13 Aug 2016 15:29:44 +0000 (18:29 +0300)]
Add loader support for clipping in standard shaders
Mikko Rasa [Sat, 13 Aug 2016 15:29:14 +0000 (18:29 +0300)]
Binding fixes for Clipping when mixing legacy and modern mode
Mikko Rasa [Sat, 13 Aug 2016 15:28:47 +0000 (18:28 +0300)]
Implement the previously forgotten Clipping::unbind
Mikko Rasa [Fri, 12 Aug 2016 20:39:33 +0000 (23:39 +0300)]
Some fixes to lighting management
Mikko Rasa [Fri, 12 Aug 2016 20:39:06 +0000 (23:39 +0300)]
Support user clip planes in generated shaders
Mikko Rasa [Fri, 12 Aug 2016 20:38:50 +0000 (23:38 +0300)]
Handle clipping in Pipeline and Renderer
Mikko Rasa [Fri, 12 Aug 2016 20:31:47 +0000 (23:31 +0300)]
Restore user clip planes in a form compatible with modern OpenGL
They work much the same as lights, with the ability to add uniforms to a
ProgramData object.
Mikko Rasa [Tue, 2 Aug 2016 22:26:37 +0000 (01:26 +0300)]
Support rotating the camera frustum
The rotation is applied as the very last step of projection, alllowing
screen rotation to be easily implemented in software.
Mikko Rasa [Thu, 28 Jul 2016 10:49:08 +0000 (13:49 +0300)]
Don't do a potentially expensive mesh update if nothing changed
Mikko Rasa [Wed, 27 Jul 2016 15:58:17 +0000 (18:58 +0300)]
Fix incorrect multiple inclusion guards
Mikko Rasa [Fri, 22 Jul 2016 19:00:48 +0000 (22:00 +0300)]
Use cap height instead of ascent for midline alignment
Mikko Rasa [Fri, 22 Jul 2016 18:59:57 +0000 (21:59 +0300)]
Add cap height and x height metrics to Font
Since FreeType (and consequently ttf2png) doesn't provide these metrics,
they are estimated by the makefont script.
Mikko Rasa [Sat, 23 Jan 2016 02:56:04 +0000 (04:56 +0200)]
Use UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
OpenGL ES doesn't accept DEPTH_COMPONENT together with BYTE types.
Mikko Rasa [Sun, 10 Jan 2016 16:45:06 +0000 (18:45 +0200)]
Adjust OccludedScene to be more compatible with OpenGL ES
GL_SAMPLES_PASSED is not available in OpenGL ES so use occlusion_query2
for GL_ANY_SAMPLES_PASSED. In theory it's possible for an implementation
to support occlusion_query but not the 2 variant; I'll deal with that
case if I ever come across such a combination of hardware and drivers.
Mikko Rasa [Mon, 7 Dec 2015 07:08:05 +0000 (09:08 +0200)]
Rearrange things in ZSortedScene a bit
Mikko Rasa [Mon, 7 Dec 2015 07:04:10 +0000 (09:04 +0200)]
Implement a scene class that performs occlusion culling on renderables
Mikko Rasa [Sun, 6 Dec 2015 13:55:36 +0000 (15:55 +0200)]
Add a class for building icosahedron-based spheres
It doesn't do texture coordinates because there's no straightforward
mapping between a plane and an icosahedral surface.
Mikko Rasa [Fri, 4 Dec 2015 18:43:07 +0000 (20:43 +0200)]
Use a persistent sorted array in ZSortedScene
Typically the order of renderables changes very little between frames, so
it's possible to use insertion sort which is very fast for almost-sorted
arrays.
Mikko Rasa [Fri, 4 Dec 2015 18:41:43 +0000 (20:41 +0200)]
Calculate depths in ZSortedScene more efficiently
Mikko Rasa [Fri, 4 Dec 2015 13:59:10 +0000 (15:59 +0200)]
Immediately add renderables to the cache in SimpleScene::add
Mikko Rasa [Fri, 4 Dec 2015 12:45:31 +0000 (14:45 +0200)]
Cache renderables in SimpleScene into a vector
Set iteration is rather expensive, but I want to retain the O(logn)
performance of add and remove operations.
Mikko Rasa [Fri, 4 Dec 2015 12:54:55 +0000 (14:54 +0200)]
Further tweak frustum culling to be more efficient
Mikko Rasa [Fri, 4 Dec 2015 12:09:48 +0000 (14:09 +0200)]
Remove the culler abstraction and move frustum culling to Scene
It turns out that different culling methods (such as occlusion queries)
have different enough requirements that putting them behind a single
abstraction is not feasible. This also seems to provide a slight
performance boost.
Mikko Rasa [Fri, 4 Dec 2015 12:07:29 +0000 (14:07 +0200)]
Move some common matrix operations to the header so they can be inlined
Mikko Rasa [Fri, 4 Dec 2015 11:11:50 +0000 (13:11 +0200)]
Cache the total data size in ResourceManager
Calculating it again every frame turned out to be a fairly large
performance hit in applications with many different resources.
Mikko Rasa [Fri, 4 Dec 2015 09:36:07 +0000 (11:36 +0200)]
Make ResourceManager thread-safe
Since a big part of the class is loading resources asynchronously, it
makes sense that resources can also be created from another thread.
Mikko Rasa [Sat, 28 Nov 2015 15:27:02 +0000 (17:27 +0200)]
Add an option to use shared meshes when exporting
Mikko Rasa [Sat, 28 Nov 2015 15:26:33 +0000 (17:26 +0200)]
Add missing initializer
Mikko Rasa [Fri, 27 Nov 2015 06:30:52 +0000 (08:30 +0200)]
Decrement size when removing a resource from the loading thread
Mikko Rasa [Wed, 25 Nov 2015 11:53:24 +0000 (13:53 +0200)]
Add geometry builder for sphere