Gear VR getting started judder / shaking

Howdy! First post, extreme UE newbie here. I’ve got a Gear VR (Note 4, Lollipop, Snapdragon, UE4.8.1) and I’m trying to learn Unreal Engine so I can try making some content. I followed the “Up and Running with Gear VR” Twitch training video Sam made. It was very helpful, and I was able to replicate what he showed, BUT! The judder is terrible in the headset. Whenever I turn my head quickly I basically see double, almost like it’s rendering twice and blending the frames or something, hard to describe. Very nauseating. I thought maybe it was a frame rate thing, but I couldn’t get any improvement with monkeying with it (like locking the frame rate to 60). I realized that when creating the project I had selected the “First Person” template that was under the “Blueprints” tab rather than the “C++” tab, so I started from scratch and did it all again but it worked just the same.

Digging through these forums I saw the old post where they pointed to a template for a Gear VR environment that works, the project is called “Gear VR Lighting” (it was uploaded to Google Drive) and features a number of multicolored spheres rising and falling. After auto-upgrading the project to 4.8.1, this works perfectly for me, no judder whatsoever, head tracking is silky smooth. Of course I could just copy this project and use it as a base for everything, but I really want to understand what I’m missing. I have tried comparing the two projects side-by-side but haven’t turned up anything useful yet.

Then I tried creating a new project using the “Flying” template. This built and ran fine on my GVR, but it had no head tracking (not entirely a surprise, though I would like to understand how to add it…). I also noticed that, despite having no head tracking, it had the same judder (or whatever the turn is for what I’m seeing) when I move my head. It’s like it is trying to do the head tracking but then snapping back to the vehicle’s forward direction, so a feature that should remain stationary (locked to my face, since head tracking isn’t working) shakes violently when I turn my head. This seems related to what I’m seeing on the FPS project.

In case it’s relevant, I’m developing on Mac OS X. It doesn’t seem to be an issue so far (as far as I can tell) but I was disappointed to hear Oculus seems to have left us out in the cold. I’m hoping I’ll still be able to develop for Gear VR on my Mac in the future, but we’ll see.

Anybody got any ideas for me? I’m just starting out so I don’t know how to do much yet. Just trying to get a foundation! Thanks in advance!!

So, many questions. Your judder problem is likely due to very low frame rate. Use the “stat fps” command to check if you actually meet the 60 frame per second (or at least something around this). To get projects run at this frame rate on the note 4 you will need to drastically simplify most of your projects, using a post process volume which disables the most expensive effects (e.g. reflections, dof etc), avoid using dynamic lighting (static lighting is fine, no lighting at all, using unlit material as in the example project you mention is better), generally avoid using translucent materials. You can run the stat fps command through the level blueprint or using the device in debug mode.

As concerns the flying template, probably you can fix your issue following this:

In general, you can find a lot of useful info here:

Also, try using this template:

Thanks a lot for taking the time. My frame rates seem to be fluctuating between around the 30s and 40s in the first projects, and the 20s and 50s in the latest template you pointed me to. I’ll try dropping the lighting and investigating the other suggestions you had (still learning how to actually do most of this stuff). That Rift template has some weird stuff going on for me, some of the text only shows up in one eye sometimes, seems like there’s more judder in the right eye, but that sounds vaguely familiar so I’ll dig around and try things tomorrow. (I did have to disable mobile HDR as I’ve seen suggested in many previous posts, to fix having everything render to the left eye only.) Maybe I’ll just start with the simplest scene I can imagine, unlit and nothing but a box or something.

Thanks again, this gives me some things to look into tomorrow.

We’re getting there. I stripped out most of the geometry. Disabled everything in the post processing volume (I think the only thing enabled to begin with was auto-exposure). Disabled everything I could find relating to reflections, put unlit materials on a couple of boxes, and turned off the atmospheric fog. Right now it’s getting high 50s for fps with the occasional dip into the 40s. Judder is quite a bit better, although if I move my head fast I can still see the odd flicker of an object in the wrong place in my view.

One thing I tried just now is when packaging it, changing from ETC2 as recommended in Sam’s video, to All. It seemed to take a lot longer but now I am able to see the red crosshair image which was apparently not showing up before. The judder is the same, and framerate still in the 40s and 50s, noticeably better from where it was initially but not as smooth as I’d like. I’ll look into simplifying the skybox next, I think it’s animated.

I wish there were more Gear VR tutorials, seems like it’s a whole different animal and the tutorials out there now for UE4 don’t really get you something that works well. My guess is that the existing tutorials used to work well, but then the whole Lollipop debacle happened. Anyone got UE4 working well on Lollipop?

Still working my way through this, and I have a lot to learn, but I appreciate your help!

Currently it requires a lot of optimization to get something running similar to what you may be experiencing on the Oculus store. The three biggest performance killers I have seen so far in priority order is transparency, mass draw calls and reflections.

Transparency is simple enough, just avoid it at almost all costs. Reflections are ok if used sparingly, like wet floors etc. The second biggest hurdle though is the draw calls. If you have a level build out of bsp’s you’re going to generate an abnoxious amount of draw calls that could be significantly reduced if you use a static mesh instead. I also try to group as many static meshes as I can together with a minimal amount of textures used for said model. Every little bit of draw call you eliminate helps.

Basically when you are building your project for the gear do not build it with the unreal 4 engine in mind. Build it as if it’s the 90’s and you are working with the origonal unreal.

The note 4 is capable of handling quite a few polygons, if you keep the draw calls low.
Try also removing the skybox and replacing it with an unlit sphere, if you haven’t yet.
Have a look to the post process volume in the vr template for an hint to which effects should be removed.

I’ll be honest perhaps you should try using 4.7 instead of 4.8. I just updated to 4.8 this morning and the stock FPS template is running 20-40 fps with only 20’ish draw calls.

Hm… I started over with the stock FPS template in 4.7 and didn’t get good results. Running stat fps I saw 48-49 fps on the console, which doesn’t sound too bad, but I put the goggles on and the judder was pretty bad, and the text on the floor was only visible in one eye.

I took my stripped down version of the FPS template in UE 4.8 and hid the skybox, and that seemed to take it from pretty decent to very good, with no discernible judder as I move my head. On the console it says 58-59 fps. I’ll try and do a little more testing tomorrow to figure out exactly what has to go and what doesn’t from stock to get smooth results on my setup. Thanks for all the pointers though, I think I’ve at least got something to start working with now, which is great.

I wish repackaging for “All” didn’t take so much longer than “ETC2”, because some of the textures don’t come out right in ETC2 for me (in 4.7 or 4.8). Anybody know how to figure out what the right setting is for my configuration? It takes FOREVER to package for “All”. Maybe I’ll just try them all tomorrow.

Just package for ASTC for your device, ETC2 doesn’t work for me either. I guess it works with exynos devices, but at least on snapdragron I couldn’t get the textures right with ETC2 (not sure why the documentation refers only to ETC2)

Thanks for the tip on ASTC, devel.bmad, that’s working great for me.

I started over with the stock FPS demo and I think I’ve found the minimal set of changes to make it run judder-free, at least for me:

  1. Change the main room texture (“Cube material”) to be unlit
  2. Hide the skybox

I’m able to leave all the other geometry and settings and it works fine. If either the skybox or the room’s material is lit, the judder comes back. Note that the other geometry (the boxes, projectiles, and the character’s arms) are still lit, only the floor and walls are unlit.

Thanks again for the help!

You’re welcome :wink: please keep us posted with your progresses