Blackbody radiation in thermally inhomogeneous environment The power radiated by the backbody is according to Stefan-Boltzmann law
$$ P = \sigma \varepsilon A (T^4-T_{env}^{4} ).$$
Is the parameter $T_{env}$ supposed to be only the temperature in the near vicinity of the object or is there some generalisation for the inhomogeneous temperature of the environment? (For the sake of simplicity I only consider the blackbody object to be thermally homogeneous.) Can the formula in such case be of the form
$$ P = \frac{\sigma \varepsilon A}{V} \int\limits_{V}(T^4-T_{env}^{4}(\vec{r}) )d^3x.$$
If so, what the volume $V$ should be chosen as? If not, is there any other way to think about this problem?
Or simply - as presented on the picture - would the inner hot object radiate even from the upper face?
Thank you for your time and eventual answers!

 A: In general, from any one point on a surface you can integrate over all outward directions.
$$ P = \frac{\sigma \varepsilon}{2\pi} \int\limits_{A} \int_{0}^{2\pi}\int_{0}^{\frac{\pi}2}(T_{loc}^4-T_{env}^{4}(\theta,\phi) )\,cos(\phi)\,d\phi\,d\theta\,dA$$
Where $\phi = \frac{\pi}2$ is normal to the surface, $T_{loc}$ is the local surface temperature, and $T_{env}(\theta,\phi)$ is the temperature of the surface first hit by the ray extending in the $(\theta,\phi)$ direction.
For a flat plane with uniform temperature, where the other surfaces are far away, the inner two integrals will be constant and the outermost integral just effectively multiplies by the area.
$$ P = \frac{\sigma \varepsilon A}{2\pi} \int_{0}^{2\pi}\int_{0}^{\frac{\pi}2}(T_{loc}^4-T_{env}^{4}(\theta,\phi) )\,cos(\phi)\,d\phi\,d\theta$$
This assumes a transparent medium (ie. vacuum) so that each ray will only see heat transfer to one distant location. If you'd like to examine heat transfer in a translucent media you would need to integrate along the length of the ray taking transmittance into account.
Usually however, these equations are calculated with view factors. Allowing one to create an analogous circuit diagram for a scene to determine equilibrium temperatures.
