Altitude is irrelevant. What matters is the mass per unit volume and temperature as factors which affect velocity decay enough to matter. That is why DA is a commonly used variable in ballistics, artillery, and aviation. The formula PV=nRT (Pressure x Volume = number of moles x Gas Constant x Temperature) is the ideal gas law and with much manipulation, you can come up with the formulas used in the solvers. Those formulas are not all the same and they have some of the assumptions made by the person writing the formulas to get as close to real world as they can. "Ideal Gas" is in itself an approximation. But it tells us that if T increases at constant volume and moles, Pressure must increase. If n decreases at constant volume and temperature, then P must decrease. Also, remember that there are interior ballistics (what happens IN the barrel) and exterior ballistics (what happens to the bullet in flight) and there is only a slight connection. In most cases, when Thermo guys start a calculation using some sort of a Monte Carlo system, we use one of the STP sets (for instance 59F and 14.7lb/ci) to get on the path and hand check the solvers we have programmed. There are others as Thermodynamics, Physics, Aviation guys always try to better it, but the current international standard is 0C and 1 bar.
So as we increase the grains of water in the air or n (just think of this as the number of molecules in a cubic foot of air) the resistance goes up because there is more "stuff" for the bullet to move out of the way (and why you see trace) so velocity decay increases. There is also some math about partial pressures, but that only has an effect of tenths of an inch at a mile. Form factor and how the bullet interacts at the nose and tail also affect velocity decay and they are "best" at one specific set of conditions.
Why you fly a plane (or a bullet) over water, or a much lighter or dark patch of earth, the DA is changed and that certainly affects the flight of the object. In some cases, you will shoot "short" and it others "long" as opposed to the data without those factors included.