Cost of Shader Math
A while ago I came across Ben Cloward's video on shader performance, which used Shader Playground to calculate the costs of various math operations on the GPU. This is a great idea because it shows us which operations we should stay away from when creating materials in Unreal and Unity.
I noticed that his list was a little outdated though; it was missing some important math operations and had a few incorrect operation costs. So I wanted to create my version of the list that I could reference when making shaders.
​
What you see below is the cost of each math node when using float1 (scalar) operations. Using other data type operations (like float3/vector3 math) will increase the cost of the operation proportionally for each channel being operated on. For example:
​
float1 + float1 = 4 cycles
float2 + float2 = 8 cycles
float3 + float3 = 12 cycles
​
Also note that the unit of measurement is Radeon Cycles, which is the base processing cost for an AMD GPU to do anything. Using Nvidia GPUs will give very similar results.​

