
Maxscript - Vray Cubemap Generator for Unity

After weeks of evaluation of today’s cross platform SDK options, we have finally decided to move forward with Unity.
While evaluating Unity, I have created a small helper MAXScript to export Vray rendered cubemaps from Max to Unity. Since I’m unable to find something similar, I have decided to release it to the public as I think it might be helpful for the community I’m about to step in… After polishing it up a little bit (UI, etc.) here it is…
What it does?
With this script, you will be able to easily render cubemaps ready to import to Unity for use as reflection maps or skyboxes. After execution, script will generate 6 image files with the correct naming scheme for Unity.
- Keeps your current render settings, after you’re done executing the script your settings will be restored.
- Rendered images will match max’s bitmap output gamma settings.
- You may output to all type of images supported by 3DS MAX.
- You will be able to select your output path.
- Rendered images will have correct naming scheme appended based on the type, skybox or reflection.
- Fully selectable cubemap sizes.
- When creating skyboxes you have option to render bottom piece 1/4 smaller than rest of the image set.
- There is an experimental blur feature, might be useful specially for reflection maps.
- Detects if Vray is your current renderer and offers an easy switch if it is not.
- New: Option to rotate back piece by 180 degrees. (v0.2)
Planned Features
- Rendering from the point of view of selected scene object.
- Using existing (max or vray) scene camera to render, keeping it’s settings.
- Better seam free blur with more precise control.
- Option to save default launch preferences.
- Your suggestions.
Requirements & Compatibility
In order to use that script, you will need Unity, 3DS Max & Vray. Script should be compatible with all versions but it is not widely tested. So, if you use it please let me know so we can keep a compatibly matrix and/or fix any possible bugs…
Installation & Usage
After downloading the zip file place included maxscript (.ms) to the following location: 3dsMaxRoot\Scripts\Startup
After launching max, go to Customize -> Customize User Interface. Click on Toolbars tab and within the Category pulldown, locate “Pixel Envision” entry.

From here you may drag&drop it to anywhere suitable for your use as shown in the next image.

Now, clicking on the icon will bring up the interface. Usage should be pretty self explanatory but there is one thing to point out. Once imported to Unity, make sure to set texture wrap mode to “Clamp” or otherwise you may see “seams” especially on the skyboxes…
Download
- Current version: v0.2 – 20 March 2012
- Download Vray Cubemap Generator for Unity
How do I get this to render all 6 images? Right now I just rename the file when I get the prompt asking if I want to overwrite.
Hi, it should save it to separate files. It’s been a while since I made that available and I’m not actively using it. I suspect that might be caused by a recent change in Max or Vray. What’s your current versions?
I mean NOT working. Sorry.
Hi! This script is now working in Max 2015 + Vray 3.0. Error: — Unknown property: “camera_type” in V_Ray_RT_3_00_07:V_Ray_RT_3_00_07 <<
It’s been a while since I wrote that script and I don’t have those installed right now to check it out. It sounds like something about camera options changed (or maybe renamed) in Vray. I’ll try to take a look as soon as I can.
Oh, i figured it out. I was choosed Vray RT not Vray Adv. With ADV it’s working, but here is one trouble. Script creates default 3ds max camera, and it’s hard to setup for correct renders. It will be better to use vray physical camera, or may be add droplist, where user can choose what camera type to use. Thank you!
Ah great, thanks for sharing as that info might help others too. Regarding the selectable camera, it’s on my to-do list. :)
Nice! Waiting for new version ) Thank you!
Thanks for the script. Butt i have trouble with the file output. Files are rendered but not written to disk. Any idea why that is.
Cheers
Clarence
Hi Clarence, that sounds like a file path issue. Make sure the path is valid. Also I’m not sure which version of Vray you’re using but if anything changed on that side (how it handles the buffer saves), that also might be the problem…
Just wanted to say thanks for this script – I just dug it up for a project and it worked like a charm. A bit of a strange process but I had to convert a panorama into a skybox. Just loaded it into the environment within 3dsmax and used your script! Thank you, thank you :)
Thanks for the nice feedback and I’m glad its been useful to you. :)
Hello friends I am new in unity and wanted to know if you guys have any tutorial about how to export a scene from 3ds max and vray to unity and then do this
https://www.youtube.com/watch?v=OjLh1EjVTwY
best regards!!!
Hi Marcello,
Unfortunately I won’t be able offer any help but I would suggest looking at the following links…
http://unity3d.com/industries/aec
http://www.packtpub.com/unity-for-architectural-visualization/book
http://www.ryangathmann.com/architectural-visualization-with-unity3d/
http://archvirtual.com/2010/11/26/introducing-the-architectural-beginners-kit-for-unity3d-prefab-resources-and-tutorial-for-architecture-and-design-visualization-projects/
Wow!!! Thanks a lot Erdener… I will buy the book soon Unity for Architectural Visualization… this was very helpful!!!! many thanks!!!! :)
Just bought the book from Amazon!!! many thanks!!! :)
You’re welcome. :)
:)
Thanks for script! Work like a clock on 3ds Max 2013!
Hi
I was only seldom able to save the output and even then i wasn’t sure what i did. The script runs, but there is no output anywhere. What am i doing wrong? :)
You sir, are a legend. You have no idea how much time you just saved me! It’s 2:00am and I’m on a deadline and thanks to you I may get some sleep tonight.
Really nice script, very kind of you to share it :)
Thnx!
Hi, thanks very much for very useful script.
Sorry for the question, i am novice in Max.
I wanted to ask are there any other ways to change the location of cubecamera.. it is at 0 origin, and i have to move all scene accordingly..
Can’t you add Max’s active camera as source for taking cube maps? or genarate movable cubemap camera.
I think it would be easier.
And thanks a lot. it is really helpful:)
You’re welcome, I’m glad it’s been useful for you… And thanks for the suggestion, that’s already on my to-do list for a while. I’ll try to put that in sooner rather than later…
So I’m completely new to 3ds max, and I’m not exactly sure how I can tell where the cube map will render from. Most of my renders are coming out primarily black, and I think it may be because the origin (and thus the camera) is underneath the floor. What is the best way to translate my entire scene so that an arbitrary point in it is centered at the origin?
Yes, currently script uses scene origin to render the cube map. If you have any objects at (or near depending on the size of the object), render will be from within possibly causing your problem. I’m planning an update (as soon as I have some free time) to allow selection of a camera…