4 ms·
Profiling is the only true answer. If the inputs of a shader change, or the outputs: permutation is needed. And this is often: think a variant with vertex colo
by rahkiin 3y ago
Profiling is the only true answer.
If the inputs of a shader change, or the outputs: permutation is needed. And this is often: think a variant with vertex colors for wind impact on vertices. Or a variant with normal map vs without. Your uniform and vertex attributes should also be as small as possible (when aligned) for the use.
You never want to be sampling a zero-texture in order to have generic shader code as sampling is very expensive.
I hope this helps a bit, I am no expert in this field.
- ImHereToVote 3y agoI fail to understand why the inlined pieces of code can't be compiled into intermediary lines. Seems like the intermediary language is where this sort of compiler jungle should be solved.