Download

[Mobile] Super fast, simple material - how?

When using default materials that come with FPS template, a test app runs slow on mobile. Much slower than Unity-base app built with legacy mobile shaders.

Is there a “mobile” material in UE4? If not, how would I tweak existing material for it to perform fast on mobile platforms (mobile VR to be precise). Thanks.

It’s not just the material but also the general renderer. Turn off as many features as you can (in Project Settings), and you can force Mobile materials to be fully rough (checkbox in the material).

Using Unlit materials etc can also help. Lighting will cost you, as will too many texture fetches. UE4 has far more bells and whistles but it can be made to perform well.

Are there any tutorials about that?

It seems that I turned off everything that might be “expensive” for mobile VR (in Project Settings), and it still feels like there is a lag in default FPS template (even thought I also disabled view weapon model).

In terms of materials you mean? There’s a lot of stuff in the Docs about them, but this is all trivial stuff :slight_smile:

Mobile VR is probably going to be the hardest target platform to get good performance in, dynamic lights of any kind (heck probably even stationary lights) will be a big no-no, mesh vertices and draw calls you need to keep to an absolute minimum so you want to make as much use of the materials through instances as you can, particles will have to be minimal and all your materials/shaders need to be super-simple. Outside of that I don’t have much advice I can give, but I would check out the mobile templates that come with the engine (find them in the launcher).

I only have 1 sun light, which I made stationary (I don’t know how to make it where only dynamic/animated objects cast shadow from it and everything else would have to ignore it and only have baked shadows; it’s possible in Unity). There is no high polycount in FPS template scene. I disabled post processing stuff in project’s settings (at least whatever looked like it was for post processing). So the only things I blame are materials and sky dome/box/whatever it is in UE4.

Well the only option really is to profile and find out whats costing you time. https://docs.unrealengine.com/latest/INT/Engine/Performance/GPU/

Stationary lights do exactly that. Static shadows for static objects, dynamic shadows for moving objects. But I will say this up front, if you’re looking for features like dynamic shadows on a mobile VR project you’re going to face an uphill battle. I would also strongly suggest getting familiar with the material editor and the editors profiling tools before going too deep into it cus you’ll need them.

Aye, thanks.

What about blob shadows for dynamic objects? Is there such option in UE4 ?

Also wondering if there is a way to set quality of baked shadows to HIGH, but quality of dynamic shadows to LOWest, when using stationary light ?

No blob shadows although, there is an upcoming feature in 4.11 for fast capsule-based soft shadows.

And yes, Static Shadows can be baked to whatever quality you like, they always cost the same regardless. As for dynamic shadows, you can drop everything down as low as you want/need, it’ll have no effect on the static ones.

Ah, sweet! So I am guessing by summer 2016 UE4 will become a bit more usable for mobile VR :slight_smile:

Could you please point me to a tutorial or docs where it explains how to set quality for baked lighting/shadows, and for dynamic shadows? Thanks.

I recommend reading all of the pages here, they’ll at least get you started: https://docs.unrealengine.com/latest/INT/Engine/Rendering/LightingAndShadows/index.html

The content examples also have a demonstration of how to setup different lights.

Maybe I am overlooking something, but it appears that there is no way to set bakes shadows to max quality, but dynamic shadows to low quality. It’s either all or nothing for both. What am I missing here?

Also I think sky material maybe performance taxing on mobile (it has too many nodes) ?