Log in or register to post comments

Optimizing for a single frame marker

October 7, 2012 - 2:12pm #1

I'm working on an AR project that uses only a single trackable frame marker.  When I run the scene with the QCARBehaviour script turned off, I run at around 39 fps.  When I enable the QCARBehaviour script on my main camera, my framerate drops to 20 fps when nothing is being tracked, and 18 fps when the tracker enables the scene content, which is far below an acceptable performance level for this project.  The tracker reveals a fairly expensive skinned mesh character that is taking a lot of the cpu time, but I have optimized the character as far as I can without sacrificing quality.  I would like to do some optimizing to Vuforia in order to reduce the frame time and regain some performance.

- First off, there are a lot of (cool) features that I am not using on this project.  Since I am not using any virtual buttons or image targets, would it be beneficial to modify the QCAR Behaviour to stop looking for them? In the UpdateTrackers method I have commented out all UpdateTrackablePoses calls on both image trackers and virtual buttons, but saw no change in performance.

- I am only using one frame marker, and it is set to the world origin.  I have set the QCAR Behaviour to World Center Mode "User" and set my frame marker as the world center.  Despite this, I suspect that the QCAR Behaviour is doing some manipulations of the frame marker's position, and in turn modifying the position of all the marker's children (which contains a lot of transforms).  Is there a way to ensure that the only position being modified is that of the camera?

- Could I decouple the background drawing from the camera's position update?  I'd like to try alternating frames where one updates the video image and the next updates the camera position.

Optimizing for a single frame marker

October 10, 2012 - 9:31am #11

One thing you could try is changing this line in AppController.mm

#define USE_DISPLAY_LINK_IF_AVAILABLE 0

try setting it to 1 to see if it makes things any better/smoother

N

 

Optimizing for a single frame marker

October 10, 2012 - 9:13am #10

You are seeing 28/29 fps because your framerate is capped by default.  The process time, both detecting and not, are higher than your capped framerate, so the frame buffer is waiting for the framerate cap. If you turn off vsync and manually set your target framerate to 60, you will see framerates higher and will likely see a framerate difference between tracking and not.

I did a little digging with the internal profiler last night.  If I recall correctly, the qcar behaviour was taking about 28ms per frame to process.

 

To be clear, it's not just Vuforia alone that is tanking my performance.  It's the combination of Vuforia and the rest of my scene contents.  I'm just trying to determine if there is any additional optimizations I can squeeze out of the qcar behaviour so that I don't have to sacrifice as much in animation / audio quality.

Optimizing for a single frame marker

October 10, 2012 - 8:50am #9

Hi mattimus

I have just run some tests on the FrameMarkers sample on an iPhone4 iOS5.1 and wanted to check these with you.

Prior to any detection I am seeing around 28/29 fps, and once the QCAR letters are detected the frame rate ends up being more or less the same.  BTW Having the camera on means that the fps will never exceed 30fps.

Are you observing the same behaviour with the sample out of the box?

N

Optimizing for a single frame marker

October 10, 2012 - 2:17am #8

The reason I asked the OS version is that some developers in the Unity forums are reporting a drop in FPS on iPhone4 iOS under certain circumstances, so I wanted to rule this out.

I have asked the development team for any suggestions and hope to get back to you soon.

N

Optimizing for a single frame marker

October 9, 2012 - 1:07pm #7

I'm running iOS 5.1.1. But unless there is a bug related to a specific OS, I don't see how that's relavent to my original questions.  I'm looking for setup-specific ways to make vuforia more lightweight on a CPU-bound scene, not troubleshoot a non-functioning scene.

Optimizing for a single frame marker

October 9, 2012 - 5:03am #6

Thanks for this.

Could you please tell me which version of iOS you are using on your iPhone 4?

N

Optimizing for a single frame marker

October 8, 2012 - 10:36am #5

I am testing on an iPhone 4 with a framerate around 18 to 20 fps.  I have a few users testing with 4s, 5, and an ipad (not sure what generation) but I haven't checked the performance on those devices.  iPhone 4 is the earliest device that I am interestd in supporting, which is why I do my performance testing on it.

Optimizing for a single frame marker

October 8, 2012 - 10:33am #4

Which actual iOS devices have you tested this on and what spread of FPS did you get?

N

Optimizing for a single frame marker

October 8, 2012 - 9:57am #3

I'm already using MODE_OPTIMIZED_SPEED and it doesn't seem to be making a difference.

I am currently publishing to iOS.  I plan to do Android as well, but I'd like to get the iOS release complete first.

Optimizing for a single frame marker

October 8, 2012 - 3:45am #2

Hi mattimus,

Have you tried MODE_OPTIMIZE_SPEED ? and did it make any difference here?

Also what platform / device are you using?

N

Log in or register to post comments