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 · May be fixed by #1433
Open

Add conditional shader compilation #1406

tomas7770 opened this issue Dec 12, 2024 · 0 comments · May be fixed by #1433
Assignees
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
Milestone

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
@tomas7770 tomas7770 self-assigned this Jan 13, 2025
@tomas7770 tomas7770 added this to the 0.6 milestone Jan 13, 2025
@tomas7770 tomas7770 removed the S-Triage Issues whose priority still has to be figured out label Jan 23, 2025
@tomas7770 tomas7770 linked a pull request Jan 26, 2025 that will close this issue
5 tasks
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants