Page 1 of 1

OnPreRender massive impact on CPU in builds[SOLVED]

PostPosted: Tue Dec 08, 2015 9:29 pm
by AlexandreFiset
Hi there,

We have found an issue with AmplifyMotionBase.OnPreRender() method taking between 12 and 60 miliseconds in a build.

We are currently using Unity 5.3 and I unfortunately can't say if it was happening in 5.2. In the editor, everything is working fine in both 5.3 and 5.2.

Here's a screenshot with some profiler samples
Image

And the samples setup:
Image

Do you have any idea what might be causing this?

Re: OnPreRender massive impact on CPU in builds

PostPosted: Wed Dec 09, 2015 10:34 am
by Ricardo Teixeira
Hello,

Thank you for reporting the problem, we really appreciate it. Unfortunately we can't seem to replicate it on our side, would it be possible to test a sample of your project with the issue present?

Do you use the Auto Register Object option or manually add the Amplify Motion Obj Script to your particles? Do you use the latest Amplify Motion version available in the Unity Asset Store?

Looking forward to your reply, thanks!

Re: OnPreRender massive impact on CPU in builds

PostPosted: Wed Dec 09, 2015 4:09 pm
by AlexandreFiset
I did create an empty scene with my particle system and the issue is not happening.

My project is >10 gb in size, so sending it over is quite overkill.

I'll investigate a bit further as this issue must be resolved...

Re: OnPreRender massive impact on CPU in builds

PostPosted: Wed Dec 09, 2015 4:43 pm
by Ricardo Teixeira
Hello,

Try disabling the Auto Register Obj option in the Amplify Motion camera component, if that resolves the problem you should consider manually adding the Amplify Motion Obj script to your dynamic objects. Are you creating large amounts of objects at runtime?

Let us know, thanks!

Re: OnPreRender massive impact on CPU in builds

PostPosted: Wed Dec 09, 2015 6:24 pm
by AlexandreFiset
Hi,

We just found the cause. The problem only occurs when the GPU profiling is active...

So this is a Unity, profiler-specific issue. Not on your end and theorically does not happen in a release build.

Sorry about that! If that happens to someone else, you'll know it exists ;)

Cheers,

Alex

Re: OnPreRender massive impact on CPU in builds

PostPosted: Wed Dec 09, 2015 7:44 pm
by Ricardo Teixeira
Hello Alex,

That's great, happy to know it's working! Thank you for letting us know, this info will definitely be useful to our users.

Let us know if you run into any additional problems, we would be happy to help.

All the best,
Ricardo