]> git.tdb.fi Git - libs/gl.git/log
libs/gl.git
10 years agoPut transform matrices into a uniform block too
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.

10 years agoDon't consider the current buffer in deciding whether to bind BufferRange
Mikko Rasa [Sun, 28 Sep 2014 17:52:17 +0000 (20:52 +0300)]
Don't consider the current buffer in deciding whether to bind BufferRange

glBindBufferRange should only be called if the buffer range bound to that
index was changed.  The buffer binding gets changed as a side-effect, but
should not factor into the decision.

10 years agoRework ProgramData to do less unnecessary work
Mikko Rasa [Sun, 28 Sep 2014 16:58:08 +0000 (19:58 +0300)]
Rework ProgramData to do less unnecessary work

Changes are now tracked per-uniform, allowing more updates to be skipped.
The buffers used in a program are cached, making the no-changes case
faster.

Additionally, Program now creates a UniformBlockInfo struct for the
default uniform.  The program-wide uniform layout hash has been repurposed
to cover the entire program.

10 years agoTighten checks in UniformBlock
Mikko Rasa [Sun, 28 Sep 2014 16:45:01 +0000 (19:45 +0300)]
Tighten checks in UniformBlock

A single UniformBlock can only be a default block or a named block, not
any strange mixture of the two.

10 years agoIntroduce a typedef for uniform layout hashes in Program
Mikko Rasa [Sun, 28 Sep 2014 15:29:30 +0000 (18:29 +0300)]
Introduce a typedef for uniform layout hashes in Program

10 years agoAdjust the desert pillars demo to recent changes
Mikko Rasa [Sat, 27 Sep 2014 15:43:02 +0000 (18:43 +0300)]
Adjust the desert pillars demo to recent changes

Also decrease the cube's shininess from 150 to 120 for compatibility with
older OpenGL versions.

10 years agoMove the reflectivity parameter to material
Mikko Rasa [Sat, 27 Sep 2014 15:42:35 +0000 (18:42 +0300)]
Move the reflectivity parameter to material

Logically it belongs there, even if OpenGL has no fixed-function support
for it.

10 years agoRectify some omissions in ProgramBuilder builtin variables
Mikko Rasa [Sat, 27 Sep 2014 10:46:48 +0000 (13:46 +0300)]
Rectify some omissions in ProgramBuilder builtin variables

10 years agoFix uniform stride assignments
Mikko Rasa [Sat, 27 Sep 2014 10:44:51 +0000 (13:44 +0300)]
Fix uniform stride assignments

10 years agoFix the resource disassociation loop in ~ResourceManager
Mikko Rasa [Fri, 26 Sep 2014 15:01:40 +0000 (18:01 +0300)]
Fix the resource disassociation loop in ~ResourceManager

10 years agoUnbind things if they are deleted while current
Mikko Rasa [Fri, 26 Sep 2014 15:00:18 +0000 (18:00 +0300)]
Unbind things if they are deleted while current

Failing to do so can lead to all sorts of stale-state issues, especially
if a newly created thing happens to get the exact same address as the
just deleted one.

10 years agoUse uniform blocks in generated shaders if supported
Mikko Rasa [Fri, 26 Sep 2014 14:35:51 +0000 (17:35 +0300)]
Use uniform blocks in generated shaders if supported

10 years agoInitialize StandardVariables::skylight
Mikko Rasa [Fri, 26 Sep 2014 10:30:39 +0000 (13:30 +0300)]
Initialize StandardVariables::skylight

10 years agoEmit separate declarations for struct types
Mikko Rasa [Fri, 26 Sep 2014 10:19:53 +0000 (13:19 +0300)]
Emit separate declarations for struct types

I'm going to add uniform block support shortly and structs can't be
declared inside blocks.

10 years agoDeal with hash collisions in assigning uniform block bind points
Mikko Rasa [Fri, 26 Sep 2014 10:06:52 +0000 (13:06 +0300)]
Deal with hash collisions in assigning uniform block bind points

10 years agoImprove bounding sphere handling in Object
Mikko Rasa [Wed, 24 Sep 2014 17:36:33 +0000 (20:36 +0300)]
Improve bounding sphere handling in Object

10 years agoUpdate Object's bounding sphere when mesh is loaded
Mikko Rasa [Wed, 24 Sep 2014 17:34:24 +0000 (20:34 +0300)]
Update Object's bounding sphere when mesh is loaded

10 years agoAdd a ResourceWatcher interface
Mikko Rasa [Wed, 24 Sep 2014 12:49:41 +0000 (15:49 +0300)]
Add a ResourceWatcher interface

10 years agoEnable asynchronous loading of Meshes
Mikko Rasa [Tue, 23 Sep 2014 21:08:21 +0000 (00:08 +0300)]
Enable asynchronous loading of Meshes

This currently causes object bounding spheres to be incorrect when using
managed meshes.  The situation will be rectified shortly.

10 years agoAdd an asynchronous update interface to Bufferable
Mikko Rasa [Tue, 23 Sep 2014 20:23:14 +0000 (23:23 +0300)]
Add an asynchronous update interface to Bufferable

10 years agoRefactor the internal interface of Bufferable a bit
Mikko Rasa [Tue, 23 Sep 2014 17:11:16 +0000 (20:11 +0300)]
Refactor the internal interface of Bufferable a bit

10 years agoMiscellaneous fixes to ResourceManager
Mikko Rasa [Thu, 18 Sep 2014 17:42:20 +0000 (20:42 +0300)]
Miscellaneous fixes to ResourceManager

10 years agoSome fixes to VAO management
Mikko Rasa [Tue, 16 Sep 2014 07:31:36 +0000 (10:31 +0300)]
Some fixes to VAO management

10 years agoMinor adjustments
Mikko Rasa [Mon, 15 Sep 2014 10:35:11 +0000 (13:35 +0300)]
Minor adjustments

10 years agoAdd a hidden option to disable progress meter
Mikko Rasa [Mon, 15 Sep 2014 10:34:21 +0000 (13:34 +0300)]
Add a hidden option to disable progress meter

Intended for scripts that call the MSP export operators multiple times.

10 years agoAdd an object property for inheriting the specified technique
Mikko Rasa [Mon, 15 Sep 2014 10:23:11 +0000 (13:23 +0300)]
Add an object property for inheriting the specified technique

This allows using object-specific textures while still sharing material
and shaders.

10 years agoUse image path as texture identifier if available
Mikko Rasa [Mon, 15 Sep 2014 09:43:28 +0000 (12:43 +0300)]
Use image path as texture identifier if available

This is more likely to be correct in common resource loading setups.

10 years agoTake material diffuse intensity into account
Mikko Rasa [Mon, 15 Sep 2014 08:24:46 +0000 (11:24 +0300)]
Take material diffuse intensity into account

10 years agoDisplay overall progress when exporting scenes
Mikko Rasa [Mon, 15 Sep 2014 08:24:11 +0000 (11:24 +0300)]
Display overall progress when exporting scenes

10 years agoImplement automatic unloading when a total size limit is exceeded
Mikko Rasa [Mon, 8 Sep 2014 20:50:35 +0000 (23:50 +0300)]
Implement automatic unloading when a total size limit is exceeded

10 years agoImplement automatic resource unloading based on age
Mikko Rasa [Mon, 8 Sep 2014 18:28:22 +0000 (21:28 +0300)]
Implement automatic resource unloading based on age

10 years agoSet dirty_params when unloading textures
Mikko Rasa [Mon, 8 Sep 2014 17:06:37 +0000 (20:06 +0300)]
Set dirty_params when unloading textures

This ensures that things like MIN_FILTER get set correctly when it is
reloaded.

10 years agoImplement manual loading policy and async flag
Mikko Rasa [Sun, 7 Sep 2014 17:16:36 +0000 (20:16 +0300)]
Implement manual loading policy and async flag

10 years agoThrow an exception if Resource::load did not create an AsyncLoader
Mikko Rasa [Sat, 30 Aug 2014 22:38:35 +0000 (01:38 +0300)]
Throw an exception if Resource::load did not create an AsyncLoader

This is only a safeguard against programming errors and should never be
hit in normal use.

10 years agoDissolve the association to resources when ResourceManager is destroyed
Mikko Rasa [Sat, 30 Aug 2014 22:37:36 +0000 (01:37 +0300)]
Dissolve the association to resources when ResourceManager is destroyed

10 years agoEnable resource management on Texture2D
Mikko Rasa [Sat, 23 Aug 2014 16:12:48 +0000 (19:12 +0300)]
Enable resource management on Texture2D

10 years agoFoundation for a resource management system
Mikko Rasa [Sun, 17 Aug 2014 19:07:50 +0000 (22:07 +0300)]
Foundation for a resource management system

10 years agoAdd memory-mapping functions for Buffer
Mikko Rasa [Sun, 17 Aug 2014 15:23:30 +0000 (18:23 +0300)]
Add memory-mapping functions for Buffer

10 years agoMake the viewer capable of viewing scenes
Mikko Rasa [Sun, 17 Aug 2014 14:44:10 +0000 (17:44 +0300)]
Make the viewer capable of viewing scenes

10 years agoAdd a Loader for Scene, and a matching Blender exporter
Mikko Rasa [Sun, 17 Aug 2014 14:43:41 +0000 (17:43 +0300)]
Add a Loader for Scene, and a matching Blender exporter

10 years agoSet MeshExporter default values to match those in the operator
Mikko Rasa [Sat, 16 Aug 2014 22:46:27 +0000 (01:46 +0300)]
Set MeshExporter default values to match those in the operator

10 years agoFix line exporting
Mikko Rasa [Sat, 16 Aug 2014 22:45:54 +0000 (01:45 +0300)]
Fix line exporting

10 years agoUse a renderer in the viewer
Mikko Rasa [Sat, 16 Aug 2014 09:53:37 +0000 (12:53 +0300)]
Use a renderer in the viewer

Some renderables using more sophisticated features won't even render
properly without one.

10 years agoRework loading in viewer
Mikko Rasa [Sat, 16 Aug 2014 09:39:16 +0000 (12:39 +0300)]
Rework loading in viewer

It can now load external resources, and adding new types of renderables
in the future is easier.

10 years agoSupport hemispherical skylight in ProgramBuilder
Mikko Rasa [Sun, 13 Jul 2014 13:10:59 +0000 (16:10 +0300)]
Support hemispherical skylight in ProgramBuilder

OpenGL's fixed-function pipeline does not have any similar feature, so
this can't be supported without shaders.

10 years agoMove extension requirements from ProgramData to UniformBlock
Mikko Rasa [Mon, 16 Jun 2014 21:02:03 +0000 (00:02 +0300)]
Move extension requirements from ProgramData to UniformBlock

ProgramData no longer manipulates GL directly, and it's used in places
like Renderer and Material.  This changes allows those things to be used
without shader support.

10 years agoMake older gcc versions happy
Mikko Rasa [Mon, 16 Jun 2014 20:08:26 +0000 (23:08 +0300)]
Make older gcc versions happy

10 years agoUse GL_VERSION_x_y to guard the enums for promoted extensions
Mikko Rasa [Mon, 16 Jun 2014 20:06:01 +0000 (23:06 +0300)]
Use GL_VERSION_x_y to guard the enums for promoted extensions

The core names for enums are used in headers, and older systems might
have the extension present but too old core version.

10 years agoRearrange ProgramBuilder's standard variables
Mikko Rasa [Tue, 20 May 2014 22:09:49 +0000 (01:09 +0300)]
Rearrange ProgramBuilder's standard variables

The rgb_light_foo names were getting a bit stupid, and the hierarchy also
makes more sense this way.  The use of gl_FrontLightProduct was dropped
as too cumbersome to maintain.  The future is with modern shaders anyway.

Texture now only affects ambient and diffuse colors, not specular.  There
will likely be support for a separate specular map in the future.

10 years agoTexUnit's constructor shouldn't be public
Mikko Rasa [Fri, 16 May 2014 18:39:46 +0000 (21:39 +0300)]
TexUnit's constructor shouldn't be public

10 years agoImprove interface documentation a bit
Mikko Rasa [Fri, 16 May 2014 18:35:30 +0000 (21:35 +0300)]
Improve interface documentation a bit

10 years agoAdd support for array and multiple lights in generated shaders
Mikko Rasa [Fri, 16 May 2014 17:17:32 +0000 (20:17 +0300)]
Add support for array and multiple lights in generated shaders

10 years agoGeneralize shader interface handling
Mikko Rasa [Thu, 15 May 2014 21:59:26 +0000 (00:59 +0300)]
Generalize shader interface handling

10 years agoRefactor certain variable operations into functions
Mikko Rasa [Thu, 15 May 2014 09:00:01 +0000 (12:00 +0300)]
Refactor certain variable operations into functions

10 years agoInline variables which are simple aliases, even if not optimizing
Mikko Rasa [Tue, 13 May 2014 16:43:31 +0000 (19:43 +0300)]
Inline variables which are simple aliases, even if not optimizing

This fixes another problem with unoptimized legacy shaders, making them
work properly again.

10 years agoTweak goal variable handling in ProgramBuilder
Mikko Rasa [Tue, 13 May 2014 09:21:28 +0000 (12:21 +0300)]
Tweak goal variable handling in ProgramBuilder

All variables now have types, and goal variables are recognized by the
lack of references to them.  This solves a problem where non-optimized
legacy shaders would emit an assignment to frag_color without declaring
it first.

10 years agoPass the sRGB flag when loading a Texture2D from an image file
Mikko Rasa [Thu, 8 May 2014 18:00:26 +0000 (21:00 +0300)]
Pass the sRGB flag when loading a Texture2D from an image file

10 years agoDon't store ProgramData in Lighting
Mikko Rasa [Thu, 8 May 2014 17:55:53 +0000 (20:55 +0300)]
Don't store ProgramData in Lighting

It can't be kept up to date automatically, as Lighting can't track the
individual Lights' state.  It's also hard to make optimize out unnecessary
updates.  It's typically computed very few times per frame anyway, so the
performance hit is negligible (as opposed to something like Material,
which might get used hundreds or thousands of times per frame).

10 years agoMinor tweaks to the Blender exporter
Mikko Rasa [Tue, 6 May 2014 21:17:26 +0000 (00:17 +0300)]
Minor tweaks to the Blender exporter

10 years agoFix exporting meshes without UV coordinates
Mikko Rasa [Tue, 6 May 2014 21:13:35 +0000 (00:13 +0300)]
Fix exporting meshes without UV coordinates

10 years agoMore options for exporting techniques
Mikko Rasa [Tue, 6 May 2014 21:02:39 +0000 (00:02 +0300)]
More options for exporting techniques

10 years agoAdd an object property to control compound exporting
Mikko Rasa [Tue, 6 May 2014 20:43:22 +0000 (23:43 +0300)]
Add an object property to control compound exporting

10 years agoAdd an option to export a separate mesh file when exporting an object
Mikko Rasa [Mon, 5 May 2014 19:58:13 +0000 (22:58 +0300)]
Add an option to export a separate mesh file when exporting an object

10 years agoRestore the progress bar in the exporter
Mikko Rasa [Mon, 5 May 2014 19:27:50 +0000 (22:27 +0300)]
Restore the progress bar in the exporter

10 years agoSome fixes to UV coordinate exporting
Mikko Rasa [Mon, 5 May 2014 19:27:07 +0000 (22:27 +0300)]
Some fixes to UV coordinate exporting

10 years agoRefactor object exporter to a separate class
Mikko Rasa [Mon, 5 May 2014 18:49:57 +0000 (21:49 +0300)]
Refactor object exporter to a separate class

10 years agoSupport linear to sRGB conversion when loading materials and textures
Mikko Rasa [Tue, 29 Apr 2014 05:28:27 +0000 (08:28 +0300)]
Support linear to sRGB conversion when loading materials and textures

10 years agoUse make_tex's wrap parameter in makefont.py
Mikko Rasa [Mon, 21 Apr 2014 07:40:17 +0000 (10:40 +0300)]
Use make_tex's wrap parameter in makefont.py

10 years agoMove sRGB formulas to color.h
Mikko Rasa [Mon, 21 Apr 2014 07:36:17 +0000 (10:36 +0300)]
Move sRGB formulas to color.h

10 years agoAdd a resource collection class
Mikko Rasa [Sun, 20 Apr 2014 09:44:05 +0000 (12:44 +0300)]
Add a resource collection class

It's annoying to have to implement the same collection everywhere,
especially loading textures from image files.

10 years agoAdd viewport support to Framebuffer
Mikko Rasa [Sun, 12 Jan 2014 12:14:31 +0000 (14:14 +0200)]
Add viewport support to Framebuffer

10 years agoInitialize slot even when unused to silence optimizer warnings
Mikko Rasa [Sun, 12 Jan 2014 12:11:59 +0000 (14:11 +0200)]
Initialize slot even when unused to silence optimizer warnings

10 years agoTweak some ProgramBuilder variables
Mikko Rasa [Sun, 5 Jan 2014 11:50:54 +0000 (13:50 +0200)]
Tweak some ProgramBuilder variables

10 years agoSupport sRGB pixelformats through GL_EXT_texture_sRGB
Mikko Rasa [Sun, 5 Jan 2014 11:47:10 +0000 (13:47 +0200)]
Support sRGB pixelformats through GL_EXT_texture_sRGB

10 years agoFix component handling error in Color
Mikko Rasa [Sun, 5 Jan 2014 11:46:14 +0000 (13:46 +0200)]
Fix component handling error in Color

10 years agoUse base pixelformat when loading texture data
Mikko Rasa [Sun, 5 Jan 2014 10:51:29 +0000 (12:51 +0200)]
Use base pixelformat when loading texture data

10 years agoAdd gamma correction and sRGB conversion support to ColorCurve
Mikko Rasa [Sat, 28 Dec 2013 15:14:07 +0000 (17:14 +0200)]
Add gamma correction and sRGB conversion support to ColorCurve

10 years agoAdd basic support for 1D textures
Mikko Rasa [Sat, 28 Dec 2013 15:10:36 +0000 (17:10 +0200)]
Add basic support for 1D textures

10 years agoConvert desertpillars to use the new shader customization
Mikko Rasa [Mon, 23 Dec 2013 16:22:19 +0000 (18:22 +0200)]
Convert desertpillars to use the new shader customization

10 years agoMore flexible system for customizing generated shaders
Mikko Rasa [Mon, 23 Dec 2013 16:14:13 +0000 (18:14 +0200)]
More flexible system for customizing generated shaders

Any standard variable can now be overridden, and new ones added.  It's
still somewhat fragile concerning variable ordering and some other things,
but it works when used correctly.

10 years agoSimplify VAO setup code
Mikko Rasa [Sun, 22 Dec 2013 00:15:06 +0000 (02:15 +0200)]
Simplify VAO setup code

Previously buffer binding semantics caused complications, as index buffer
was unbound while a mesh was bound so batches couldn't be updated.  Now
that buffers behave better with bounds meshes, batches can take care of
themselves again.

Triggering the setup from bind() instead of draw() gets rid of another
bunch of complications, since it will only be called when the VAO is going
to be actually used.

10 years agoAvoid segfault for trying to refresh a Mesh with no buffers
Mikko Rasa [Sat, 21 Dec 2013 16:58:31 +0000 (18:58 +0200)]
Avoid segfault for trying to refresh a Mesh with no buffers

10 years agoThrow an exception if trying to draw a Mesh with a different Mesh bound
Mikko Rasa [Sat, 21 Dec 2013 16:57:41 +0000 (18:57 +0200)]
Throw an exception if trying to draw a Mesh with a different Mesh bound

10 years agoEnforce unbinding as well as binding buffers
Mikko Rasa [Sat, 21 Dec 2013 16:51:47 +0000 (18:51 +0200)]
Enforce unbinding as well as binding buffers

10 years agoPresent Mesh's index buffer as current while the Mesh is bound
Mikko Rasa [Sat, 21 Dec 2013 11:30:02 +0000 (13:30 +0200)]
Present Mesh's index buffer as current while the Mesh is bound

This simplifies the internal update operations.

10 years agoUse RAII binders in place of manual binding
Mikko Rasa [Sat, 21 Dec 2013 11:20:21 +0000 (13:20 +0200)]
Use RAII binders in place of manual binding

10 years agoBufferAlias is now obsolete
Mikko Rasa [Sat, 21 Dec 2013 09:59:28 +0000 (11:59 +0200)]
BufferAlias is now obsolete

10 years agoAdd support for multiple binding points in the RAII binders
Mikko Rasa [Sat, 21 Dec 2013 09:58:57 +0000 (11:58 +0200)]
Add support for multiple binding points in the RAII binders

10 years agoRewrite Bind as two different classes
Mikko Rasa [Sat, 21 Dec 2013 09:36:40 +0000 (11:36 +0200)]
Rewrite Bind as two different classes

Boolean flag parameters are not too clear without seeing the declaration.
This new implementation also doesn't use dynamic allocation.

10 years agoMake desertpillars compatible with the modernization changes
Mikko Rasa [Sat, 21 Dec 2013 09:17:17 +0000 (11:17 +0200)]
Make desertpillars compatible with the modernization changes

10 years agoEscape from the renderer before applying postprocessors
Mikko Rasa [Thu, 19 Dec 2013 21:15:36 +0000 (23:15 +0200)]
Escape from the renderer before applying postprocessors

10 years agoAutomatically determine texture units for effects
Mikko Rasa [Thu, 19 Dec 2013 21:10:15 +0000 (23:10 +0200)]
Automatically determine texture units for effects

At the moment this breaks such effects in fixed-function mode on platforms
that support shader-only texture units.  Will devise a fix later.

10 years agoAdd missing initializer
Mikko Rasa [Thu, 19 Dec 2013 21:03:49 +0000 (23:03 +0200)]
Add missing initializer

10 years agoAdd an overload of bind_attribute that takes a VertexComponent
Mikko Rasa [Thu, 19 Dec 2013 20:40:52 +0000 (22:40 +0200)]
Add an overload of bind_attribute that takes a VertexComponent

10 years agoAdd missing #include
Mikko Rasa [Tue, 17 Dec 2013 20:13:32 +0000 (22:13 +0200)]
Add missing #include

10 years agoAdd shd_eye_matrix to ShadowMap's shdata
Mikko Rasa [Mon, 16 Dec 2013 20:25:49 +0000 (22:25 +0200)]
Add shd_eye_matrix to ShadowMap's shdata

10 years agoUse vector and matrix operations in ShadowMap
Mikko Rasa [Mon, 16 Dec 2013 20:24:55 +0000 (22:24 +0200)]
Use vector and matrix operations in ShadowMap

10 years agoIntegrate modern shaders and VAOs with Renderer
Mikko Rasa [Sun, 15 Dec 2013 23:26:55 +0000 (01:26 +0200)]
Integrate modern shaders and VAOs with Renderer

10 years agoThe Scope enum has no need to be public
Mikko Rasa [Sun, 15 Dec 2013 23:23:50 +0000 (01:23 +0200)]
The Scope enum has no need to be public

10 years agoSupport generating modern, GLSL 1.30+ shaders with ProgramBuilder
Mikko Rasa [Sun, 15 Dec 2013 23:22:54 +0000 (01:22 +0200)]
Support generating modern, GLSL 1.30+ shaders with ProgramBuilder