Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add conditional shader compilation #1406

Open
tomas7770 opened this issue Dec 12, 2024 · 0 comments
Open

Add conditional shader compilation #1406

tomas7770 opened this issue Dec 12, 2024 · 0 comments
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

Comments

@tomas7770
Copy link
Contributor

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. The Shader 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.

@tomas7770 tomas7770 added A-Engine B-Rendering S-Triage Issues whose priority still has to be figured out labels Dec 12, 2024
@RiscadoA RiscadoA added P-Normal This issue isn't a big priority, but it would still be nice to have it closed soon and removed P-Normal This issue isn't a big priority, but it would still be nice to have it closed soon labels Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

2 participants