Fix gradient generation in the fragment shader.
Speed up z traversal.