Holy cow! 
And just yesterday I was asked to prettify some upholstery foam, which our DM intends to use as rocks (a gorge to be exact) during tomorrow's session.
I was planning on cutting the surface a bit (he already cut the basic shapes) to create some texture and then spraypaint them and add some small patches of flock. But I think I'll hold off on that and will get myself some joint cement/topping coat (whatever that translates to in Dutch) and do it right this weekend...
Warning!!
If you're using upholstery foam (squishable foam rubber), anything that is even remotely rigid will crack and break over time when picking up the pieces, putting minis on it, etc. Even spray paint will dry crispy and brittle and break when the foam get's compressed a bit (which it will) you'll be constantly having to fix it. Frocks works for model train layouts because it is not being moved about and handled, but wargames terrain is very much the opposite.
Upholstery foam is a fine product, but you've got to stick to flexible materials like acrylic paints and washes. I did a bunch of foam hills using heavy layers of spray paint and spray textured paint.
http://chicagoskirmish.blogspot.com/2012/08/terrain-tutorial-caverns-and-rocks-fast.htmlThey look great and are reasonably sturdy, but a few months after I wrote that post I found that the edges crack sometimes. the next batch will be all acrylic paint with just a light dusting of spray paint for highlights and a touch of texture.
You could put it on a very sturdy base and use alot of filler, but I think using joint cement on upholstery foam for miniature gaming terrain is asking for trouble.