- Home /
how do i apply combine children
Hi everyone...im in serious trouble...first of all, i am building an educational game that shows various plant species. main issue is that each plant has around 12k polys and i cluster them to form bushes as in real life forests etc (up to 40 or 50 in each set)...i then added the regular scenery (grass tress etc from unity prefabs) and.....drawcall reached 10K..yes 10,000....i get framerates of 2 if im lucky... questino is...how do i apply the combine children script...? i made a parent game object...added the meshes...then added the script to the game object...but nothing happened..and in this scene i am only using 2 species of plants.
PLEAAAAAAAAAAAAAAAAAAAAAASE help
Answer by reissgrant · Feb 07, 2011 at 02:25 AM
Unity 3.1 will combine like materials automatically. Open your stats and look at the draw calls before and after pressing play, if dynamic batching is on (which it is, by default), you will see a noticeable loss in draw calls. Other than that it sounds like you need to reduce the far clipping plane and do some occlusion culling. Simplify your meshes too, if they are too complex.
Hi..and thanx for the feedback. I reduced the far clipping range, added occlusion culling, reduced the shaders for basic materials to vertex lit and so on...the meshes were originally 34k and now down to 12k...optimized them to the lowest acceptable level. still no change...i basically have a layer having 40 or so meshes of a specific plant (with various scales) duplicated from the scene itself...can this be the problem...and how do i solve that ..(something like instances in 3ds max)...thanx again
Answer by MohdGasim · Feb 10, 2011 at 04:24 AM
Ok..Problem Solved
I modeled the plants to the highest detail...then optimized them for minimum loss of detail and lower poly count (3d max 2011 PrOptimizer). Each plant had 32k approx. Inserted one into the terrain in Unity3d and then assigned the tree paint brush to the terrain and added that plant instance to it....brushed the area with one brush size/density/tree height width....and then changed it again and again...giving me a very LARGE forest like environment, plenty of plant size and colour, with very nice playback rate...drawcalls down to 1,600, but acceptable as this is going to be standalone and graphics capable computers...mainly in an educational facility...Thanx Reissrant for the advice
i know its not exactly combinechildren, but it was the functionality i was looking for to create instances (besides the use of prefabs)
Answer by Barr-find · Jun 28, 2011 at 03:53 AM
I has had same problem. Unity can only batch objects that have max 300 verticles and use same material with simple, one pass shader. :( it's disaster. You have to split all meshes to have 300verts, set material and proper shader and then apply combine children on them. This shuld lower draw calls allot.