Mikko Rasa [Mon, 2 Jul 2018 21:00:28 +0000 (00:00 +0300)]
Have Object provide an identity matrix from get_matrix
It's often useful to have static geometry in a scene directly as an Object
without creating an instance. Many features such as Z-sorting and culling
require a matrix to be available.
Mikko Rasa [Mon, 2 Jul 2018 12:46:13 +0000 (15:46 +0300)]
Explicitly define the number of mipmap levels in textures
Storage() no longer uses the minification filter to decide whether to
allocate mipmaps or not. That functionality has been moved to image(),
specifically the version taking a Graphics::Image.
Mikko Rasa [Sat, 16 Jun 2018 16:38:11 +0000 (19:38 +0300)]
Reorder functions in dependency order
Otherwise the inliner might inline a function to a point before its
original definition. This can break references to other functions
declared after the inlining point, causing the unused function eliminator
to eventually remove them.
Mikko Rasa [Sat, 16 Jun 2018 12:23:01 +0000 (15:23 +0300)]
Fix matrix interpolation parameter calculation
With an x87 FPU and compiler optimizations enabled, the code could end up
taking arccos of a value very slightly larger than one. This would result
in a NaN and destroy the matrix contents.
Mikko Rasa [Wed, 9 May 2018 19:08:23 +0000 (22:08 +0300)]
Fix a bug in ProgramData when all uniforms in a block are removed
Program blocks continued using the previously generated uniform blocks,
but because the uniform values were removed the blocks were not updated
anymore.
Mikko Rasa [Wed, 2 May 2018 19:32:14 +0000 (22:32 +0300)]
Refactor AnimationPlayer ticking
It's not more consistent between single and stacked animations. There
shouldn't be significant performance penalty since the animation states
would be freed upon removing the target anyway.
Mikko Rasa [Wed, 2 May 2018 19:22:23 +0000 (22:22 +0300)]
Fix a stale pointer issue with Animation
Now that keyframe information is stored in a vector it's no longer
guaranteed that pointers to them stay valid after push_back. Re-link
all TimedKeyFrames if the vector gets reallocated.
Mikko Rasa [Wed, 25 Apr 2018 11:13:26 +0000 (14:13 +0300)]
Use an explicit material slot name in RenderPass
The previous method of overriding materials with pass name seemed a
bit too hacky to my liking. This is more in line with how overriding
textures works.
The Blender exporter now expects the base technique to have a material
slot "surface".
Mikko Rasa [Sun, 22 Apr 2018 08:43:08 +0000 (11:43 +0300)]
Add a function to remove uniforms from ProgramData
It may be beneficial to revert to a Technique's default value and its
associated buffers instead of explicitly setting the same value in an
ObjectInstance's private ProgramData.
Mikko Rasa [Sun, 22 Apr 2018 08:35:46 +0000 (11:35 +0300)]
Allow direct access to AnimatedObject's ProgramData
The animation-related set_uniform interface was already public so there
isn't any good reason to not allow full access. This also makes trivial
customization easier as subclassing is not needed.
Mikko Rasa [Sat, 14 Apr 2018 22:13:56 +0000 (01:13 +0300)]
Use different heuristics for applying shader data
Since later shdata can override values from earlier ones, the stack must
be replayed even if items are only removed. However we can detect if the
exact same items are added back as might happen when multiple objects
using the same technique are rendered in succession.
Mikko Rasa [Sat, 14 Apr 2018 07:42:02 +0000 (10:42 +0300)]
Rename imported interface variables in InterfaceGenerator
Doing it as a separate pass caused trouble when a variable was accessed
both with passthrough and explicitly. Two input variable declarations
were generated and only one of them was linked to the output variable of
the previous stage, leading to the output variable being removed.
Mikko Rasa [Wed, 11 Apr 2018 21:06:15 +0000 (00:06 +0300)]
Split the interfaces from singlepass.glsl to a separate module
Sometimes it's desirable to make a fully custom shader but still use the
common interface. It's also likely that I'll add other types of standard
shader templates in the future.
Mikko Rasa [Tue, 5 Dec 2017 11:51:35 +0000 (13:51 +0200)]
Check for maximum number of samples
This makes it more apparent what the error is if a too large sample count
is requested. Otherwise it would result in an "incomplete attachment"
error from the framebuffer object.
Mikko Rasa [Mon, 4 Dec 2017 11:06:17 +0000 (13:06 +0200)]
Remove the fake MSP_stereo_rendering extension
I originally created it because I thought it might be useful with VR
headsets. Now it's apparent that VR rendering is done with different
APIs and the left/right constants are useless. The other values of the
RWbuffer enum weren't being used for anything either.
Mikko Rasa [Tue, 21 Nov 2017 20:13:23 +0000 (22:13 +0200)]
Be much more strict about extension support
OpenGL ES has added bits and pieces of full OpenGL functionality, an the
extension generator was thinking an extension was supported when really
only a few tokens from it were. Now all tokens must be either supported
or explicitly marked as optional for the extension to be made available.
Some features may be temporarily unavailable on OpenGL ES builds as I go
over the extensions and decide how to fix them.
Mikko Rasa [Fri, 17 Nov 2017 21:54:43 +0000 (23:54 +0200)]
Refactor the structure of extgen.py
Functionality should be more or less preserved at this stage, modulo new
or fixed bugs. Some extensions are detected differently on OpenGL ES but
those were largely incorrect anyway and will be fixed soon.