Performance problem with objects outside viewport

Hi,

please take a look at the following profiler output:

iPhone Unity internal profiler stats:
cpu-player>    min: 89.0   max: 104.0   avg: 99.1
cpu-ogles-drv> min:  4.3   max:  6.7   avg:  5.2
cpu-present>   min:  1.2   max:  3.0   avg:  1.4
frametime>     min: 98.5   max: 124.4   avg: 112.7
draw-call #>   min:  29    max:  34    avg:  31     | batched:     5
tris #>        min:  6810  max:  7376  avg:  7143   | batched:   206
verts #>       min:  3659  max:  4015  avg:  3864   | batched:   131
player-detail> physx: 78.8 animation:  0.0 culling  2.0 skinning:  1.9 batching:  0.1 render: 10.2 fixed-update-count: 5 .. 6
mono-scripts>  update:  4.6   fixedUpdate:  0.0 coroutines:  0.2 
mono-memory>   used heap: 1261568 allocated heap: 1650688  max number of collections: 0 collection total duration:  0.0

As you can see the most time is spent for physic calculations. To much time…I’m getting around 10fps (2gen iPod) with a 4k vert. scene.
I have a scene with a lot of objects, but most of them are not visible. As it seems the non-visible objects are still part of the Physx pipeline, so I thought…ok…lets set these objects to “active=false” for avoiding physic calculations. No luck, still the same result.
Is there a way to “hide” 3d objects from the physx engine? Simply deactivating the colliders wont work as well. I have no idea…

Thanks in advance!

Axel

I attached an image from the Unite iPhone summit. It doesn’t matter if objects are visible when doing physics. Make sure you have set the best physX settings for your game such as, interpolate, fixed time step, no mesh colliders, etc.

268581--9661--$vlcsnap_2010_02_26_09h30m14s241_123.png

You can always set a GameObject’s “active” property to false, thereby deactivating it, but if it’s, say, a bouncing ball that bounces off-screen, then when it comes back into view and you re-enable it, it’ll resume its earlier path mid-bounce, which is probably not desirable. Instead, you probably want it to have settled somewhere, which it won’t be able to since it is no longer part of the physics simulation.

I think this kind of thing often comes down to optimizing by way of altering game design somewhat.