]> git.tdb.fi Git - libs/gl.git/log
libs/gl.git
7 years agoAdd integer overload of ProgramData::uniform1_array
Mikko Rasa [Mon, 22 Aug 2016 17:19:41 +0000 (20:19 +0300)]
Add integer overload of ProgramData::uniform1_array

7 years agoSupport custom functions in ProgramBuilder
Mikko Rasa [Mon, 22 Aug 2016 12:33:42 +0000 (15:33 +0300)]
Support custom functions in ProgramBuilder

7 years agoAdd a new API to Pipeline that ties Renderables and passes together
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.

7 years agoUnbind Clipping in Renderer::end
Mikko Rasa [Sun, 14 Aug 2016 15:24:33 +0000 (18:24 +0300)]
Unbind Clipping in Renderer::end

7 years agoFully unbind Clipping when legacy mode changes
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.

7 years agoRequire legacy features when binding plain clip planes
Mikko Rasa [Sat, 13 Aug 2016 15:30:27 +0000 (18:30 +0300)]
Require legacy features when binding plain clip planes

7 years agoAdd loader support for clipping in standard shaders
Mikko Rasa [Sat, 13 Aug 2016 15:29:44 +0000 (18:29 +0300)]
Add loader support for clipping in standard shaders

7 years agoBinding fixes for Clipping when mixing legacy and modern mode
Mikko Rasa [Sat, 13 Aug 2016 15:29:14 +0000 (18:29 +0300)]
Binding fixes for Clipping when mixing legacy and modern mode

7 years agoImplement the previously forgotten Clipping::unbind
Mikko Rasa [Sat, 13 Aug 2016 15:28:47 +0000 (18:28 +0300)]
Implement the previously forgotten Clipping::unbind

7 years agoSome fixes to lighting management
Mikko Rasa [Fri, 12 Aug 2016 20:39:33 +0000 (23:39 +0300)]
Some fixes to lighting management

7 years agoSupport user clip planes in generated shaders
Mikko Rasa [Fri, 12 Aug 2016 20:39:06 +0000 (23:39 +0300)]
Support user clip planes in generated shaders

7 years agoHandle clipping in Pipeline and Renderer
Mikko Rasa [Fri, 12 Aug 2016 20:38:50 +0000 (23:38 +0300)]
Handle clipping in Pipeline and Renderer

7 years agoRestore user clip planes in a form compatible with modern OpenGL
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.

7 years agoSupport rotating the camera frustum
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.

7 years agoDon't do a potentially expensive mesh update if nothing changed
Mikko Rasa [Thu, 28 Jul 2016 10:49:08 +0000 (13:49 +0300)]
Don't do a potentially expensive mesh update if nothing changed

7 years agoFix incorrect multiple inclusion guards
Mikko Rasa [Wed, 27 Jul 2016 15:58:17 +0000 (18:58 +0300)]
Fix incorrect multiple inclusion guards

7 years agoUse cap height instead of ascent for midline alignment
Mikko Rasa [Fri, 22 Jul 2016 19:00:48 +0000 (22:00 +0300)]
Use cap height instead of ascent for midline alignment

7 years agoAdd cap height and x height metrics to Font
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.

8 years agoUse UNSIGNED_SHORT for allocating DEPTH_COMPONENT textures
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.

8 years agoAdjust OccludedScene to be more compatible with OpenGL ES
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.

8 years agoRearrange things in ZSortedScene a bit
Mikko Rasa [Mon, 7 Dec 2015 07:08:05 +0000 (09:08 +0200)]
Rearrange things in ZSortedScene a bit

8 years agoImplement a scene class that performs occlusion culling on renderables
Mikko Rasa [Mon, 7 Dec 2015 07:04:10 +0000 (09:04 +0200)]
Implement a scene class that performs occlusion culling on renderables

8 years agoAdd a class for building icosahedron-based spheres
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.

8 years agoUse a persistent sorted array in ZSortedScene
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.

8 years agoCalculate depths in ZSortedScene more efficiently
Mikko Rasa [Fri, 4 Dec 2015 18:41:43 +0000 (20:41 +0200)]
Calculate depths in ZSortedScene more efficiently

8 years agoImmediately add renderables to the cache in SimpleScene::add
Mikko Rasa [Fri, 4 Dec 2015 13:59:10 +0000 (15:59 +0200)]
Immediately add renderables to the cache in SimpleScene::add

8 years agoCache renderables in SimpleScene into a vector
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.

8 years agoFurther tweak frustum culling to be more efficient
Mikko Rasa [Fri, 4 Dec 2015 12:54:55 +0000 (14:54 +0200)]
Further tweak frustum culling to be more efficient

8 years agoRemove the culler abstraction and move frustum culling to Scene
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.

8 years agoMove some common matrix operations to the header so they can be inlined
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

8 years agoCache the total data size in ResourceManager
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.

8 years agoMake ResourceManager thread-safe
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.

8 years agoAdd an option to use shared meshes when exporting
Mikko Rasa [Sat, 28 Nov 2015 15:27:02 +0000 (17:27 +0200)]
Add an option to use shared meshes when exporting

8 years agoAdd missing initializer
Mikko Rasa [Sat, 28 Nov 2015 15:26:33 +0000 (17:26 +0200)]
Add missing initializer

8 years agoDecrement size when removing a resource from the loading thread
Mikko Rasa [Fri, 27 Nov 2015 06:30:52 +0000 (08:30 +0200)]
Decrement size when removing a resource from the loading thread

8 years agoAdd geometry builder for sphere
Mikko Rasa [Wed, 25 Nov 2015 11:53:24 +0000 (13:53 +0200)]
Add geometry builder for sphere

8 years agoAllow flagging meshes for winding test in Blender
Mikko Rasa [Mon, 23 Nov 2015 16:18:21 +0000 (18:18 +0200)]
Allow flagging meshes for winding test in Blender

8 years agoMark fog tokens as legacy features
Mikko Rasa [Sun, 22 Nov 2015 09:41:15 +0000 (11:41 +0200)]
Mark fog tokens as legacy features

8 years agoClear manager in destructors of individual resource classes
Mikko Rasa [Wed, 18 Nov 2015 19:04:02 +0000 (21:04 +0200)]
Clear manager in destructors of individual resource classes

If the resource is destroyed while being loaded asynchronously, loading
has to be stopped before the derived class is destroyed.  The Resource
destructor is too late for that.

8 years agoSupport fog in lighting and shaders
Mikko Rasa [Wed, 18 Nov 2015 18:53:43 +0000 (20:53 +0200)]
Support fog in lighting and shaders

8 years agoGive meshes a higher priority when loading
Mikko Rasa [Sat, 14 Nov 2015 22:25:50 +0000 (00:25 +0200)]
Give meshes a higher priority when loading

It's better to load all meshes first so the geometry can be seen.

8 years agoHonor the srgb conversion flag when loading textures asynchronously
Mikko Rasa [Sun, 20 Sep 2015 11:20:48 +0000 (14:20 +0300)]
Honor the srgb conversion flag when loading textures asynchronously

8 years agoPass the resource collection to async loaders
Mikko Rasa [Sun, 20 Sep 2015 11:18:27 +0000 (14:18 +0300)]
Pass the resource collection to async loaders

This way they can access the loading parameters specified in that
collection.

8 years agoAdd option for the range of characters to use from a font
Mikko Rasa [Sun, 20 Sep 2015 11:14:41 +0000 (14:14 +0300)]
Add option for the range of characters to use from a font

8 years agoFix PIL import
Mikko Rasa [Sun, 20 Sep 2015 11:14:29 +0000 (14:14 +0300)]
Fix PIL import

8 years agoThrow a resource_load_error if the source could not be opened
Mikko Rasa [Sat, 5 Sep 2015 20:05:22 +0000 (23:05 +0300)]
Throw a resource_load_error if the source could not be opened

8 years agoAdd a safeguard to resource_used
Mikko Rasa [Sat, 5 Sep 2015 20:04:06 +0000 (23:04 +0300)]
Add a safeguard to resource_used

It's externally accessible and someone might call it with a resource
which is not registered with that manager.

8 years agoMake is_resource_loaded const as it should be
Mikko Rasa [Sat, 5 Sep 2015 20:03:39 +0000 (23:03 +0300)]
Make is_resource_loaded const as it should be

8 years agoMake resource locations externally accessible
Mikko Rasa [Sat, 5 Sep 2015 19:57:58 +0000 (22:57 +0300)]
Make resource locations externally accessible

This makes it easier to load resources e.g. from network on demand.

8 years agoAdd a function to stop a single animation
Mikko Rasa [Sun, 2 Aug 2015 09:58:59 +0000 (12:58 +0300)]
Add a function to stop a single animation

8 years agoAlso set uniforms in tick_stacked
Mikko Rasa [Sat, 1 Aug 2015 19:53:35 +0000 (22:53 +0300)]
Also set uniforms in tick_stacked

8 years agoSupport animation of uniform variables
Mikko Rasa [Fri, 31 Jul 2015 11:21:46 +0000 (14:21 +0300)]
Support animation of uniform variables

8 years agoAdd a missing include
Mikko Rasa [Wed, 29 Jul 2015 21:13:57 +0000 (00:13 +0300)]
Add a missing include

8 years agoProvide a getter for the number of active animations
Mikko Rasa [Wed, 15 Jul 2015 20:38:13 +0000 (23:38 +0300)]
Provide a getter for the number of active animations

8 years agoAdd a class for easier text rendering
Mikko Rasa [Wed, 15 Jul 2015 20:36:54 +0000 (23:36 +0300)]
Add a class for easier text rendering

I've written the equivalent in various applications a few times, so might
as well put it here.

8 years agoExpose texture replacement functionality from Technique
Mikko Rasa [Wed, 15 Jul 2015 20:03:31 +0000 (23:03 +0300)]
Expose texture replacement functionality from Technique

8 years agoEnable chaining of matrix modifiers
Mikko Rasa [Tue, 14 Jul 2015 22:29:28 +0000 (01:29 +0300)]
Enable chaining of matrix modifiers

8 years agoSupport more ttf2png options in makefont.py
Mikko Rasa [Tue, 14 Jul 2015 21:02:35 +0000 (00:02 +0300)]
Support more ttf2png options in makefont.py

Now requires ttf2png 1.1 for the -m and -n options

8 years agoProperly handle compound children with non-identity local matrix
Mikko Rasa [Tue, 14 Jul 2015 21:00:32 +0000 (00:00 +0300)]
Properly handle compound children with non-identity local matrix

9 years agoRaise an exception if attempting to export a mesh with ngons
Mikko Rasa [Fri, 17 Apr 2015 20:44:06 +0000 (23:44 +0300)]
Raise an exception if attempting to export a mesh with ngons

Otherwise there will be a much more confusing errors down the line

9 years agoRevert changes if create_targets throws an exception
Mikko Rasa [Tue, 7 Apr 2015 12:17:28 +0000 (15:17 +0300)]
Revert changes if create_targets throws an exception

9 years agoFix some minor errors in the ambient occlusion shaders
Mikko Rasa [Tue, 7 Apr 2015 12:16:26 +0000 (15:16 +0300)]
Fix some minor errors in the ambient occlusion shaders

9 years agoOnly require ARB_shadow when enabling texture compare mode
Mikko Rasa [Sat, 27 Dec 2014 00:14:19 +0000 (02:14 +0200)]
Only require ARB_shadow when enabling texture compare mode

9 years agoAlias texture lookup functions of all dimensionalities
Mikko Rasa [Sat, 27 Dec 2014 00:13:38 +0000 (02:13 +0200)]
Alias texture lookup functions of all dimensionalities

9 years agoObject's lod array must be initialized in all cases
Mikko Rasa [Sat, 27 Dec 2014 00:12:14 +0000 (02:12 +0200)]
Object's lod array must be initialized in all cases

9 years agoAllow bounding sphere hints for objects and export such from Blender
Mikko Rasa [Wed, 10 Dec 2014 18:34:41 +0000 (20:34 +0200)]
Allow bounding sphere hints for objects and export such from Blender

9 years agoUse explicit mipmap generation if necessary
Mikko Rasa [Wed, 10 Dec 2014 17:39:38 +0000 (19:39 +0200)]
Use explicit mipmap generation if necessary

9 years agoAdd methods to query the state of a resource
Mikko Rasa [Wed, 10 Dec 2014 16:15:24 +0000 (18:15 +0200)]
Add methods to query the state of a resource

9 years agoAdd some accessors
Mikko Rasa [Wed, 10 Dec 2014 16:08:09 +0000 (18:08 +0200)]
Add some accessors

9 years agoSupport defining and exporting object LoDs in Blender
Mikko Rasa [Sun, 7 Dec 2014 23:17:15 +0000 (01:17 +0200)]
Support defining and exporting object LoDs in Blender

9 years agoAllow materials to be overridden when inheriting a technique
Mikko Rasa [Sat, 6 Dec 2014 12:39:12 +0000 (14:39 +0200)]
Allow materials to be overridden when inheriting a technique

9 years agoSupport different techniques per LoD in objects
Mikko Rasa [Sat, 6 Dec 2014 12:38:49 +0000 (14:38 +0200)]
Support different techniques per LoD in objects

9 years agoPass errors from the resource loading thread to the main thread
Mikko Rasa [Wed, 26 Nov 2014 09:24:12 +0000 (11:24 +0200)]
Pass errors from the resource loading thread to the main thread

9 years agoAlways update program uniforms if uniform names have changed
Mikko Rasa [Mon, 17 Nov 2014 16:24:34 +0000 (18:24 +0200)]
Always update program uniforms if uniform names have changed

It's possible for pu.used to be zero, in which case the original code
would never update it.

9 years agoFix orthographic projection matrix calculation
Mikko Rasa [Sun, 16 Nov 2014 18:06:14 +0000 (20:06 +0200)]
Fix orthographic projection matrix calculation

I made some last minute changes for c90cc1f and this got missed.

9 years agoMiscellaneous fixes
Mikko Rasa [Thu, 13 Nov 2014 21:45:32 +0000 (23:45 +0200)]
Miscellaneous fixes

9 years agoAdd a new transform API to Renderer.
Mikko Rasa [Thu, 13 Nov 2014 21:43:05 +0000 (23:43 +0200)]
Add a new transform API to Renderer.

Accessing the matrix stack directly is unsafe as it allows the caller to
push and pop on it independently of Renderer states.

9 years agoAdapt to the new vector/matrix slicing API in mspmath
Mikko Rasa [Thu, 13 Nov 2014 21:22:04 +0000 (23:22 +0200)]
Adapt to the new vector/matrix slicing API in mspmath

9 years agoAdd overloaded setters for 2x2 and 3x3 uniform matrices
Mikko Rasa [Thu, 13 Nov 2014 21:20:08 +0000 (23:20 +0200)]
Add overloaded setters for 2x2 and 3x3 uniform matrices

9 years agoAdd orthographic mode to Camera
Mikko Rasa [Thu, 13 Nov 2014 21:08:14 +0000 (23:08 +0200)]
Add orthographic mode to Camera

9 years agoFix extension functions on Windows
Mikko Rasa [Thu, 13 Nov 2014 18:55:10 +0000 (20:55 +0200)]
Fix extension functions on Windows

They have to be marked with APIENTRY for the correct calling convention.
OpenGL 1.0 and 1.1 functions are not available through wglGetProcAddress,
so link them directly.

9 years agoUse BindRestore for binding index buffer
Mikko Rasa [Wed, 12 Nov 2014 09:04:43 +0000 (11:04 +0200)]
Use BindRestore for binding index buffer

Plain Bind tries to unbind the buffer afterwards, which causes trouble if
the mesh itself is bound.

9 years agoUse triangle strips for creating strings
Mikko Rasa [Wed, 12 Nov 2014 09:00:38 +0000 (11:00 +0200)]
Use triangle strips for creating strings

Quads are not supported by modern OpenGL.

9 years agoMake postprocessor shaders compatible with modern interface
Mikko Rasa [Wed, 12 Nov 2014 00:05:15 +0000 (02:05 +0200)]
Make postprocessor shaders compatible with modern interface

9 years agoPrecision must always be specified for OpenGL ES
Mikko Rasa [Wed, 12 Nov 2014 00:01:25 +0000 (02:01 +0200)]
Precision must always be specified for OpenGL ES

9 years agoImprove legacy mode logic in ProgramBuilder
Mikko Rasa [Wed, 12 Nov 2014 00:01:05 +0000 (02:01 +0200)]
Improve legacy mode logic in ProgramBuilder

9 years agoEliminate conflicts with Windows headers
Mikko Rasa [Tue, 11 Nov 2014 23:49:39 +0000 (01:49 +0200)]
Eliminate conflicts with Windows headers

9 years agoSet the rendered flag before doing anything else
Mikko Rasa [Sat, 1 Nov 2014 00:39:06 +0000 (02:39 +0200)]
Set the rendered flag before doing anything else

Prevents recursion back into ShadowMap::setup_frame from the rendereable.

9 years agoRemove separate element_buffer from Renderer, get it from mesh instead
Mikko Rasa [Sat, 1 Nov 2014 00:26:34 +0000 (02:26 +0200)]
Remove separate element_buffer from Renderer, get it from mesh instead

9 years agoUse the same Renderer to render all faces of EnvironmentMap
Mikko Rasa [Sat, 1 Nov 2014 00:25:49 +0000 (02:25 +0200)]
Use the same Renderer to render all faces of EnvironmentMap

9 years agoAdd begin() method to make Renderer reusable
Mikko Rasa [Sat, 1 Nov 2014 00:20:27 +0000 (02:20 +0200)]
Add begin() method to make Renderer reusable

9 years agoState management improvements in Renderer
Mikko Rasa [Thu, 30 Oct 2014 08:21:18 +0000 (10:21 +0200)]
State management improvements in Renderer

Only update modelview matrix in standard_shdata if it actually changed.

Don't re-apply all shader data unless the program changed.

React to lighting changes caused by pop_state.

9 years agoRoll the various changed flags into a single mask
Mikko Rasa [Thu, 30 Oct 2014 08:19:13 +0000 (10:19 +0200)]
Roll the various changed flags into a single mask

9 years agoMove eye_obj matrices back out of the uniform block
Mikko Rasa [Mon, 27 Oct 2014 20:28:35 +0000 (22:28 +0200)]
Move eye_obj matrices back out of the uniform block

It turns out that updating the buffer for every draw call causes trouble
for drivers, especially OpenGL ES.  Projection matrix typically does not
change during a frame, so it can stay.

9 years agoCopy ProgramData::uniform_slots in copy constructor and operator=
Mikko Rasa [Tue, 21 Oct 2014 06:50:51 +0000 (09:50 +0300)]
Copy ProgramData::uniform_slots in copy constructor and operator=

9 years agoDisallow direct access to uniform array elements
Mikko Rasa [Tue, 21 Oct 2014 06:48:26 +0000 (09:48 +0300)]
Disallow direct access to uniform array elements

ProgramData can't track them correctly, and adding the support would be
too complex.  Uploading the entire array at once is more efficient anyway.

9 years agoClear matrices_loaded flag after resetting matrices
Mikko Rasa [Tue, 21 Oct 2014 06:44:55 +0000 (09:44 +0300)]
Clear matrices_loaded flag after resetting matrices

Fixes an issue where using legacy mode with a Pipeline would case the
matrices to be popped twice.

9 years agoOpenGL ES requires floating-point precision to be declard in shaders
Mikko Rasa [Mon, 20 Oct 2014 17:21:39 +0000 (20:21 +0300)]
OpenGL ES requires floating-point precision to be declard in shaders

9 years agoImprove documentation for a number of classes
Mikko Rasa [Mon, 20 Oct 2014 09:28:59 +0000 (12:28 +0300)]
Improve documentation for a number of classes

9 years agoAdd missing initialization
Mikko Rasa [Mon, 20 Oct 2014 08:59:22 +0000 (11:59 +0300)]
Add missing initialization