Performance cost of unused parts of material function

I’m building out an image kernel sample material function for my post process and I was wondering if there is a cost to nodes I don’t connect. So for example, I output the image kernel and the average, max etc for my given scene texture feature, but variance and standard deviation are expensive because of all those power nodes. If I don’t plug them up to anything do I still pay that cost? If not it would be great to go ahead and build all that stuff while I am at it, but if I do pay for it then it makes sense to make them their own specialized material functions. So are they paid when built or paid when connected?

Paid when connected - the unconnected nodes don’t get compiled into HLSL…

1 Like