Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums may be revoked at the discretion of Oculus staff.

[GearVR] Frame render time jumps up when DefaultLit material covers 100% of a screen

Leemon89Leemon89 Posts: 29
Brain Burst
The issue I've experienced recently. Whenever my view is completely covered by a static mesh with DefaultLit material on it (I'm standing really close to the wall and looking directly onto it, for example) Frame render time jumps up, even though Draw thread isn't affected. If I look along the wall, so it is in the frame to be sure it's rendered, everything is ok. And it appears gradually the more percent of a screen is covered from about 60% to 100% at the peak. It looks like some kind of Fill rate issue. The only stat I've found to show this is SlateDrawWindowsCommand which is pretty abstract. 

As you can see below it's an empty scene with simple skydome (Unlit material) and a wall with default tiled material (any DefaultLit material will do the job) So the wall covers only part of a screen and render time is fine.


And this is example of 100% covered screen. Render thread has dropped significantly (rounded to 22 ms by 'stat raw')


Any ideas? Is there a fill rate cost of some sort?

Comments

  • Leemon89Leemon89 Posts: 29
    Brain Burst
    Thanks, @imperativity!
    And to help reproduce this issue I've noticed next things: complex shader makes it easier to spot (at least normal map), reduce CPU and GPU modifiers to 1-1 or lower (in my case with 2-2 modifiers issue was gone).
  • Leemon89Leemon89 Posts: 29
    Brain Burst
    @imperativity
    Any updates on this?
  • Leemon89Leemon89 Posts: 29
    Brain Burst
    edited June 2017
    A little update: apparently the more material is lit, the heavier it becomes. I have a corridor (single mesh, single material, about 10k tris) and one part of it is lit by several intersecting point lights, the other is lit mostly by indirect light. Looking at lit part of a corridor makes render time jumps up, but looking at darker part remain stable 60 fps.
  • aussieburgerVRaussieburgerVR Posts: 219 Oculus Start Member
    I've noticed this as well but always assumed it was a Epic engine related issue and nothing to do specifically with the Oculus SDK. Do you get the same relative frame drop if you export for pure android and move the camera to the same position?
  • Leemon89Leemon89 Posts: 29
    Brain Burst
    @imperativity
    There are Roughness and Metallic maps and Sphere reflections as well, no Normals and AO, however adding Normal maps increases this issue drastically, so yes, the more complex the shader - the heavier the lighting of it. I always thought static lighting is literally static and costs close to nothing. Apparently not in VR case as always. I believe this issue has something to do with how lightmaps are baked (they are HDR probably) so they might be heavy and GearVR's texture bandwidth just couldn't handle them. Sadly, roughness and metalic are HUGE picture sellers, so I'm in desperate search of a workaround. Now the thing that bothers me the most is this issue seems to not depend on texels but on actual rendered pixels of a final image, so reducing lightmap and texture resolution does nothing. So the best I could hope for is an understanding of this fill rate.
    And one more thing, @imperativity. Do you have some info or workflows of other devs using pre-baked lighting? What renderer is better to use? How to handle those lightmaps in UE4? Are they pre-baked with diffuse or multiplied in material? Any help would be great!
    And thanks for digging into this issue!

    @aussieburgerVR
    I haven't tried it but assuming how much heavier everything on VR is and even then it was hard to spot and isolate this issue, I believe it's not as noticeable if at all on simple Android build.
  • Leemon89Leemon89 Posts: 29
    Brain Burst
    edited December 2017
    Just to draw a bottom line on this topic for a future generations - it is a fill rate issue.

    TL;DR - GearVR (Galaxy S6 at least) can't handle static lighting in UE4. You have to use Unlit materials and for the lighting you have to pre-bake lightmaps in 3D software (3Ds Max for us) and blend them with diffuse texture in the UE4 material. Look at shader complexity. Below 40 instructions is your goal for an environment master material. 

    GearVR has very narrow texture bandwidth. So it can't handle complex shaders and since Default Lit shader is somewhere around 100+ instructions it's a no-no for a GearVR. I have to mention - it is possible to get stable 60 fps with static lighting, but it is impossible to run such game for 45 minutes without overheating (15 mins was my best)

    It's a bummer, I know, everyone thought static lighting is performance free, but in mobile VR there's no such thing as 'free'. On the minus side - it's tricky and a bit tedious to make lighting in the 3D software if you're not pro at it. On the plus side however - UE4's lighting quality is worse then pretty much any 3D software renderer, so you might end up with prettier lighting.

    Thanks @imperativity for participating in this investigation. Cheers!



Sign In or Register to comment.