Download

Foliage and dynamic direct light don't work on the device

Since HISM doesn’t work with baked lighting (on the device), I figured I’d try having 1 dynamic direct light, just to see if it helps/works (from what I understand HISM should absolutely work with dynamic lights). Turns out dynamic lighting doesn’t work on Gear VR at all. Even if I wanted to have non-shadow casting dynamic direct light to bring up normal maps to life on movable objects, I can’t.

Next thing is foliage. I used it to paint some rocks on my terrain. Works fine in PIE (ES2, SM5), but not on the device. Why?! (I am guessing same story as with HISM - PC and consoles fully supported, including VR; perhaps mobile supported, but mobile VR as Gear VR doesn’t seem to be)

In the Editor:
ue4_gearvr_foliage_PIE.png
Full: https://s31.postimg.org/3sdl43qtn/ue4_gearvr_foliage_PIE.png

On the device:
ue4_gearvr_foliage_Device.jpg
Full: https://s32.postimg.org/de98o28w5/ue4_gearvr_foliage_Device.jpg

Filed bug report: [Gear VR] Foliage doesn't work on the device - UE4 AnswerHub

Ooh, I didn’t even notice 60 fps on the screenshot :eek:

Anyhow, I wonder if someone from Epic could clarify this issue / upcoming fix

Is there a hope to get this fixed for 4.13 ?

Hi motorsep,

I’ve entered ticket UE-32617 to look at the missing foliage issue for 4.13.

Regarding the dynamic light, mobile only supports a single dynamic light. Do you have both a static and a static/stationary one in the scene? You just want the stationary one, and movable objects should be being dynamically lit by it. Do you have a small repro project you’re able to upload that demonstrates the lighting issue?

Thanks
Jack

Hi JackP! Thanks a bunch!

I have 2 direct lights, one static (which I used originally; casts no dynamic shadows) and one dynamic (added it to test if HISMC will stop being rendered pitch black if I have dynamic light), which casts only dynamic shadows. Last time I ran a test I disabled static light completely (checked off Visible and checked off Affects Scene).

I’ll upload my project to Google Drive, as soon as I manage to get it working with 4.12.4, and will PM you download link.

Thanks

I think having two lights in there might mean the dynamic one is ignored. I recommend a single stationary directional light for mobile. It will cast baked (lightmass) distance field shadows on static geometry and will render dynamic specular lighting on both static and dynamic objects. If you want it to cast shadows for dynamic objects, you can enable modulated shadows or the combined stationary+dynamic CSM shadows added in 4.12.

  • Jack

@JackP: I’ll try that, thanks.

Do you happen to have any info about HISMC rendering pitch black ?

I do not, I’ll have to investigate this.

  • Jack

As a note my forum account is having some problems but rest assured I’m still around.

@JackP:

I just realized that you said “baked distance field shadows” as I have those disabled and after I baked lighting, I had no static shadows at all. I am not sure if it’s savvy to have those kind of shadows instead of lightmaps on Gear VR for performance reasons. Doesn’t seem like anyone used it or talked about using it in mobile VR (neither Epic nor Oculus).

Do you know if distance field shadows are more performance taxing than lightmaps ?

I left 1 directional stationary light with dynamic shadows on. Deployed to Gear VR. Had no shadows whatsoever in the scene (neither dynamic nor static), but at least I saw HISMCs rendered with textures and foliage instances were rendering too. Abysmal performance of 30-something fps though :confused:

Switched directional light to be static (although didn’t rebuild lighting) - foliage and HISMCs still render, but again all pitch black. Sounds like no support for static lighting with those :confused:

Performance is horrible, even with culling distances set for foliage instances. As if visibility culling doesn’t work correctly (perhaps tiled renderer treats foliage actor as 1 surface and doesn’t cull anything if some of the surface is in the view; where it should, IMO, cull per instance, only rendering instances in the view). I hope it’s not the same story with HISMCs (I suspect it is). If that’s the case, then UE4 fails at batching on mobile, unlike Unity :frowning:

Hi motorsep,

In terms of the effect you are aiming for i think stationary light (with dynamic shadows disabled) is the closest match. As this removes the direct contribution from the light map and adds it back via a dynamic lighting. As you say, I’m sure this is more costly than static lighting though. Unfortunately there’s no way to get dynamic lighting effects from a static light.
You should be able to combine a static light with a movable light, but obviously these will affect both static and dynamic geometry and the combination of this will end up reducing contrast.

I would be happy with static lighting if HISMCs supported it. Doesn’t seem they do.

I am guessing that the only feasible option at this time is to use static lights, HLODs, limit amount of geometry used in the view and ditch HISMC/foliage, and resort to indoor environments for better visibility culling.

Alright, I went back to static lighting only, removed foliage and HISMCs and now I am back to my stable 58 fps (although static lighting and HISMC it was very close to 59 fps, but HISMC was pitch black)

Btw, this is what it should look like:

https://youtube.com/watch?v=7hmKAtvAKpo