]> git.tdb.fi Git - libs/gl.git/log
libs/gl.git
10 years agoMigrate to the new XML-based OpenGL API registry
Mikko Rasa [Wed, 2 Oct 2013 11:36:25 +0000 (14:36 +0300)]
Migrate to the new XML-based OpenGL API registry

10 years agoAlways include glext.h
Mikko Rasa [Wed, 2 Oct 2013 08:20:03 +0000 (11:20 +0300)]
Always include glext.h

There's no real reason to leave it out, and having it in multiple places
causes trouble for the upcoming OS X support.

10 years agoSet read buffer as well as draw buffer for FBO
Mikko Rasa [Wed, 2 Oct 2013 07:56:28 +0000 (10:56 +0300)]
Set read buffer as well as draw buffer for FBO

Apparently Nvidia drivers are too lax with this, but some others don't
like if the FBO has no color attachments and the read buffer is left at
its default setting of COLOR_ATTACHMENT0.

10 years agoMake cube map textures loadable from datafiles
Mikko Rasa [Sat, 21 Sep 2013 17:06:54 +0000 (20:06 +0300)]
Make cube map textures loadable from datafiles

10 years agoSupport off-center frustum in Camera
Mikko Rasa [Sat, 21 Sep 2013 17:06:17 +0000 (20:06 +0300)]
Support off-center frustum in Camera

10 years agoAdd a Scene type that sorts its renderables by depth
Mikko Rasa [Sat, 21 Sep 2013 09:59:22 +0000 (12:59 +0300)]
Add a Scene type that sorts its renderables by depth

10 years agoStereographic rendering moved to a separate library (mspvr)
Mikko Rasa [Fri, 13 Sep 2013 13:27:55 +0000 (16:27 +0300)]
Stereographic rendering moved to a separate library (mspvr)

10 years agoAdd an option to export colors as sRGB
Mikko Rasa [Wed, 11 Sep 2013 09:31:28 +0000 (12:31 +0300)]
Add an option to export colors as sRGB

10 years agoDeal with some irregularities in the Blender exporter
Mikko Rasa [Wed, 11 Sep 2013 09:06:30 +0000 (12:06 +0300)]
Deal with some irregularities in the Blender exporter

Things like loose vertices, non-manifold edges or zero-length edges should
no longer cause crashes.

10 years agoAdd some documentation to the culler system
Mikko Rasa [Wed, 11 Sep 2013 09:03:03 +0000 (12:03 +0300)]
Add some documentation to the culler system

10 years agoRename Culler::setup_frame to setup_pass
Mikko Rasa [Wed, 11 Sep 2013 09:02:11 +0000 (12:02 +0300)]
Rename Culler::setup_frame to setup_pass

It's really called once per pass, so name it accordingly.

10 years agoAdd a frustum culler class
Mikko Rasa [Wed, 11 Sep 2013 08:02:43 +0000 (11:02 +0300)]
Add a frustum culler class

10 years agoAdd an interface for obtaining bounding spheres from renderables
Mikko Rasa [Wed, 11 Sep 2013 07:53:41 +0000 (10:53 +0300)]
Add an interface for obtaining bounding spheres from renderables

This can be used for various forms of culling.

10 years agoAdd interfaces for culling
Mikko Rasa [Mon, 9 Sep 2013 16:06:44 +0000 (19:06 +0300)]
Add interfaces for culling

Culler implementations to come soon.

10 years agoAdd a flag to RenderPass to render the back faces of a mesh
Mikko Rasa [Mon, 9 Sep 2013 16:00:40 +0000 (19:00 +0300)]
Add a flag to RenderPass to render the back faces of a mesh

This is useful for transparency effects.

10 years agoThrow if trying to render an Object without a Technique
Mikko Rasa [Mon, 9 Sep 2013 15:57:21 +0000 (18:57 +0300)]
Throw if trying to render an Object without a Technique

10 years agoMake RenderPass easier to use
Mikko Rasa [Mon, 9 Sep 2013 15:56:15 +0000 (18:56 +0300)]
Make RenderPass easier to use

10 years agoUse Renderer to bind Lighting
Mikko Rasa [Sat, 7 Sep 2013 14:12:15 +0000 (17:12 +0300)]
Use Renderer to bind Lighting

This fixes a problem where the matrix left behind by a pipeline pass could
interfere with the lighting of the next pass.  It's also required for
eventually supporting OpenGL 3.0+ without fixed-function lighting.

10 years agoAdd kerning support to Font
Mikko Rasa [Sat, 7 Sep 2013 14:09:39 +0000 (17:09 +0300)]
Add kerning support to Font

10 years agoMake the font script compatible with new ttf2png output
Mikko Rasa [Thu, 5 Sep 2013 19:22:00 +0000 (22:22 +0300)]
Make the font script compatible with new ttf2png output

10 years agoDo not store generated files in the repository
Mikko Rasa [Tue, 20 Aug 2013 15:27:43 +0000 (18:27 +0300)]
Do not store generated files in the repository

Instead generate them during the build process.  This helps with managing
any changes that might be necessary when porting to new platforms.

10 years agoAdd a StereoCombiner subclass for the Oculus Rift
Mikko Rasa [Tue, 18 Jun 2013 22:11:31 +0000 (01:11 +0300)]
Add a StereoCombiner subclass for the Oculus Rift

10 years agoField of view is an angle too
Mikko Rasa [Tue, 18 Jun 2013 21:30:18 +0000 (00:30 +0300)]
Field of view is an angle too

10 years agoAdd classes for stereographic rendering
Mikko Rasa [Tue, 18 Jun 2013 15:11:20 +0000 (18:11 +0300)]
Add classes for stereographic rendering

10 years agoSome fixes to the Build file
Mikko Rasa [Tue, 18 Jun 2013 14:52:52 +0000 (17:52 +0300)]
Some fixes to the Build file

10 years agoRender final pipeline output into the bound framebuffer
Mikko Rasa [Tue, 18 Jun 2013 14:38:29 +0000 (17:38 +0300)]
Render final pipeline output into the bound framebuffer

10 years agoFunction pointer typedefs for core functions are not available everywhere
Mikko Rasa [Sat, 15 Jun 2013 18:15:22 +0000 (21:15 +0300)]
Function pointer typedefs for core functions are not available everywhere

10 years agoAdd overloads for rotation functions that take axis as three coordinates
Mikko Rasa [Thu, 23 May 2013 20:14:27 +0000 (23:14 +0300)]
Add overloads for rotation functions that take axis as three coordinates

10 years agoUse constructors to augment and reduce vectors
Mikko Rasa [Thu, 23 May 2013 20:13:43 +0000 (23:13 +0300)]
Use constructors to augment and reduce vectors

10 years agoRemove an obsolete #include
Mikko Rasa [Sat, 18 May 2013 21:35:50 +0000 (00:35 +0300)]
Remove an obsolete #include

10 years agoFix event bindings
Mikko Rasa [Sat, 18 May 2013 21:35:33 +0000 (00:35 +0300)]
Fix event bindings

10 years agoUse libmspmath to provide vector and matrix operations
Mikko Rasa [Sat, 18 May 2013 21:27:42 +0000 (00:27 +0300)]
Use libmspmath to provide vector and matrix operations

Pulling them from a math library enables interoperability for programs
where it is desirable for some parts to avoid an OpenGL dependency.  A
full complement of vector operations helps with readable code.

The flag tracking from Matrix was removed as a benchmark showed it to
actually hurt performance with compiler optimizations enabled.

10 years agoAuto smooth angle is stored in radians, not degrees
Mikko Rasa [Fri, 3 May 2013 22:09:18 +0000 (01:09 +0300)]
Auto smooth angle is stored in radians, not degrees

This probably got changed since Blender 2.4, but had gone unnoticed.

11 years agoAdd support for playing multiple stacked animations on an object
Mikko Rasa [Thu, 11 Apr 2013 20:21:50 +0000 (23:21 +0300)]
Add support for playing multiple stacked animations on an object

11 years agoForce some c'tors and d'tors to be emitted in the library
Mikko Rasa [Thu, 11 Apr 2013 19:58:52 +0000 (22:58 +0300)]
Force some c'tors and d'tors to be emitted in the library

Forward declaring class A and having a RefPtr to it in class B causes
trouble if B's constructor or destructor is synthesized at a location
where A's definition is not visible.

11 years agoFix axis interpolation to work with scaling
Mikko Rasa [Thu, 11 Apr 2013 19:34:15 +0000 (22:34 +0300)]
Fix axis interpolation to work with scaling

11 years agoDisable NV_primitive_restart on Radeon cards because it's buggy
Mikko Rasa [Thu, 28 Mar 2013 18:44:21 +0000 (20:44 +0200)]
Disable NV_primitive_restart on Radeon cards because it's buggy

11 years agoFix shaders in the desertpillars demo
Mikko Rasa [Wed, 16 Jan 2013 17:04:20 +0000 (19:04 +0200)]
Fix shaders in the desertpillars demo

11 years agoMake Texture2D::image(Graphics::Image) public
Mikko Rasa [Wed, 16 Jan 2013 16:49:56 +0000 (18:49 +0200)]
Make Texture2D::image(Graphics::Image) public

11 years agoUse IO::Memory to load embedded texture image data
Mikko Rasa [Wed, 16 Jan 2013 16:49:23 +0000 (18:49 +0200)]
Use IO::Memory to load embedded texture image data

11 years agoVerify framebuffer completeness in effect constructors
Mikko Rasa [Sat, 29 Dec 2012 17:51:55 +0000 (19:51 +0200)]
Verify framebuffer completeness in effect constructors

This avoids silent failures due to an unsupported framebuffer
configuration.

11 years agoImprove pipeline render target management
Mikko Rasa [Sat, 29 Dec 2012 15:09:17 +0000 (17:09 +0200)]
Improve pipeline render target management

Recreate render targets if number of samples is changed.

Don't create render targets if neither postprocessing nor multisampling is
active.  HDR is only useful with postprocessors (maybe postprocessors
should be able to request HDR?).

Call fbo.require_complete to allow trial-and-error autodetection of
rendering configuration.

11 years agoAdd a function to require the completeness of a framebuffer
Mikko Rasa [Sat, 29 Dec 2012 12:13:20 +0000 (14:13 +0200)]
Add a function to require the completeness of a framebuffer

11 years agoMove uniform array name adjustment to an earlier phase
Mikko Rasa [Wed, 12 Dec 2012 15:39:26 +0000 (17:39 +0200)]
Move uniform array name adjustment to an earlier phase

Uniforms are looked up by the map key, so it won't do any good if the name
stored in the UniformInfo is adjusted by the map key isn't.

11 years agoRemove deprecated matrix APIs
Mikko Rasa [Fri, 30 Nov 2012 20:29:21 +0000 (22:29 +0200)]
Remove deprecated matrix APIs

11 years agoChange Font::add_glyph to take a glyph struct
Mikko Rasa [Wed, 28 Nov 2012 20:08:16 +0000 (22:08 +0200)]
Change Font::add_glyph to take a glyph struct

Did I seriously think that a function with 10 parameters was a good idea?

11 years agoRemove deprecated Font features
Mikko Rasa [Wed, 28 Nov 2012 19:30:22 +0000 (21:30 +0200)]
Remove deprecated Font features

11 years agoChange font methods to better differentiate between drawing and building
Mikko Rasa [Wed, 28 Nov 2012 18:22:09 +0000 (20:22 +0200)]
Change font methods to better differentiate between drawing and building

11 years agoRe-apply vertex array if it has been modified
Mikko Rasa [Sat, 24 Nov 2012 19:42:19 +0000 (21:42 +0200)]
Re-apply vertex array if it has been modified

11 years agoMore robust handling of uniform arrays
Mikko Rasa [Sat, 17 Nov 2012 22:14:58 +0000 (00:14 +0200)]
More robust handling of uniform arrays

11 years agoFix some warnings about uninitialized variables
Mikko Rasa [Sat, 3 Nov 2012 13:54:33 +0000 (15:54 +0200)]
Fix some warnings about uninitialized variables

In reality they are always initialized when they're used, but the compiler
doesn't necessarily know that.

11 years agoLet Batch decide whether appending is possible
Mikko Rasa [Sat, 3 Nov 2012 13:53:40 +0000 (15:53 +0200)]
Let Batch decide whether appending is possible

11 years agoFix a comparison with restart_index
Mikko Rasa [Sat, 3 Nov 2012 13:35:43 +0000 (15:35 +0200)]
Fix a comparison with restart_index

An incorrect comparison operator caused a batch meeting certain criteria
to unintentionally trigger a primitive restart with its last index instead
of rendering it properly.

11 years agoAdd setup/finish_render hooks to Object
Mikko Rasa [Sat, 3 Nov 2012 13:32:42 +0000 (15:32 +0200)]
Add setup/finish_render hooks to Object

11 years agoImplement assignment operator for ProgramData
Mikko Rasa [Sat, 3 Nov 2012 13:27:45 +0000 (15:27 +0200)]
Implement assignment operator for ProgramData

This is possible now that ProgramData no longer contains any references.

11 years agoUse CLAMP_TO_EDGE on postprocessing textures
Mikko Rasa [Fri, 14 Sep 2012 21:55:32 +0000 (00:55 +0300)]
Use CLAMP_TO_EDGE on postprocessing textures

11 years agoRemove useless GL:: qualifiers
Mikko Rasa [Fri, 14 Sep 2012 21:54:48 +0000 (00:54 +0300)]
Remove useless GL:: qualifiers

AmbientOcclusion was initially developed outside the mspgl tree, and these
were not removed when it was brought in.

11 years agoFix type errors in ColorCurve fragment shader
Mikko Rasa [Thu, 13 Sep 2012 08:36:07 +0000 (11:36 +0300)]
Fix type errors in ColorCurve fragment shader

11 years agoVersion bump; compatibility was lost weeks ago
Mikko Rasa [Wed, 12 Sep 2012 19:12:54 +0000 (22:12 +0300)]
Version bump; compatibility was lost weeks ago

11 years agoA complex demo program to show off features of the engine
Mikko Rasa [Wed, 12 Sep 2012 18:58:34 +0000 (21:58 +0300)]
A complex demo program to show off features of the engine

11 years agoPlug a memory leak
Mikko Rasa [Wed, 12 Sep 2012 18:04:59 +0000 (21:04 +0300)]
Plug a memory leak

11 years agoDon't unbind the fbo until the entire cube map has been rendered
Mikko Rasa [Wed, 12 Sep 2012 17:05:06 +0000 (20:05 +0300)]
Don't unbind the fbo until the entire cube map has been rendered

11 years agoSupport for anisotropic texture filtering
Mikko Rasa [Wed, 12 Sep 2012 07:35:46 +0000 (10:35 +0300)]
Support for anisotropic texture filtering

11 years agoMake it possible to customize texture sampling in standard shaders
Mikko Rasa [Tue, 11 Sep 2012 20:55:25 +0000 (23:55 +0300)]
Make it possible to customize texture sampling in standard shaders

11 years agoDeactivate all arrays when deleting the active VertexArray
Mikko Rasa [Tue, 11 Sep 2012 20:52:13 +0000 (23:52 +0300)]
Deactivate all arrays when deleting the active VertexArray

11 years agoSet all color attachments of a Framebuffer as draw buffers
Mikko Rasa [Tue, 11 Sep 2012 20:29:22 +0000 (23:29 +0300)]
Set all color attachments of a Framebuffer as draw buffers

Indexing gl_FragData selects from the active draw buffers, so this is
required for multiple fragment shader outputs.

11 years agoAdd an EnvironmentMap effect
Mikko Rasa [Mon, 10 Sep 2012 21:35:23 +0000 (00:35 +0300)]
Add an EnvironmentMap effect

11 years agoDon't assume a directional light's position vector to be unit length
Mikko Rasa [Sun, 9 Sep 2012 21:46:22 +0000 (00:46 +0300)]
Don't assume a directional light's position vector to be unit length

11 years agoBring back reflection mapping support to standard shaders
Mikko Rasa [Sun, 9 Sep 2012 21:02:36 +0000 (00:02 +0300)]
Bring back reflection mapping support to standard shaders

11 years agoFix a stupid copy&paste mistake
Mikko Rasa [Sun, 9 Sep 2012 21:00:45 +0000 (00:00 +0300)]
Fix a stupid copy&paste mistake

11 years agoCompatibility fixes
Mikko Rasa [Sat, 8 Sep 2012 15:53:51 +0000 (18:53 +0300)]
Compatibility fixes

Fix a template parameter deduction on 64-bit system

Fix a shader type mismatch

11 years agoUse the frame notifications in ShadowMap
Mikko Rasa [Sat, 8 Sep 2012 15:37:46 +0000 (18:37 +0300)]
Use the frame notifications in ShadowMap

11 years agoNotify Renderables about the start and end of a frame
Mikko Rasa [Sat, 8 Sep 2012 14:16:55 +0000 (17:16 +0300)]
Notify Renderables about the start and end of a frame

This makes it possible for Renderables to do certain things only once per
frame.  This is particularly useful for Effects which need expensive
preparation.

11 years agoFix vertex array offsets
Mikko Rasa [Mon, 3 Sep 2012 19:06:25 +0000 (22:06 +0300)]
Fix vertex array offsets

Since array application order may now be different from the format order,
and VertexArrayBuilder stores components in the latter, calculating the
offsets while applying arrays gives wrong results.

11 years agoAdd a method of getting the model matrix of a Renderable
Mikko Rasa [Mon, 3 Sep 2012 15:58:31 +0000 (18:58 +0300)]
Add a method of getting the model matrix of a Renderable

This can be used for various position-dependent rendering techniques, such
as certain effects and frustum culling.

11 years agoInclude local headers with "", not <>
Mikko Rasa [Mon, 3 Sep 2012 10:24:45 +0000 (13:24 +0300)]
Include local headers with "", not <>

11 years agoRename the matrix reference version of uniform_matrix4 to uniform
Mikko Rasa [Mon, 3 Sep 2012 10:19:13 +0000 (13:19 +0300)]
Rename the matrix reference version of uniform_matrix4 to uniform

This is more in line with the other uniform setters, which don't have any
type suffix when given an argument from which the type is apparent.

11 years agoAdd 3x3 and 2x2 uniform matrices
Mikko Rasa [Mon, 3 Sep 2012 10:18:30 +0000 (13:18 +0300)]
Add 3x3 and 2x2 uniform matrices

11 years agoRenderer no longer needs to track vertex array changes
Mikko Rasa [Mon, 3 Sep 2012 09:14:49 +0000 (12:14 +0300)]
Renderer no longer needs to track vertex array changes

11 years agoRework vertex array application
Mikko Rasa [Mon, 3 Sep 2012 09:04:21 +0000 (12:04 +0300)]
Rework vertex array application

VertexArray now tracks the currently applied array, and works out the
necessary changes as the difference from the previous one.

11 years agoStandard vertex components for tangent and binormal vectors
Mikko Rasa [Sun, 2 Sep 2012 18:11:56 +0000 (21:11 +0300)]
Standard vertex components for tangent and binormal vectors

This simplifies using normalmapped standard shaders, as the shader is
ready to use without the need to declare tangent and binormal attribute
indices.

11 years agoRearrange exporter controls and add the omitted export_uv property
Mikko Rasa [Sun, 2 Sep 2012 17:18:14 +0000 (20:18 +0300)]
Rearrange exporter controls and add the omitted export_uv property

11 years agoLoad VertexFormat for Mesh as an array of VertexComponents
Mikko Rasa [Sun, 2 Sep 2012 17:14:20 +0000 (20:14 +0300)]
Load VertexFormat for Mesh as an array of VertexComponents

The single-token approach made indexed attributes rather ugly.  Loading
each component separately also gives better diagnostics in case of
erroneous tokens.

11 years agoRearrange vertex components
Mikko Rasa [Sun, 2 Sep 2012 14:50:48 +0000 (17:50 +0300)]
Rearrange vertex components

The first 16 component types are now reserved for the library.  This
leaves room for adding standard generic attributes, such as TBN vectors.
To make further room, texcoords were limited to four indices.

Generic attributes are limited to 24.  Current implementations seem to
only support 16 (the minimum allowed by the spec), so this is not a huge
problem.  There's also exactly enough room for another set of 24 generic
integer attributes.

11 years agoAdd a helper function for making indexed vertex components
Mikko Rasa [Sun, 2 Sep 2012 14:32:19 +0000 (17:32 +0300)]
Add a helper function for making indexed vertex components

This puts the logic for checking the allowable index ranges in one place.

The base for an indexed component must now be one with a zero index.  It
didn't make much sense to add an index to an already indexed component.

VertexFormat::offset no longer takes an index, since the helper function
can be used.

11 years agoMemory allocation changes
Mikko Rasa [Sun, 2 Sep 2012 14:30:54 +0000 (17:30 +0300)]
Memory allocation changes

Use std::copy instead of memcpy
Call operator= from copy constructor
Allocate memory only when needed, not one byte before

11 years agoTurn VertexFormat into a class and hide the data member
Mikko Rasa [Sun, 2 Sep 2012 14:29:02 +0000 (17:29 +0300)]
Turn VertexFormat into a class and hide the data member

Outsiders have no need to access it directly

11 years agoHelper functions for extracting vertex component type and size
Mikko Rasa [Sun, 2 Sep 2012 09:16:12 +0000 (12:16 +0300)]
Helper functions for extracting vertex component type and size

Magic numbers are bad.  This makes the code more robust against future
changes.

11 years agoShuffle the members of VertexArray into a sensible order
Mikko Rasa [Thu, 30 Aug 2012 21:45:21 +0000 (00:45 +0300)]
Shuffle the members of VertexArray into a sensible order

11 years agoFix a type mismatch in the standard shader source
Mikko Rasa [Fri, 31 Aug 2012 07:06:54 +0000 (10:06 +0300)]
Fix a type mismatch in the standard shader source

11 years agoOnly call update_offset() once per append operation
Mikko Rasa [Thu, 30 Aug 2012 19:54:34 +0000 (22:54 +0300)]
Only call update_offset() once per append operation

11 years agoFix logic with appending Batches
Mikko Rasa [Thu, 30 Aug 2012 19:48:48 +0000 (22:48 +0300)]
Fix logic with appending Batches

Allow combining Batches of any primitive type with NV_primitive_restart,
and don't use it if not necessary.

11 years agoMake use of Bufferable in Batch
Mikko Rasa [Thu, 30 Aug 2012 19:42:52 +0000 (22:42 +0300)]
Make use of Bufferable in Batch

11 years agoMove Batch members around
Mikko Rasa [Thu, 30 Aug 2012 19:35:55 +0000 (22:35 +0300)]
Move Batch members around

The helper functions for changing data type don't really need to be
members, so put them in a private namespace.  Other functions rearranged
in a more sensible way.

11 years agoShader optimization
Mikko Rasa [Thu, 30 Aug 2012 19:01:55 +0000 (22:01 +0300)]
Shader optimization

ProgramBuilder can now collapse variables with only one reference into the
expression using it.  Fragment color expressions were tuned as well.

11 years agoException fixes
Mikko Rasa [Thu, 30 Aug 2012 08:41:15 +0000 (11:41 +0300)]
Exception fixes

Use out_of_range only when accessing arrays or array-like things, not for
general numeric arguments.

Armature::get_link functions now throw key_error since they behave like
map access externally.

11 years agoImprovements for shadow mapping
Mikko Rasa [Thu, 30 Aug 2012 06:03:39 +0000 (09:03 +0300)]
Improvements for shadow mapping

Depth bias is now configurable, and a darkness parameter was added.

11 years agoEntirely new system for building standard shaders
Mikko Rasa [Wed, 29 Aug 2012 21:48:58 +0000 (00:48 +0300)]
Entirely new system for building standard shaders

The old one was becoming such a huge mess that I had to spend two minutes
doing boolean analysis to figure out the conditions for a multiplication
operator.  The logic parser was also insufficient for expressing
sophisticated relationships between variables.

The new one operates with expression, starting from a target variable and
pulling in others to compute its value.  The logic parser is still there,
buts its burden is greatly reduced, as most of the work is done by the
dependency resolver.

Reflections are missing at the moment, but will be added back soon.  They
were pretty broken in the old system anyway, with the assumption that the
environment map is in eye space.

The generated shader code is rather verbose, containing a lot more local
variables than are needed.  An optimizer will be implemented in the near
future.

11 years agoDon't expose the shader type enum
Mikko Rasa [Tue, 28 Aug 2012 10:34:09 +0000 (13:34 +0300)]
Don't expose the shader type enum

Instead take an object oriented approach.

11 years agoRoute rendering calls through Renderer and add an exclusion system
Mikko Rasa [Tue, 28 Aug 2012 10:18:41 +0000 (13:18 +0300)]
Route rendering calls through Renderer and add an exclusion system

This is necessary for generating environment maps for an object, since
the object itself should not be included in the map.  The alternative is
to create a separate Scene, but that's rather clumsy.