|
I'd like to combine objects to reduce the drawcall amount. Currently it goes to thousands so it's really bad. I'm creating the terrain with the following basecode:
Should I combine the whole thing as one object? They're plain planes just next to each other. I'm planning on using a 1024 x 1024 texture with all the different terrain types and assign it to all planes. Will this approach be any good? 1024 x 1024 is needed considering the amount of different tiles I'll be using.
(comments are locked)
|
|
If you're using Unity 2.6+ there's a built-in function on Mesh called CombineMeshes that's probably preferable over the standard assets CombineChildren script. See the documentation here: http://unity3d.com/support/documentation/ScriptReference/Mesh.CombineMeshes.html Some caveats of doing what you're suggesting though:
(comments are locked)
|
|
You better look at how to make a Mesh object as this will give way to many objects. You could try to merge them with the CombineChildren script from Standard Assets, but will probably give quite a delay.
Also, instead of If you have only one Ground type it isn't to hard to generate the Mesh with some little coding, if you need help with that, let us know. Well to my understanding all assets included in the resources folder are included even if not referenced anywhere. And a build with that code works perfectly so that hasn't been an issue. I'll need the plane to have UV map so it can be assigned the same material but have different part of the texture render. Or can UV maps of runtime-created meshed be altered?
Jan 15 '10 at 01:12 AM
Wizeon
You're right about the Resources thing, it's just that I did it wrong once with Shader.Find so I'm extra careful to ensure stuff is referred in the project. You can create Meshes runtime including its UV maps. Look at the Mesh class for this.
Jan 15 '10 at 08:39 AM
Jaap Kreijkamp
(comments are locked)
|
