Lot of shaders possibilities which ends to lot of shader compilation needed

Started by
0 comments, last by Krypt0n 7 years ago

Hi,
Using NormalMap, RoughnessMap, MetalnessMap, TwoSided, Self-IllumMap, OpacityMap ... and also IBL used or not.
And also if a map is not used but a value, you also end to a new shader compilation to not sample but use the value instead.
You end with lot of shader compilation to avoid to use one of them or them combined, at least I only see this solution actually.
Actually I simply send a 1x1 white or black texture but that means one sample for each type in case of used or not.
Actually I simply check for the normal map to avoid to compute the TBN.
Lot of shader mode using defines is the only way ?
Thanks

Advertisement

if it depends on a coherent flag (e.g. a constant for the whole draw call), you can use dynamic branching nowadays, there won't be a big performance impact, might be even faster as you don't need to switch shaders that many times.

This topic is closed to new replies.

Advertisement