This patch is (almost) a complete rewrite of workbench engine. The features remain unchanged but the code quality is greatly improved.
This also introduce the concept of `DRWShaderLibrary` to make a simple include system inside the GLSL files.
I did not see any performance change at first glance but this needs more testing.
What it fixes
- Infront with transparent object is now possible.
- No more trick with the stencil buffer for wireframe masking.
- Lower memory usage: Buffers are the same for the transparent and opaque passes. All compositing happens on main framebuffer
- Replace WORKBENCH_Material allocations/setup/hash with UBOs containing materials properties in chunks of 4096 materials.
- Remove a lot of shader variations.
- Unify the opaque and transparent pipelines.
- Offscreen rendering broken under some circumstances.
Remaining Regression:
- ~~Bug with TAA when operators setting overlay values not tagging view_updated. (needs to be fixed ASAP)~~ Done
- This patch seems to affect roughness a bit. This seems to be caused by the new encoding inside the material. (very low prio)
- Hair rendering seems to be a bit brighter. Might be caused by the roughness change.
- `In front` objects don't recieve SSAO (cavity effect) anymore. (design decision)
- `In front` objects don't behave correctly with Depth Of Field effect. (same design decision as SSAO but could be fixed if enough demand for it)
- ~~All shader variations are compiled when opening blender. (optimization task)~~ This does not seems to be a concern in my tests.