Add conditional shader compilation #1406
Labels
A-Engine
B-Rendering
P-Normal
This issue isn't a big priority, but it would still be nice to have it closed soon
S-Triage
Issues whose priority still has to be figured out
Problem
Some shaders have parts of them that would be useful to configure from the engine, but can't be configured without changing the shader code and recompiling, e.g. number of CSM splits in deferred shading, textures drawn to in the G-buffer rasterizer (to disable/enable the render picker).
Solution
Features could be controlled using
#define
macros prepended to the shader code, e.g. having#define RENDER_PICKER
, and then checking with#ifdef RENDER_PICKER
. TheShader
asset would store the source code, provide functions to set the values, e.g.assets.read(VertexShader)->builder().with("RENDER_PICKER").with("MAX_CSM_SPLITS", "5").build();
, and then recompile the modified code.The text was updated successfully, but these errors were encountered: