Frodo
Topic Author
Posts: 11
Joined: 09 Oct 2014, 20:01

Best performance on mobiles

30 Oct 2014, 16:28

Hi,

I'm lost a bit finding out the best strategy to get the best performance on mobiles (unity3d). May be you can help me. I've got the following questions:

At the moment I'm using prefabs in unity to add different gui objects to the scenes. Therefore I add a camera, a "Noesis GUIPanel" component and a script (code behind) to a prefab. This leads to having multiple "Noesis GUIPanels" (and cameras) in the scene. Will this affect the performance drastically? Is this the proper workflow or is there a better way if I want to add different GUI-objects to the scene? (in different XAML-files). Or is it advisable to use only one XAML in the scene?

Is it better to use "DoubleAnimationUsingKeyFrames" or just "DoubleAnimation"? Is there a big difference concerning performance?

At the moment I'm using "DoubleAnimationUsingKeyFrames" to move a grid containing other elements into the screen (menu). I trigger the storyboard in the code behind (view model) several times. The first and second time it runs very smoothly, but the third time it gets stuck a bit. It is not dramatical, but I have no explanation for this. Do I have to un- or reload the storyboard in some way? Or what could be the reason for this? (tested on iPhone 5).
		<Storyboard x:Key="MoveInAnswer">
			<DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)" Storyboard.TargetName="AnswerContainerGrid">
				<EasingDoubleKeyFrame KeyTime="0" Value="-570"/>
				<EasingDoubleKeyFrame KeyTime="0:0:0.9" Value="0"/>
			</DoubleAnimationUsingKeyFrames>
		</Storyboard>
Are there other general advices to improve the performance on mobiles?

Thanks for your help!
 
User avatar
jsantos
Site Admin
Posts: 2904
Joined: 20 Jan 2012, 17:18
Contact:

Re: Best performance on mobiles

31 Oct 2014, 12:46

At the moment I'm using prefabs in unity to add different gui objects to the scenes. Therefore I add a camera, a "Noesis GUIPanel" component and a script (code behind) to a prefab. This leads to having multiple "Noesis GUIPanels" (and cameras) in the scene. Will this affect the performance drastically? Is this the proper workflow or is there a better way if I want to add different GUI-objects to the scene? (in different XAML-files). Or is it advisable to use only one XAML in the scene?
Although having multiple Noesis Panels does not affect performance (in fact it could increase it because each panel is processed in parallel) it increases the memory consumption. This is something we want to reevaluate in future versions and document properly.

Right now, the alternative to having several components is having a single one using as root xaml with an empty container, a Grid for example. Each prefab would have a xaml but not a camera. And each time you want to display it you add it to the root container. This is good not only because it consumes less resources, it also allows you to create transition between each xaml.
Is it better to use "DoubleAnimationUsingKeyFrames" or just "DoubleAnimation"? Is there a big difference concerning performance?
You should get a similar performance.
At the moment I'm using "DoubleAnimationUsingKeyFrames" to move a grid containing other elements into the screen (menu). I trigger the storyboard in the code behind (view model) several times. The first and second time it runs very smoothly, but the third time it gets stuck a bit. It is not dramatical, but I have no explanation for this. Do I have to un- or reload the storyboard in some way? Or what could be the reason for this? (tested on iPhone 5).
Having a spike the third time your execute the storyboard is really strange. Could you create a small scene with this problem and file us a bug? We can investigate it to understand what is going on.
Are there other general advices to improve the performance on mobiles?
Yes, the Optimizing NoesisGUI Performance document explains more things. Please, have a look at it and if you have more doubts tell us here. That document will be updated in future revisions.

Who is online

Users browsing this forum: No registered users and 1 guest