PDA

View Full Version : Baking environment (cube) maps



ProPlanet
02-23-2011, 02:22 AM
Hello all,

I was wondering if it is possible and how to bake an environment cube map of my scene to use in our application as a reflection map.

I would really appreciate it if you guys can help me out.

Thanks

nickdigital
02-23-2011, 03:17 AM
Will the Liberty3d Skybox Camera do what you want?

http://www.liberty3d.com/tools/ubercam-camera-plugin/

ProPlanet
02-23-2011, 03:33 AM
This would actually do the the trick, but i was hoping to find a way to do it without have to spend extra money on a plugin :)

So i'm open to other suggestions before i consider buying this plugin.

Thanks anyway

nickdigital
02-23-2011, 03:36 AM
This would actually do the the trick, but i was hoping to find a way to do it without have to spend extra money on a plugin :)

So i'm open to other suggestions before i consider buying this plugin.

Thanks anyway

I suppose you could do still renders by rotating your camera around and then stitch the frames in Photoshop.

nickdigital
02-23-2011, 08:18 AM
How about this camera?
http://www.trueart.pl/?URIType=Directory&URI=Products/Plug-Ins/TrueArt%20Camera%20Library

Lightwolf
02-23-2011, 09:41 AM
Two ways:
http://www.liberty3d.com/tools/ubercam-camera-plugin/ includes a skybox camera

The other way would involved modelling a box, assign UVs that, when laid out flat, match the desired cube map, then use that in conjunction with the Advanced Camera and a lot of twiddling.

Cheers,
Mike

nickdigital
02-23-2011, 09:44 AM
...then use that in conjunction with the Advanced Camera and a lot of twiddling.


You might need to do some fiddling in addition to the twiddling.

Lightwolf
02-23-2011, 09:46 AM
You might need to do some fiddling in addition to the twiddling.
Well, yes indeed. Fiddling is a basic requirement when working in LW though, I didn't think it needs an extra mention.

:D

Cheers,
Mike

3DBob
04-22-2012, 01:28 PM
Hi guys,

Rather than have a weekend - I decided to solve this problem.

I wanted to create a smooth pipeline to create LW reflection maps for pre-vis of real-time stuff in LW OGL and CUBEMAPS for unity reflections.

I am baking my reflection maps after baking Lightmaps and placing them into the luminosity channel in LW. Whilst LW does not show the colour component of a lightmap in renders, this is barely relevent in realtime as the reflection maps are typically 64pix square a face! Doing reflections at this point means I can create the render source for both the LW reflections (at 1024X768) and Unity Cubemaps (256X256pix per face) in under 30 seconds per reflection point.

As an aside - I discovered that if you switch LW OGL to GLSL shader mode - you can see the colour components of your baked lightmaps right there in the LW viewport and I have found that if you are working in LCS, what you see then in LW is exactly what will be output to target platforms in Unity. Makes for a TOTALLY predictable workflow.

I wanted the source files to be neatly stored in a single image (maybe HDR if needed).

Ubercam, which has been mentioned before in this thread, is a great little plugin for LW and forms the basis of this technique. You can read about it and get it from here:

http://www.liberty3d.com/tools/ubercam-camera-plugin/

Basically, the Ubercams cross skybox - is perfect for just that - skyboxes that sit around your scene to add instant environment - BUT NOT for cubemaps for reflection in Unity shaders.

To get started, you have to have the Ubercam Skybox camera set in LW to point in the +Z direction for it to work correctly that was what I did straight away. I also have an Ubercam SuperPano camera in the same location with the vertical FOV set to 90 & -90. Lastly I have an Ubercam Dual Camera with the Skybox on left and the Superpano on right. All cameras are parented to a null so that they can be moved together. In order to bake the reflection maps for LW and Unity in one pass - just move the null, and turn the "unseen by camera" render flag for the target object on. Hit F9

When you apply the cropped images so produced to a CUBEMAP in Unity - the reflections are facing the wrong way. This is because it was intended as a means of making environments not CUBEMAPS after all!

When I Identified the problem - The solution became apparent only when I got my head aound the necessary transforms... basically - top and bottom need faces to be rotated 180 degrees and flipped horizontally and all other elements flipped horizontally.

Attached is an image which is the table POV in my test scene with the table set to unseen by camera - with Ubercam creating the Skybox and LW spherical reflection map in one pass onto the same image using the above set up. Neat.

103764

I have also attached a photoshop action script to create the correct cubemap faces for reflections in Unity. Just load the render above and hit each of the scripts in turn, save the Cubemap face and return to the original image in the history stack. Rinse and repeat until you have all the 6 faces you need.

103765

Enjoy!

3DBob

marchermitte
07-24-2012, 04:05 PM
Thank you, I was going throught the same hassle!

adk
07-24-2012, 09:45 PM
Cheers for the info guys, especially 3DBob. That will save me a bit of fluffing around between LW & Unity.

Does UberCam work with LW11 ?