Implement a feature/variant system for materials #341
Labels
Feature
New feature to the engine
Graphics
Graphical feature
Optimization
Optimization related stuff
Problem this feature should address
Our current material/shader system is quite limited. In many cases, we rely on booleans (int 0/1) to control branching in the shader code. While some of these booleans could be resolved at compilation time (e.g., toggling features through the material editor), the current implementation always resolves them at runtime by sending a uniform value.
Expected solution
We should implement a system to create shader variants, where a single instance of the
Shader
class can manage multiple underlying programs. Variants would represent a predefined set of feature toggles.Pre-compiled shader programs would significantly improve runtime performance by eliminating the need for branching.
The text was updated successfully, but these errors were encountered: