This is a classic heat load / enclosure situation and it's the very same thing you'd get to do if you were a drives & controls engineer (all damn day).
In short, the size of the enclosure and the heat load inside are your main considerations. While the material inside "may" serve to better distribute the heat within the enclosure, that effect is minimal.
The only difference comes when the device has a heavy localized thermal load and the shelf were somehow acting as a sink. For that to be the case you'd need unobstructed physical contact between the device and metal shelf with a thermally conductive compound (like thermal grease).
Just sitting on the shelf, isn't a factor.
Here's a handy online calculator if you know the total watts in usage:
http://www.thermal-edge.com/calculator/