Any advice on exporting models to Unity 5.x ?

I am sure there gotta be a trick about bringing models from Blender to Unity 5, lightmapping-ready.

Could you please point me to a tutorial or explain what needs to be done prior to exporting to FBX in order to get lightmaps baked properly in Unity ? (or bake non-directional lightmaps in Blender and bring them / set them up in Unity)

Thanks.

For most purposes, it’s best to let Unity auto-generate Lightmap UVs rather than mess with creating them externally. To do this, simply tick “Generate Lightmap UVs” (refer to http://docs.unity3d.com/Manual/FBXImporter-Model.html).

I have no experience baking lightmaps in Blender and then bringing them into Unity. I don’t believe Unity really “supports” this. You can use an externally-created image as a lightmap, but you’ll probably have to modify a shader to use one UV set for the textures and another for the lightmaps.

I tried that, but when I bake lightmaps, making process just freezes on my PC :confused: I can cancel it of course, but I have not been able to bake lightmaps out of the box.

The progress bar in the bottom right stops altogether? At what point? Baking lightmaps takes a long time–ten minutes for low quality lightmaps on a simple scene on my laptop. Are your computer specs really low? Have you tried baking lightmaps on a very simple scene (one cube and one light) with the quality settings turned all the way down?

Oh wow… That sucks :frowning: My PC is old, but I can bake decent quality lightmaps with bounced lighting in a reasonable amount of time for Quake 3 maps using q3map2 compiler. And that is an ancient tech. I can’t believe Unity is that slow when it comes to baking lightmaps :confused:

I’ll do more tests with simple scenes.

Quake 3 is 16 years old, while Unity 5 uses modern physically based shaders (unless you’re using Legacy shaders for some reason). It’s like the difference between an ancient form of BI and new Cycles, so Unity will take longer. But when I said “simple scene” I meant a map that happens to be simpler than my others. It’s still got a few hundred static meshes, dozens of lights, and I use directional specular maps. It’s not an unreasonable amount of time. Just be sure to turn your settings way down for testing purposes.

Well, Cycles is faster than BI. So following the analogy, Unity should be faster than q3map2 and yet somehow it’s not :slight_smile: (it seems that I am clearly doing something wrong, cos I have 1 point light in the entire scene; but 1 complex static mesh)

Do you know of any clear-cut tutorials about lightmapping in Unity 5 ? (with description of settings and such)

Cycles is faster than BI.

You’re the first person I’ve heard say that. Cycles will be faster if you have a beefy GPU (ie not an old computer) and use CUDA, or turn the quality down, which looks worse. Same with Unity.

Do you know of any clear-cut tutorials about lightmapping in Unity 5 ?

I learned from the manual, it has an explanation of every setting.

You aren’t automatically baking lightmaps, are you? Turning that on really bogs down my computer, and it doesn’t appear to save the lightmaps between sessions with auto-baking on.

That’s the idea behind Cycles - GPU rendering. While my PC/CPU is old, I have GF 670GTX, which is old too by now :slight_smile:

Cycles is slow on CPU not because it’s newer. It’s a faulty logic - newer doesn’t mean slower. It’s about how software was designed.

I am not sure. I just open lightmaps middle tab and hit bake.

You need a REALLY beefy GPU to get a benefit over BI. My Pentium 4 (2004) is faster with BI than my GT 620 (2012) on Cycles with over 50 samples.

I am not sure. I just open lightmaps middle tab and hit bake.

The auto tick mark is right next to the build button. If even simple scenes won’t bake at all, and you never get a progress bar in the lower right, then make sure your computer’s specs are high enough. Otherwise I have no idea what’s going on.

I’m also having some problems importing (ie, drag&dropping) a blend (2.76) file into unity (5.2.x). It’s quite basic, actually, compared to some issues discussed above, so please bear with me while I abuse this thread… :slight_smile:

Ok, so the model/mesh/geometry seems to imported correctly, although we may want to check the up/forward-axis-thing (Z/Y). Also, unity uses a ‘left-handed’ coordinate system, right?

Anyway, it seems to get really cumbersome when trying to import your blender materials into unity. The only thing I got working so far is a basic diffuse shader. Other properties (eg, specular) don’t seem to work, unless I’m missing something. Or textures, anyone? Also, could it be that defining your materials in BI works better than in Cycles in this use case?

Btw, the idea is to have these material settings imported without having to manually remake every blender material in unity – which is highly undesirable. And when I did drag a texture onto the unity material Albedo map, the uv’s appeared to be wrong.

sigh
Is it me, or…

Unity does not support importing materials from blender. The only thing that supports is the diffuse color. So no matter what settings you are using in blender for your shaders/materials, only the diffuse color will actually be imported with the model, assigned to the standar shader (Unity’s default shader). You can import the textures from blender to unity with the .fbx file, but it requires a bit of folder and naming managing. I don’t think I can post links, but if you google “materials and textures from blender to unity”, you will find your answer.
If you want to import specular properties, then you have to bake maps (same with occlusion and normals).

Also, assuming we are talking about a single model, a hose for example and not a village, you want to apply Location, Rotation and Scale before exporting the fbx. Location and Rotation should be 0 and Scale 1. You want to check the up/forward axis, because if for example you are trying to move a character via script, your axis will be wrong, since for blender Z is up and for unity Y is up.

I hope I helped.

I managed to export static meshes from Blender to Unity. Materials export, but textures have to me manually assigned. Although I am satisfied with bringing static models from Blender to Unity, I think I will be back here when I will get to animated models :slight_smile:

Thank you all for helping.