I have heard many times that if statements in shaders slow down the gpu massively. But I also heard that texture samples are very expensive.
Which one is more endurable? Which one is less impactful?
I am asking, because I need to decide on if I should multiply a value by 0, or put an if statement.
I’ve heard that using
mix()
instead (or whatever GDShader calls that GLSL function) can be more performant, since it doesn’t branch. Is that true?