How to handle huge scenes

Hello folks,
maybe someone can share some wisdom about how to handle huge scenes. I just dont seem to know what to do right now. Attached you can see a screen of the scene.I am using Maya 2011 and Unity Indie version.

Basically I got 3 major buildings in the scene.
The overall model got about 400k faces.
I can load the file into unity. And I can put the Modell into the Scene View in Unity.
But when I tick the Box to generate colliders, unity crashes every time.
Is the scene maybe just too big ? Or could there be another problem.
I am exporting the Maya scene as an fbx file version 2010.

I read about that Level of Details Technique, but I never used it before and I dont really know how to use it. Could that be a solution to my problem ?

Well despite of the problem with the big scene, I also got some problems with light mapping these big scenes.Can I just combine each building into one mesh ? Or is that just way too much geometry for a lightmap ? I tried to make 1 mesh for each building, then doing an auto UV Mapping and then using an external lightmapping tool for unit, but that didtn really work that well.
Is there a rule of thumb of how many lightmaps you should use for a certain amount of geometry ?

And then I still got no textures…
I really would appreciate if someone could give me a rough workflow how to handle big scenes after the modelling part. OR maybe first of all I need to fix my modells to work properly for unity ?

thx in advance for any help[/img]

Do not use mesh colliders on your scene. Take the time and position out box colliders etc. to fit your geometry. Or possibly take your scene and simplify it a lot in Maya, split it up into parts and use that as mesh colliders for your detailed scene.

The reason being that mesh colliders are more expensive than primitive colliders and I’m not even sure mesh colliders will work with windows, doorways etc. if the meshes are too detailed. There’s probably something about it written in the documentation.

Things to note is that you do not need detailed colliders for each step in your stairs, for your beveled buildings, detailed railings etc. Colliders should be as simple as you can make them.

What lightmapping are you using? I didn’t think Unity had a lightmapping solution until Beast comes with Unity 3… Either way with access to Maya you should bake your lightmaps in Maya because they will look much better than anything you can get from within Unity.

Not sure how texturing big scenes is different to small scenes, it just takes more work. :slight_smile:

If you split up your scene or not doesn’t make any difference for anything afaik. Modeling, texturing, uvmapping, lightmapping will be just as hard and take just as long.

The only thing to keep in mind is that the maximum vertex count (I think) is 65 536 in Unity so any single mesh can’t exceed that.

hey TwiiK
thx for your tips. so am I getting you right, that I should make basic box models in maya that fairly match the size of my detailed model and then combine the meshes of these basic box models to one mesh and use that as a collider in unity ? Is that a common way to generate colliders for detailed scenes ?

I found this tool for lightmapping in unity:Unity External Lightmapping Tool | Ranza Research
Its pretty easy to use and worked well in smaller test scenes. But I just dont know how to arrange the lightmaps for these huge buildings and that much geometry, if you know what I mean.
Its easy if you have lets say one room with some items in it. But its kind of different ( or at least thats what I experienced so far) when you so much detail in your modells. maybe I just overdid it with my modelling and I need to remove details.

Would that be a decent workflow for me ?

  1. make the modells
  2. make uv’d and texture the modells
  3. combine the modells to one mesh
  4. make uv’s for the combined mesh ( for lightmapping?)
  5. bake light in maya
  6. import in unity

I have no idea what the common way to generate colliders for a detailed scene is. Most likely there isn’t one, people just do whatever works for them.

What I’m saying is that the primitive colliders inside Unity. Capsule, Cylinder, Box etc. are faster than using mesh colliders. And using mesh colliders on a highly detailed mesh is suicide.

So I would try what you suggest and if that gives me poor performance I would try using the colliders within Unity instead. Btw, there’s tons about colliders in the documentation, for instance: Unity - Manual: Box collider component reference. And there may even be user made scripts out there that automatically places box colliders around your geometry within Unity so you don’t have to do it yourself.

The lightmapping problem I can’t help you with. I’ve never tried that tool.

Try out see what works for you. Trying to find the perfect workflow before you have tried stuff yourself will never work. People end up with a workflow that works for them because they have tweaked it a million times.

The only thing to keep in mind in your list is that you can’t count ( :wink: ) and if your combined mesh exceeds ~65500 vertices it won’t import into Unity so split them up where you have to or where it’s logical to do so.

You only need colliders where things are going to collide (including something like a lens flare, which needs a collider to block it appearing through something).

Creating a single very simple object which wont be rendered but will carry a mesh collider with it and sit over your level is a good idea, if it stays simple.

The floor in your first image, is that just the Maya grid or is that a highly subdivided polygon?

Go through your various models and delete polygons that the player will never see, and re-UV map the object to account for this. It’ll free up more space for polys you will see, without wasting texture on area’s you wont.

Find area’s which can afford to use fewer polygons. Curved area’s are a good place to start. With a good normal map, you can use much lower polygons for a curve, but still have a nice curve appearance.

For lightmapping, use the second UV and make sure the larger polygons get more UV space than smaller ones. Take care to use a gutter/border between discontinuous edges.

I find Max + Vray + Flatiron works nicely to give good lightmapped results, and if careful the automatically unwrapped UV2 from Flatiron is better than Max’s. Your actual mileage may vary (I’ve never used Maya for Lightmapping).

Lightmaps can be split up. You could if you’re careful, have various objects sharing the same as others, to make better use of available texture space.

2048x2048 tends to be an ok size for lightmaps, if you don’t go overboard and have too many.

:sweat_smile: haha thats true, I got my difficulties with counting sometimes :smile:

And the 65k vertex count is probably the reason why my mesh doesnt show up :slight_smile: thx for that !!!

but I got one more question. does it make sense to combine meshes to a big one generally ? whats the point in that ? sorry for my nub questions. I am just trying to figure out some stuff, so I can find my own perfect workflow as you said :smile:

The floor in the screen is just the grid and below is a grey plane, but this plane is not subdivided or so.

Unfortunately I have no clue of 3ds Max so I think I have to stick with maya and find a good way here.

What I am not sure of atm is how many lightmaps I have to use. See in the screenshot, the building on the right side consists of so many different parts. Should I make one huge lightmap for the whole building or should I make one lightmap for every single part of the building. I got no experience in that, so any advice would be awesome.

And believe me its not that I am not trying all that stuff myself. Its just hard to find out what works best and there are so many little problems I got and thats the reason I am asking you so much. I dont want you to do the work for me, I just dont want to waste too much time figuring out all these little things on my own, when somone else might just have all the answers :slight_smile:
so enough said
thanks again for all yout tips

Split the building up as you see fit. The more polygons in a single lightmap, the lower quality each of those polygons will have for it’s part of the lightmap.

As for combining objects into one. Yes and no. If they’re close together and use the same material, then it’s a good idea to combine them (fewer draw calls), otherwise leave them separate.

What I DON’T know (and would love to have an answer for, for myself!), is does “using the same material” also include surfaces with entirely different UV coords but using the same material. Though in theory it should.

Number of lightmaps, you really wont use/need that many for a single level of reasonable size as it’s just the lighting and shading it contains, which in most cases is often going to be blurry anyway, so lower quality doesn’t hurt like it would with a regular texture or normal map. I think Unity 3 has a limit of 256 lightmaps, I don’t know what Unity 2.6.1 has (would be interested to find out though!), but you’ll be hard pressed to go above that number for a single level unless you’re doing one lightmap per object (which you shouldn’t be doing for everything).

I dont know if this is correct or anything, but my boss and co-workers had a problem when using fbx 2010 on a game they were doing. (before I started working here)
I asked them again now and they confirmed that it needs to be fbx2009 to work fine…
Can anyone confirm this?
Hope this help you with your problem, arcanix.

Well importing .mb oder .ma files from Maya 2011 to Unity 2.6.1 was not possible. In another thread here in the unity forums, a unity developer recommended using fbx 2010 as export format from maya 2011. so that was what I did and it was working for me since then. But I have not thought about fbx2010 causing any problems, but I will give it a try. Maybe there is something not working properly with fbx 2010 ( but I rather think the problem is sitting in front of the computer and that would be me :slight_smile: