Home Technical Talk

Create cubemap from photo?

polycounter lvl 18
Offline / Send Message
FAT_CAP polycounter lvl 18
Anybody know a program that will easily let me convert a 2d photograph or image file into a cubemap? I've searched for ages but can't find anything that isn't a programming tool. I would normally just capture the image from the scene in engine but this time I wan't to experiment with creating my own.

Thanks in advance!

Replies

  • Eric Chadwick
    What kind of photo is it? Many ways to do this, easiest way depends on the source. Can you post an example?
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    You can make a sphere environment map by taking a photograph of a reflective chrome ball.

    (eg. http://www.krupps.com/Gazing_Balls/0_0_25_3_MM10_3_3)

    It's not the same as a cube map, but can be useful for similar purposes.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    This program looks like it may be useful. It can convert a mirror-ball photo into a cube-map.

    http://www.outerspace-software.com/bixorama.html#examples


    You might look at Quicktime-VR authoring software. QTVR seems to be the same idea as what you're after. (Environment maps from photos.)

    http://www.apple.com/quicktime/resources/tools/qtvr.html
  • FAT_CAP
    Offline / Send Message
    FAT_CAP polycounter lvl 18
    Cool - I'll check out those links - thanks Ryan.

    The "photo" source was just going to be one of the default skyline pictures from the MAX "reflections" directory as a test, but this got me thinking about how you would go about creating any cubemap without capturing it from a scene. Just any simple landscape picture really - no panoramic camera or shiny chrom ball needed - the easier the better really- say something like this as an example...

    Burning%20Sky.jpg
  • Eric Chadwick
    Hmmm. This kind of shot would work fine for spherical reflection mapping (which basically just maps from the front, and doesn't look that great), but it wouldn't really work well for cube mapping (which surrounds the scene).

    You'll have to paint out a ton of seams to get this to work as a cubemap.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    Ahh. When you said "photograph," I presumed you had a real-world environment that you wanted to capture ;)
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Well this one would be super easy to 'cubemap' by hand anyways - it's mostly horizon lines and flat colors. Just open a photobased DDS cubemap in photoshop using the nvidia tools, determine what face is front/back/left aso and just copy-paste bits of your photo on top. Then save!
  • KikiAlex
    You can use this program, is the best that I have used for this things :

    http://ati.amd.com/developer/cubemapgen/index.html
  • Eric Chadwick
    pior, I doubt the end result would be that great, copying and pasting.
  • Ryan Clark
    Offline / Send Message
    Ryan Clark polycounter lvl 18
    That photo isn't enough source material to create an environment map with...

    The photo contains back-lit hills and trees... so the opposite side of your cube needs reddish front-lit hills and trees, and the adjacent sides need side-lit hills and trees.

    If you wrap back-lit trees around your whole cube, it's going to look like some sort of otherworldly hellscape.
  • pior
    Offline / Send Message
    pior grand marshal polycounter
    Oh well for sure it wouldn't be perfect, but since it's just reflections we are faking it might aswell work...
    I did it many times already, it's actually quite fun to mess with! Especially to simulate studio/lightbox environments and such.

    Also about hand painting cubemaps - switching back and forth between cube and cyclo mapping using a conversion program makes the job much easier (cube for easier to paint ground and sky planes, and cylindrical to get the genral feel and horizon line). I saw it done countless times where I used to work before. The matte painter was freely painting the cubemaps that way, compositing 3d renders, pictures, and handpainted bits. Stunning result I must say! But yeah definitely not mathematically accurate, and it requires an artists hand for sure.
  • Eric Chadwick
    Oh yeah, well I kept thinking about skyboxes, where the cube can actually fill the view at times. But reflection maps aren't so obvious. And handpainting is not hard, like you say, you can paint amazing things with the right set of hands. :) Just not the copy/paste kind of shortcut I think FAT_CAP was looking for.
  • FAT_CAP
    Offline / Send Message
    FAT_CAP polycounter lvl 18
    Thanks for the replies guys- I was indeed, in this instance, looking to make a reflection cubemap but was thinking more generally how to create a cubemap from a 2d image - maybe for a skybox or whatever.

    Pior - do you know what program your matte painting guy used to switch between cube and cyclo mapping as that sounds like a great way to go about business.

    On my travels I found this little freeware program http://www.skypaint.com - not the best but you can't grumble for free! You can import a 2d image and set it as a cubemap, rotate to where there are any visible seams in the viewer, drop the view into Photoshop, paint and then save out back into the viewer - a la Zapplink or somesuch. You can then export the whole thing into six seperate textures ready to be imported into your cubemap texture in editor or whatever. Might be of interest to anybody else looking along these lines.
  • Brice Vandemoortele
    Offline / Send Message
    Brice Vandemoortele polycounter lvl 19
    I personally use HdrShop (http://www.hdrshop.com) to convert whatever initial format you have (be it hdr or not) into a cross and then move it to cubemapGen from ATI (http://ati.amd.com/developer/cubemapgen/index.html) to do the final filtering, mimaps and exposure correction. As Pior mentioned this one is quite easy to handpaint . Cubemaps hardly ever need to be super accurate especially with complex meshes since it's only to give some sense of reflection-looking behaviour. You could use maya or any 3dpaint package to paint to seams over a regular cube mesh. If you want to use it as a HDR lighting environment the goal is quite different, and you definitely shouldn't start from a single LDR photo :)
  • Eric Chadwick
    Yeah, don't want to be down on painting, I've painted some refmaps, works well.

    Hdrshop is great for converting to latlong/cyclo format, except it's not free for commercial work. Also skypaint is great, shareware though not freeware. Cool for students or hobbyists though.

    If you have max already, it's pretty good for converting. Just put your map in the env bkg slot (reflect/refract map = cube, bitmap set to sphere coords = cyclo, etc.) then for a cyclorama go to Rendering menu and choose Panorama Exporter. Or for a six-bitmap cube make another reflect/refract and use it to render with. Max doesn't do a good job of making DDS cubes though, so I use Cubemapgen like Brice.

    Ryan thanks for the bixorama link, worth a look.
Sign In or Register to comment.