-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Labels
GraphicsGraphical featureGraphical featureOptimizationOptimization related stuffOptimization related stuff
Description
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.
| Feature Count | Variants |
|---|---|
| 0 | 2^0 = 1 |
| 1 | 2^1 = 2 |
| 2 | 2^2 = 4 |
| 3 | 2^3 = 8 |
Pre-compiled shader programs would significantly improve runtime performance by eliminating the need for branching.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
GraphicsGraphical featureGraphical featureOptimizationOptimization related stuffOptimization related stuff