moved color calculation to fragment shader