midpoint bug in the shader