Shader preprocessor, permutations #15

Open
opened 2024-08-24 19:27:41 +00:00 by sergeypdev · 1 comment
Owner

I'm starting to have a lot of duplicate definitions in shaders, let's make a basic preprocessor in asset compiler.

I also need some way to toggle defines on and off and compile different versions of a shader, let's add a basic permutation support.

  • #include "header.h" support
  • Add permutations section to .prog, maybe something like "permutations": [{"name": "ALPHA_DISCARD", "range": 1 }] would allow compiling a shader with #define ALPHA_DISCARD 0 and #define ALPHA_DISCARD 1 through the asset manager
I'm starting to have a lot of duplicate definitions in shaders, let's make a basic preprocessor in asset compiler. I also need some way to toggle defines on and off and compile different versions of a shader, let's add a basic permutation support. - `#include "header.h"` support - Add permutations section to .prog, maybe something like `"permutations": [{"name": "ALPHA_DISCARD", "range": 1 }]` would allow compiling a shader with `#define ALPHA_DISCARD 0` and `#define ALPHA_DISCARD 1` through the asset manager
sergeypdev added this to the TODO project 2024-08-24 19:27:41 +00:00
Author
Owner

Ended up having a fully dynamic defines system. It's simpler and quicker to implement. Might be a problem in the future when I need to know all permutations ahead of time though.

Ended up having a fully dynamic defines system. It's simpler and quicker to implement. Might be a problem in the future when I need to know all permutations ahead of time though.
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sergeypdev/engine#15
No description provided.