Developing Unity Lightmapping tools NO. 1 : FBX Exporter
After some consideration I decided to change the name for a moment to make it less confusing for other people, because the project indeed is focused on the connection between Unity and Vray over 3dsmax, but the main core will allow everybody to use it for their own purpose with any software with a FBX importer and rendering system supporting UV’s on channel 3.
After a few days of work I’ve written the main core of the FBX Exporter which now allows to export any mesh objects, with their textures and for the moment – a UV on channel 1.
At first I was a little feeling a little uncomfortable when I’ve discovered that Unity splits vertices’s, however for my current project it wasn’t such a big deal. Accordingly to the assumptions the scene should be ready for baking on the export time, so I don’t have to really think about all those additional vertices’s that will show up in 3dsmax until it looks properly.
Later I’ve been a bit impressed in how sophisticated way was the Unity API designed – it really makes writing for it easy and comfortable and that’s something I would not say about Autodesk FBX documentation, because there’s no documentation at all and the most of my time I spent on endless experiments, trying to figure how things work there inside. I still cannot say that I figure out everything cause I’m having a little smoothing problems and I didn’t test it with other objects that won’t be attached as one mesh.
At the moment I would like to give a few tips to anybody straggling with FBX in ASCII mode.
- At exporting UV’s from Unity to FBX be set the “MappingInformationType” to “ByVertice” and “ReferenceInformationType” to ”Direct”
- Most of the properties supported by the object in an FBX file aren’t needed when you want just import it to 3dsmax, just be sure to left 6-7 last properties
- When exporting a reference to a texture there’s no need to export Video objects connected with them.
- 3dsmax importer is tolerable when it comes to file paths, you may use “/” as well as “\”
I’ve also researched other areas like UV packing in Unity, running from command line and lightmapping in 3dsmax.
As it turn’s out, one can get a really fantastic results will well adjusted materials.
Below you can see a simple scene without any Unity light (not well unwrapped though) which shows the difference between lightmaps rendered with objects that contained bumpmaps in their materials and those which don’t.
On the bumpmaped I’ve added a little reflection to the floor and as you can see it became rendered pretty well too.
Filed under: Unity, Vray-Unity tools | 4 Comments
Tags: lightmapping, project, tool, Unity, vray