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.
Mikko Rasa [Sun, 10 Sep 2017 12:33:41 +0000 (15:33 +0300)]
Immediately process window size to set correct viewport size
The system framebuffer acquires its size from the window when the GL
context is created, but in some use cases the window may change size
before a View is created on it.
Mikko Rasa [Fri, 6 Jan 2017 11:49:20 +0000 (13:49 +0200)]
Simplify reflections in the singlepass shader
Specular reflection of the sky was dropped. It's better implemented
through an environment map. In the future I'll add a skybox utility
class which provides a simple environment map.
Mikko Rasa [Sat, 10 Dec 2016 20:43:51 +0000 (22:43 +0200)]
Some fixes to assignment management in UnusedVariableLocator
Sometimes assignments were being removed when they shouldn't (reference
from a conditional sub-block). Other times they weren't being removed
when they should (followup assignment in the same block).
Mikko Rasa [Sat, 10 Dec 2016 17:28:42 +0000 (19:28 +0200)]
Reorder declarations right after injecting the shared scope
This is necesary for InterfaceGenerator to recognize additional inputs in
shaders that import a main function with passthrough in it. Otherwise no
passthroughs would be generated and those inputs would be unusable in
later stages.
Mikko Rasa [Mon, 5 Dec 2016 17:04:30 +0000 (19:04 +0200)]
Change the setup/finish_frame interface to be non-const
There's no deprecated versions left behind because it would be impossible
to make it work with Renderables that forward the calls to a Scene.
Better to just get compile errors and fix them as I encounter them.
Mikko Rasa [Mon, 5 Dec 2016 16:35:22 +0000 (18:35 +0200)]
Store Renderables as non-const pointers or references
It's irked me for a while how some renderables (mostly effects) need to
do internal updates in setup_frame, but it's const so I end up with a ton
of mutables. Since almost all of my use cases actually pass in non-const
Renderables anyway, I'm just going to change this.
Mikko Rasa [Mon, 5 Dec 2016 16:10:52 +0000 (18:10 +0200)]
Remove the Renderer-less overload of Renderable::render
It's been sort-of deprecated for a long time even though it wasn't marked
as such. None of my code code uses it with anything else than Pipeline
(and that code path is being replaced with View).
Mikko Rasa [Sat, 3 Dec 2016 16:37:53 +0000 (18:37 +0200)]
Refactor postprocessor uniform usage
A lot of the values are shared between processing passes, so it doesn't
make sense to keep multiple copies. ProgramData will take care of only
setting the required uniforms.
Mikko Rasa [Sat, 3 Dec 2016 16:03:12 +0000 (18:03 +0200)]
Add a RenderTarget class to manage and annotate FBOs
I want to have deferred lighting support at some point, and it requires
multiple outputs from the geometry rasterization stage. There needs to
be some way to annotate which buffer holds which information.
Mikko Rasa [Sat, 3 Dec 2016 15:53:19 +0000 (17:53 +0200)]
Remove dynamic allocation from VertexFormat
On 64-bit systems the pointer takes eight bytes, and a typical malloc
implementation will have two pointers worth of overhead. Vertex formats
hardly ever reach even eight components, so it's cheaper to just store
a fixed-size array in the class itself.