Mikko Rasa [Wed, 27 Nov 2013 21:23:33 +0000 (23:23 +0200)]
Always bind textures in a specific texture unit
This eliminates one level of global state, simplifying the API and
offering new optimization possibilities. Since single-texturing is a
common use case, the parameterless bind/unbind functions have been left
in but changed to operate on unit 0.
Mikko Rasa [Wed, 27 Nov 2013 10:05:01 +0000 (12:05 +0200)]
Remove ambient color from Light
It doesn't make much sense, as there's already the global ambient color in
Lighting. I haven't ever used it either, so remove directly instead of
deprecating.
Mikko Rasa [Wed, 27 Nov 2013 09:06:38 +0000 (11:06 +0200)]
Convert Matrix to use floats
This halves matrix storage size to 64 bytes and reduces overhead from
conversions at certain places. If an application desires greater
precision, it can use the LinAl::Matrix and Geometry::AffineTransformation
classes internally.
Mikko Rasa [Mon, 25 Nov 2013 18:29:32 +0000 (20:29 +0200)]
Unbind Lighting in Renderer destructor
This solves a problem where the same lightning would get bound later and
retain an incorrect matrix due to already being bound. It's not really a
proper fix but works in the most common cases.
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.
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.
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.
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.
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.
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.
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.
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.