I have a few questions about the rendering process of Unity iPhone, and would appreciate it if someone could help me out with answers? May need someone directly connected to Unity Studios, though...?
1) If I have an inactive game object, then turn it back on, is the re-activation of the object and it's rendering instantaneous, or am I likely to see a frame-rate hit?
2) If an object is outside the viewing frustum completely, is it totally ignored by the renderer?
3) If neither of these situations is true, is there any way I can disable rendering on an object without a performance hit when it's re-activated?
4) I assume that all objects in the scene are translated in relation to the camera before their visibility is determined and they are discounted from draw-calls (if they're ignored at all!), so that being the case, on an iPhone 3GS, what kind of polygon transformation performance can I expect per frame? 50,000? 100,000?
Think that's it for now - any help much appreciated!
asked May 27 '10 at 08:51 AM
1) Turning inactive game object indeed has performance penalty. It depends on the complexity of your game object (how many and what types of components are attached). Of course you should not worry about activating a single object, but activating multiple during the same frame might be costly.
Consider activating only Mesh component on the GameObject (and keeping object with other components activated all the time) as it is much cheaper than activating complete GameObject.
2) YES. If an object is completely outside the viewing frustum - it IS ignored by the renderer.
3) As I said in 1, it is cheaper to activate only Mesh component.
4) With new Unity 3.0 codebase I can push around 50K skinned polys per frame @30FPS. Our demo which we demonstrated at GDC with gameplay, full-screen post-processing and whistles pushed between 30-40K polys on iPhone 3GS.
However with Unity1.7 codebase you probably would not be able to achieve these numbers. I would target 20-25K per frame.
answered May 27 '10 at 01:25 PM
Thanks for your response, man - I'll be putting my name down for Unity 3 as soon as funds allow. :-) In the mean-time, some questions on your responses:
1) How do I just turn off the mesh component of a game-object? I assume that if I did that, I wouldn't need to re-load the mesh when I turned it back on?
2) you mention that I'd manage 20-25k polys per frame, that's running at 60fps, right? So I'd still be managing 50k (ish) at 30?
answered May 29 '10 at 12:03 PM