Reduced number of calculation

Optimized the shader code. Now calculates power once and stores it in a var on each loop.