Apply modification from phongsinglePasseEffect in order to reduce the number of temporaries inside the shader