This is for a tent which has a rectangular base $a \times b$ and with the center pole holding up the tent having heights $h_1$ and $h_2$ at the two ends which are at the centers of the two rectangle sides labeled $a$. The height at a point $x$ units from the $h_1$ end is (using the coordinate $0$ at that pole and then $x$ going along the midline of the rectangle) $h(x)=h_1+[(h_2-h_1)/b]\cdot x.$ Then the cross-sectional area at point $x$ is $(1/2)a\cdot h(x),$ which when integrated from $0$ to $b$ and simplified gives the volume formula $$V=\frac{ab(h_1+h_2)}{4}.$$ Note that when $h_1=h_2=h$ this gives the right thing.
It would be more complicated if say the pole holding the tent up was not only at different heights at the two ends, but also askew with respect to the rectangular base.