Shader flow controll performance

I had this in mind for a terrain shader, there is only one model- the terrain plane.
For normal models I could just use the LOD system even with the same mesh but with a simpler shader.
Anyway the fog part is trivial (mix in a uniform color), I’d say the fog is 5-10% of the shader, so I’m not trying to make a version with and without fog, I have a ‘fog only’ and ‘fog+generate_normals+lights+texture_splating+normal_maps+glos_maps+god_knows_what_else’ shaders. One runs at 60 fps the other at 600 fps (hand waved numbers).

So if I have 1/3 of the screen runing a 600fps shader branch and 2/3 a 60fps I should get a final framerate of 1/3600+2/360= 240 fps :smiley:

I know it’s not how things work, but if there is some performance to gain then it’s worth it.