Could EEVEE shader compilation be faster?

EEVEE shader compilation is taking up to two minutes every time I add a new node to a group’s socket.

An example is a group that has a glossy bsdf amongst 10 other types of bsdf. If the outside of the group has a roughness socket which is connected to the glossy bsdf inside the group, then it seems to take so long that it suggests it’s recalculating the entire group innards from scratch, and not reusing any of the information from the previous shader calculation to keep things speedy.

All of the bsdf’s inside the group get mixed together with ‘mix shader’ nodes, but perhaps the logic could be updated to only recalculate sections of the tree up to the first element that uses the newly connected node?

Even if I use an existing noise texture into a different socket, it still takes up to two minutes. So it’s not the addition of a new node having an impact.

I’ve tried optimising it inside the group, so that mix nodes turn off branches that are not used, thinking this would reduce the number of nodes to calculate in the same way Cycles does, but no joy, the compilation seems to calculate everything inside the group regardless of whether it’s ‘live’

5 Likes