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.
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.
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.
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.
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.