mcfly3001,

Note that the min/max values can to be very speedly computed using the bounding box/sphere box too.
=> what is the type of object that you use ?

And/or use an 1D texture for to map the distance into the color you want (or discard it).
(after rereading this thread, Kopelrativ have already proposed this )