Fix issue 480 also fixed mask on colormaterial, credits John Brookes