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.
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.
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.
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).
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.
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.
Mikko Rasa [Thu, 28 Nov 2013 12:51:23 +0000 (14:51 +0200)]
Restore old samples value if create_targets fails
An application could use try-catch to check if a certain level of
multisampling is available, and leaving samples to that value would
interfere with later operations.
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.