Pixel Envision Ltd.
Mobile Game Development Studio
  • Home
  • About Us
  • Our Games
    • Hyper-Casual
    • Casual Games
      • Don’t Get Caught
      • Hordes of Enemies
      • noded
      • kubic
      • Whip Swing
      • Witches’ Brew
    • Kids Apps
      • Coloring Book
      • Cars & Trucks Puzzle
      • Train Puzzles for Kids
      • Animal Puzzle
      • Fairy Tale Puzzles for Kids
      • Find the Differences
  • Support
  • Privacy Policy
Select Page ...

Maxscript – Vray Cubemap Generator for Unity

Maxscript - Vray Cubemap Generator for Unity

March 20, 2012 3ds Max, MAXScript, Unity 3D

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

License

This code is free to use, distribute, modify and study. If you modify it please keep my copyright intact. When referencing please link back to this website / post in any way e.g. direct link, credits etc. If you find this useful, please leave a comment and share using the buttons below!
← FTC & Data collection (Analytics) from kids in mobile apps
Unity Plugin Suggestions →

26 Responses to Maxscript – Vray Cubemap Generator for Unity

  • charlie
    8 / 7 / 2018

    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.

    charlie 8 / 7 / 2018
    Reply
    • Admin
      8 / 8 / 2018

      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?

      Admin 8 / 8 / 2018
  • Courvee
    10 / 22 / 2014

    I mean NOT working. Sorry.

    Courvee 10 / 22 / 2014
    Reply
  • Courvee
    10 / 22 / 2014

    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 <<

    Courvee 10 / 22 / 2014
    Reply
    • Erdener Gonenc
      10 / 23 / 2014

      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.

      Erdener Gonenc 10 / 23 / 2014
    • Courvee
      10 / 24 / 2014

      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!

      Courvee 10 / 24 / 2014
    • Erdener Gonenc
      10 / 24 / 2014

      Ah great, thanks for sharing as that info might help others too. Regarding the selectable camera, it’s on my to-do list. :)

      Erdener Gonenc 10 / 24 / 2014
    • Courvee
      10 / 24 / 2014

      Nice! Waiting for new version ) Thank you!

      Courvee 10 / 24 / 2014
  • Clarence
    8 / 20 / 2014

    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

    Clarence 8 / 20 / 2014
    Reply
    • Erdener Gonenc
      8 / 23 / 2014

      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…

      Erdener Gonenc 8 / 23 / 2014
  • Brendan
    8 / 7 / 2014

    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 :)

    Brendan 8 / 7 / 2014
    Reply
    • Erdener Gonenc
      8 / 8 / 2014

      Thanks for the nice feedback and I’m glad its been useful to you. :)

      Erdener Gonenc 8 / 8 / 2014
  • Marcello Campagnoli
    7 / 1 / 2014

    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!!!

    Marcello Campagnoli 7 / 1 / 2014
    Reply
    • Erdener Gonenc
      7 / 1 / 2014

      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/

      Erdener Gonenc 7 / 1 / 2014
    • Marcello Campagnoli
      7 / 1 / 2014

      Wow!!! Thanks a lot Erdener… I will buy the book soon Unity for Architectural Visualization… this was very helpful!!!! many thanks!!!! :)

      Marcello Campagnoli 7 / 1 / 2014
    • Marcello Campagnoli
      7 / 1 / 2014

      Just bought the book from Amazon!!! many thanks!!! :)

      Marcello Campagnoli 7 / 1 / 2014
    • Erdener Gonenc
      7 / 1 / 2014

      You’re welcome. :)

      Erdener Gonenc 7 / 1 / 2014
    • Marcello Campagnoli
      7 / 1 / 2014

      :)

      Marcello Campagnoli 7 / 1 / 2014
  • yuriki
    1 / 12 / 2014

    Thanks for script! Work like a clock on 3ds Max 2013!

    yuriki 1 / 12 / 2014
    Reply
  • Dusan Bosnjak
    5 / 5 / 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? :)

    Dusan Bosnjak 5 / 5 / 2013
    Reply
  • Matt Robinson
    3 / 7 / 2013

    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.

    Matt Robinson 3 / 7 / 2013
    Reply
  • Stefan
    1 / 26 / 2013

    Really nice script, very kind of you to share it :)
    Thnx!

    Stefan 1 / 26 / 2013
    Reply
  • Chyngyz
    12 / 31 / 2012

    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:)

    Chyngyz 12 / 31 / 2012
    Reply
    • Erdener
      12 / 31 / 2012

      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…

      Erdener 12 / 31 / 2012
    • Kanid
      1 / 10 / 2013

      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?

      Kanid 1 / 10 / 2013
    • Erdener
      1 / 17 / 2013

      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…

      Erdener 1 / 17 / 2013

Leave a Reply to Clarence Cancel reply

Your email address will not be published. Required fields are marked *

  • Tags

    3ds Max Coming Soon CoronaSDK Featured Flash Lua MAXScript PHP Programming Reviews Tips & Tricks Unity 3D Windows Phone
  • Recent Comments

    • Yogesh Singh on ZIP (POSTAL) Code Validation Regex & PHP code for 12 Countries
    • Admin on Maxscript – Vray Cubemap Generator for Unity
    • charlie on Maxscript – Vray Cubemap Generator for Unity
    • Mastan on PHP Currency Converter
    • Rakesh Vishnoi on ZIP (POSTAL) Code Validation Regex & PHP code for 12 Countries
    • Find us on

      amazonandroidapplefacebooklinkedintwitterwindowsyoutube
    • Company Information

      Lytchett House, 13 Freeland Park, Wareham Road, Poole, Dorset, BH16 6FA

      Pixel Envision Limited is a company registered in England, company number: 09558675. Registered Office: Preston Park House, South Road, Brighton, East Sussex, BN1 6SB, United Kingdom

    • Privacy Policy
    Copyright © 2011-2021 Pixel Envision Ltd, all rights reserved.