]>
git.tdb.fi Git - libs/gl.git/log
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
Mikko Rasa [Mon, 23 Nov 2015 16:18:21 +0000 (18:18 +0200)]
Allow flagging meshes for winding test in Blender
Mikko Rasa [Sun, 22 Nov 2015 09:41:15 +0000 (11:41 +0200)]
Mark fog tokens as legacy features
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.
Mikko Rasa [Wed, 18 Nov 2015 18:53:43 +0000 (20:53 +0200)]
Support fog in lighting and shaders
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.
Mikko Rasa [Sun, 20 Sep 2015 11:20:48 +0000 (14:20 +0300)]
Honor the srgb conversion flag when loading textures asynchronously
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.
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
Mikko Rasa [Sun, 20 Sep 2015 11:14:29 +0000 (14:14 +0300)]
Fix PIL import
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
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.
Mikko Rasa [Sat, 5 Sep 2015 20:03:39 +0000 (23:03 +0300)]
Make is_resource_loaded const as it should be
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.
Mikko Rasa [Sun, 2 Aug 2015 09:58:59 +0000 (12:58 +0300)]
Add a function to stop a single animation
Mikko Rasa [Sat, 1 Aug 2015 19:53:35 +0000 (22:53 +0300)]
Also set uniforms in tick_stacked
Mikko Rasa [Fri, 31 Jul 2015 11:21:46 +0000 (14:21 +0300)]
Support animation of uniform variables
Mikko Rasa [Wed, 29 Jul 2015 21:13:57 +0000 (00:13 +0300)]
Add a missing include
Mikko Rasa [Wed, 15 Jul 2015 20:38:13 +0000 (23:38 +0300)]
Provide a getter for the number of active animations
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.
Mikko Rasa [Wed, 15 Jul 2015 20:03:31 +0000 (23:03 +0300)]
Expose texture replacement functionality from Technique
Mikko Rasa [Tue, 14 Jul 2015 22:29:28 +0000 (01:29 +0300)]
Enable chaining of matrix modifiers
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
Mikko Rasa [Tue, 14 Jul 2015 21:00:32 +0000 (00:00 +0300)]
Properly handle compound children with non-identity local matrix
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
Mikko Rasa [Tue, 7 Apr 2015 12:17:28 +0000 (15:17 +0300)]
Revert changes if create_targets throws an exception
Mikko Rasa [Tue, 7 Apr 2015 12:16:26 +0000 (15:16 +0300)]
Fix some minor errors in the ambient occlusion shaders
Mikko Rasa [Sat, 27 Dec 2014 00:14:19 +0000 (02:14 +0200)]
Only require ARB_shadow when enabling texture compare mode
Mikko Rasa [Sat, 27 Dec 2014 00:13:38 +0000 (02:13 +0200)]
Alias texture lookup functions of all dimensionalities
Mikko Rasa [Sat, 27 Dec 2014 00:12:14 +0000 (02:12 +0200)]
Object's lod array must be initialized in all cases
Mikko Rasa [Wed, 10 Dec 2014 18:34:41 +0000 (20:34 +0200)]
Allow bounding sphere hints for objects and export such from Blender
Mikko Rasa [Wed, 10 Dec 2014 17:39:38 +0000 (19:39 +0200)]
Use explicit mipmap generation if necessary
Mikko Rasa [Wed, 10 Dec 2014 16:15:24 +0000 (18:15 +0200)]
Add methods to query the state of a resource
Mikko Rasa [Wed, 10 Dec 2014 16:08:09 +0000 (18:08 +0200)]
Add some accessors
Mikko Rasa [Sun, 7 Dec 2014 23:17:15 +0000 (01:17 +0200)]
Support defining and exporting object LoDs in Blender
Mikko Rasa [Sat, 6 Dec 2014 12:39:12 +0000 (14:39 +0200)]
Allow materials to be overridden when inheriting a technique
Mikko Rasa [Sat, 6 Dec 2014 12:38:49 +0000 (14:38 +0200)]
Support different techniques per LoD in objects
Mikko Rasa [Wed, 26 Nov 2014 09:24:12 +0000 (11:24 +0200)]
Pass errors from the resource loading thread to the main thread
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.
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.
Mikko Rasa [Thu, 13 Nov 2014 21:45:32 +0000 (23:45 +0200)]
Miscellaneous fixes
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.
Mikko Rasa [Thu, 13 Nov 2014 21:22:04 +0000 (23:22 +0200)]
Adapt to the new vector/matrix slicing API in mspmath
Mikko Rasa [Thu, 13 Nov 2014 21:20:08 +0000 (23:20 +0200)]
Add overloaded setters for 2x2 and 3x3 uniform matrices
Mikko Rasa [Thu, 13 Nov 2014 21:08:14 +0000 (23:08 +0200)]
Add orthographic mode to Camera
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.
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.
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.
Mikko Rasa [Wed, 12 Nov 2014 00:05:15 +0000 (02:05 +0200)]
Make postprocessor shaders compatible with modern interface
Mikko Rasa [Wed, 12 Nov 2014 00:01:25 +0000 (02:01 +0200)]
Precision must always be specified for OpenGL ES
Mikko Rasa [Wed, 12 Nov 2014 00:01:05 +0000 (02:01 +0200)]
Improve legacy mode logic in ProgramBuilder
Mikko Rasa [Tue, 11 Nov 2014 23:49:39 +0000 (01:49 +0200)]
Eliminate conflicts with Windows headers
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.
Mikko Rasa [Sat, 1 Nov 2014 00:26:34 +0000 (02:26 +0200)]
Remove separate element_buffer from Renderer, get it from mesh instead
Mikko Rasa [Sat, 1 Nov 2014 00:25:49 +0000 (02:25 +0200)]
Use the same Renderer to render all faces of EnvironmentMap
Mikko Rasa [Sat, 1 Nov 2014 00:20:27 +0000 (02:20 +0200)]
Add begin() method to make Renderer reusable
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.
Mikko Rasa [Thu, 30 Oct 2014 08:19:13 +0000 (10:19 +0200)]
Roll the various changed flags into a single mask
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.
Mikko Rasa [Tue, 21 Oct 2014 06:50:51 +0000 (09:50 +0300)]
Copy ProgramData::uniform_slots in copy constructor and operator=
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.
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.
Mikko Rasa [Mon, 20 Oct 2014 17:21:39 +0000 (20:21 +0300)]
OpenGL ES requires floating-point precision to be declard in shaders
Mikko Rasa [Mon, 20 Oct 2014 09:28:59 +0000 (12:28 +0300)]
Improve documentation for a number of classes
Mikko Rasa [Mon, 20 Oct 2014 08:59:22 +0000 (11:59 +0300)]
Add missing initialization
Mikko Rasa [Mon, 20 Oct 2014 08:57:16 +0000 (11:57 +0300)]
Don't crash in bounding sphere generation if an object has a null mesh
Mikko Rasa [Mon, 20 Oct 2014 08:56:10 +0000 (11:56 +0300)]
Prefer glMapBufferRange over glMapBuffer
OpenGL ES does not have glMapBuffer.
Mikko Rasa [Mon, 20 Oct 2014 08:16:55 +0000 (11:16 +0300)]
Emit warnings if an extension can't be fully supported
Mikko Rasa [Sun, 19 Oct 2014 23:33:59 +0000 (02:33 +0300)]
The GLSL texture function returns a float for shadow samplers
In contrast with the legacy shadow2D function, which returned vec4.
Mikko Rasa [Sun, 19 Oct 2014 16:59:36 +0000 (19:59 +0300)]
Deprecate Renderer::escape() and replace it with end()
I never used escape() for much anything, and now it's causing problems on
OpenGL ES by trying to apply state with no shader and consequently set
system matrices. In the future I'll add a corresponding begin() call to
allow persistent Renderers.
Mikko Rasa [Sun, 19 Oct 2014 16:28:24 +0000 (19:28 +0300)]
Legacy shader compatibility fixes for OpenGL ES
Mikko Rasa [Sun, 19 Oct 2014 16:27:26 +0000 (19:27 +0300)]
Use texture() instead of texture2D() in non-legacy mode
Because the name of the diffuse texture uniform was changed to avoid
conflicting with the function, some changes in applications may be
necessary.
Mikko Rasa [Sun, 19 Oct 2014 14:25:56 +0000 (17:25 +0300)]
Don't enable/disable textures on non-legacy units
Mikko Rasa [Fri, 17 Oct 2014 21:14:27 +0000 (00:14 +0300)]
Replace Texturing::Attachment with a simple Texture pointer
No point to have the struct now that TexEnv is gone.
Mikko Rasa [Fri, 17 Oct 2014 20:49:10 +0000 (23:49 +0300)]
Support OpenGL ES on Android
Some features are still likely to be broken, but basic rendering works
at least.
Mikko Rasa [Fri, 17 Oct 2014 20:09:44 +0000 (23:09 +0300)]
Prefer glDrawBuffers over glDrawBuffer
OpenGL ES does not have glDrawBuffer, so this logic change makes porting
a bit easier.
Mikko Rasa [Fri, 17 Oct 2014 19:28:51 +0000 (22:28 +0300)]
Only check against number of light units when binding Lighting
Feeding lights to shaders through ProgramData is not subject to
GL_MAX_LIGHTS, it makes sense to remove that limit from attaching them.
Mikko Rasa [Fri, 17 Oct 2014 18:44:01 +0000 (21:44 +0300)]
Tweak extension behavior on Radeon
Mikko Rasa [Fri, 17 Oct 2014 18:40:28 +0000 (21:40 +0300)]
Don't bind the default object if nothing was bound before
Mikko Rasa [Fri, 17 Oct 2014 18:30:08 +0000 (21:30 +0300)]
Allow applying a VertexArray in non-legacy mode
Mesh::bind now has consistent results whether or not vertex array objects
are available. This is unlikely to be needed on full OpenGL, but is
necessary for OpenGL ES 2.0 support (ES 3.0 has VAOs).
Mikko Rasa [Fri, 17 Oct 2014 11:18:27 +0000 (14:18 +0300)]
Fallback to glDrawElements if EXT_draw_range_elements is unavailable
Mikko Rasa [Fri, 17 Oct 2014 10:36:54 +0000 (13:36 +0300)]
Add facilities to disable extensions and force lower versions
Useful for testing some exotic combinations without actually having to
dig up suitable hardware.
Mikko Rasa [Fri, 17 Oct 2014 08:47:38 +0000 (11:47 +0300)]
Update gl.xml to latest version
Mikko Rasa [Thu, 16 Oct 2014 09:07:57 +0000 (12:07 +0300)]
Initialize camera matrices in constructor
Mikko Rasa [Wed, 15 Oct 2014 21:12:32 +0000 (00:12 +0300)]
Delay loading matrices until they are needed
If all renderables use modern shaders, it's not necessary to touch the
system matrix stacks at all. OpenGL ES 2.0 and OpenGL 3.0 core do not
even have system matrix stacks.
Mikko Rasa [Wed, 15 Oct 2014 16:49:47 +0000 (19:49 +0300)]
Run a tighter ship with extensions
Mikko Rasa [Wed, 15 Oct 2014 16:40:16 +0000 (19:40 +0300)]
Remove a number of rarely used legacy features
ShadowMap will now need shaders to work, but it was already broken in
fixed-function anyway due to using large texture unit numbers. Since
all modern hardware supports shaders, even with free drivers, this is
unlikely to be an issue.
The removed pixel format GL_RED is used in ARB_texture_rg, but we don't
support that extension yet.
Mikko Rasa [Wed, 15 Oct 2014 15:54:16 +0000 (18:54 +0300)]
Enhance the extension generator to support different APIs
Mikko Rasa [Wed, 15 Oct 2014 15:36:31 +0000 (18:36 +0300)]
Refactor and optimize the extension generator script
Overly short variable names have been expanded
parse_file was getting a bit unwieldy and has been split
getElementsByTagName is recursive and slow, replaced with custom function
Mikko Rasa [Tue, 30 Sep 2014 17:14:28 +0000 (20:14 +0300)]
Don't leak AsyncUpdaters if Mesh async loading is aborted
Mikko Rasa [Tue, 30 Sep 2014 17:05:45 +0000 (20:05 +0300)]
Rewrite ResourceManager internals for more scalability
Since loading small resources can often take less than one frame,
especially with vsync enabled, the thread can now handle more than one
resource at once. The code is also somewhat better structured for using
more than one thread in the future.
Mikko Rasa [Mon, 29 Sep 2014 21:07:20 +0000 (00:07 +0300)]
Better handling of unloaded textures
Since it's no longer guaranteed that calling ResourceManager::resource_used
will result in Resource::load being called, it's better to avoid the
binding logic entirely in the unloaded case. In particular, parameters
must not be updated until the GL texture object has been created.
Generating an ID for the texture has been delayed to the last phase of
loading to further differentiate the loaded and unloaded states.
Mikko Rasa [Mon, 29 Sep 2014 20:35:16 +0000 (23:35 +0300)]
Avoid segfaults when LoadingThread's resource is cleared
Mikko Rasa [Mon, 29 Sep 2014 16:40:48 +0000 (19:40 +0300)]
Delay opening the resource file until loading actually starts
Opening it when the load is queued can cause large numbers of open files
to be created at once and dissipate slowly as the queue is processed.
Mikko Rasa [Sun, 28 Sep 2014 18:08:00 +0000 (21:08 +0300)]
Minor fixes
Mikko Rasa [Sun, 28 Sep 2014 18:07:33 +0000 (21:07 +0300)]
Fix TexGen unbinding
Mikko Rasa [Sun, 28 Sep 2014 18:02:28 +0000 (21:02 +0300)]
Exclude EnvironMap effect itself when creating the map
This avoids an unnecessary texture bind/unbind cycle if the EnvironmentMap
is contained within its own environment.
Mikko Rasa [Sun, 28 Sep 2014 17:54:56 +0000 (20:54 +0300)]
Put transform matrices into a uniform block too
I'm fairly certain the glBufferSubData call required to update the block
contents is no slower than the glUniformMatrix* calls to set the uniforms
directly.