GearVR .. drops in FPS !! How to improvise?

Hey all,

I’ve been playing around with the Gear VR and it is an awesome experience.
Developing with UE4 is no different. Developing for VR is a much simpler process than i thought it would be.
So thanks to the team for such an effort.

I’ve been working on a test project to check out what all is possible.
Now i built this environment with somewhere around 50 static meshes.
I’ve made two materials, one is Lit and another Unlit. There is a directional Light which is Static.

I did my first Test, where i used the Lit material on my static meshes and an Unlit one for my character and dynamic meshes. Now when i launch the project, i hit an amazing 60 fps and things look fine and cool.
Now when i start spawning my dynamic actors and start moving them along a spline, there is an amazing drop to 30 fps. This happens till i’ve spawned about 15-20 of them. After which the drop goes onto less than 20fps, which is surely unacceptable.

I did another Test where i removed the directional light and switched all SM’s to Unlit. I did this in hope to maintain my FPS. On project launch, the feedback is same. I get 60fps on a static environment. And as soon as I begin to spawn and move actors around, the FPS drops to an amazing low figure of a measly 20-30fps.

Can someone help suggest, what can i do to improvise and maintain the performance?

  • I’m on a pure BP route, should i consider working on a pure c++ project?

  • M using two materials and then instances of these materials, what can i do on this front?

  • Static light builds didn’t seem to be the culprit in here, so should I stick to a lit environment?

  • Should i switch to a different mechanic for spawning, moving my actors? Like generating an object pool (somehow, i have no idea how to do that inside UE4 BP’s) or moving actors based on vectors instead of spline components?

Any help on these fronts will be hugely appreciated.
Warm regards.

I find collisions to be very performance heavy on mobile which is probably what is causing your drop as a first guess - ensure you only have the collisions that are absolutely necessary on every component and make sure everything else is ignore.

Also keep in mind that 100 draw calls is the max for GearVR - which actually means 50 (because of stereo needing to draw everything twice). How many draw calls are you seeing? stat scenerendering (from memory)

I’d also keep to totally simple unlit materials with the two mobile optimization checkboxes ticked (on your material near the bottom of the details panel - totally unlit and one other) until you find the cause of the performance drop so you’re sure it isn’t material related :wink:

Thanks aussieburger.

I hadn’t done the groundwork. And so i dug down and did this.

  • First I used the foliage tool and reduced my draw calls from ~230 to ~15 which is a massive drop. The tri count is around 35k. So i believe m good on that.

  • Secondly each spawned actor was owning upto 6 collision boxes, which i had completely skipped. So i did that to none, for testing.

  • Also i coupled up as my many static meshes as i could. And switched my BP actors to InstancedStaticMeshes.

Now the results are not great, in fact, after doing all this i am now locked in at 30fps.
I don’t know what did that.
I added Precomputed visible volume too, though the actor is not moving around.
The stat of 30fps is same for both lit and unlit material.

Though, there is a warning message which says “InstancedFoliageActor ‘The total light map size for this InstancedStaticMeshComponent is large, consider reducing the component’s light map resolution or number of mesh instances in this component’.”

Could this be the cause of it all? What can be done to prevent the warning? Considering, there is no change in the light map res on the foliage and even ‘cast dynamic shadow’ is ticked off.
What else can be done to figure out the real culprit?

Okay. I just now removed the foliage and am now at 60 fps.
Up until about 20 actors, the fps remained at 60 and then it began to drop.

Any suggestions on what i can do to keep the foliage?

Is the foliage rendered as translucent or masked ? Masked should give you some more performance.

There is no usage of translucency or any masking. I just have these plain spherical low poly meshes. Use the foliage tool to only lay them out.

What is the difference between unlit and lit materials? Is there documentation on this?

Unlit means that the Material will not interact with lighting in the level and is extremely cheap to render. Lit means that the Material will interact with lighting in the level and can become extremely expensive to render depending on how many lights are touching it. Here is a document that covers all of the Shading models in UE4 and what they are for.