(Unity 5.1) Should I use baked or real time lighting on my android phone project?

So I’m working on a little android project; it’s a 3D game with a small ball as a character rolling around on a large terrain for a level. There’ll be some spinning collectables along the way, enemies and maybe things like torches/fires to add to the atmosphere. I’m making it for android and am currently testing it on my phone (Moto G 2nd Gen). I’m currently using 2 real-time directional lights and one is casting shadows for both the character and the terrain (the other just illuminates only the terrain at an angle so that the shadowed areas aren’t too dark).

The game is currently running at ~40fps. I have disabled ‘Precomputed Realtime GI’ in Window>Lighting and my quality settings are basically the default ‘Fastest’ setting for android but with enabled V-Sync. When I enable shadows to ‘Hard Shadows Only’ and use low settings to render them, the FPS count dips down to ~30fps.

So I was wondering, is using baked lighting going to boost performance? If so, how should I go about it? If I want my non-static objects to cast (real-time) shadows, how would I get that to work alongside baked lighting? Could I just make the shadows simple black circles underneath?

I’m finding it hard to get a good answer on what exactly is the best choice for android/phone projects when it comes to lighting options. Some say that real-time lighting isn’t supported across many phones, some say baked lighting takes up a LOT of memory space… so what does everyone recommend? Any ideas or tips? Things to consider? Have it out!

Remember that I’m using Unity 5.1 if that makes a difference.

When you use baked shadows, you will save GPU time because you don’t have to render the objects into shadow map(s). You will also get higher quality soft shadows and ambient lighting. Try and use the skybox for ambient instead of a secondary directional light. Depending on your performance constraints a blob shadow can be a good choice.
Memory shouldn’t be too much of a problem, if you keep the resolution at reasonable levels.
The Mobile Unlit (Supports Lightmap) is a super cheap shader because it doesn’t do any lighting calculations, it just fetches it from the lightmap.

2 Likes

Aside from the above, you need to use the classic blob shadow trick for dynamic objects. Even big budget games like Xenoblade use them.

You should aim for PS2 era graphics to get it running smoothly on tablets from the last 3 years or so.

Here’s a blob shadow script:

1 Like

With no lightmapping in my scene, I was getting 28-32FPS, but with the baked scene my framerate dropped down to 17-18 FPS, this is on an Android device. Any reason why?

Realtime shadow performance is 1-2 FPS on Android with Unity 5, and baked performance results in a massive drop, so what to do?? I’m using Mobile/Diffuse shader.

You must have dynamic lights/shadows enabled still. Switch to Edit > Player > Rendering Path > to Vertex Lit or Forward.

Fastest settings will be Vertex Lit, Gamma Color Space, Mobile Diffuse/Unlit shaders, no Image Effects, Quality Settings > Reduce everything, disable Precomputed GI.

You can’t do PC graphics on a Game Boy.

1 Like

This gives you 1-2 FPS on Android. So I’m not sure why you would suggest that.

I meant if you are getting 1-2, then you must have dynamic lights enabled, so you should disable them.

??

I already said I get 1-2 FPS in my original post with realtime shadow performance. Genius you are :eyes:

Try reading slower.

2 Likes

He is saying that you should disable them BECAUSE you have them enabled.

Oh you guys are funny :roll_eyes:

Do you really think I need someone to tell me when I’m getting 1-2 FPS with realtime shadows on, and 28-32FPS with them off, that I need to disable realtime shadows? lol.

I’ve been using Unity for over 5 years, but thanks for the noob advice anyway.

1 Like

It was just miscommunication so let’s all just get over it. Haha! Let’s get back to talking about lights!

1 Like

Yeah so what is the verdict? Are you going to use baking in your Android game or not?

My games visual quality (racing game) looks crap without any shadows on the environment/props etc, so baking is the only viable option. I think I’m slowly getting to the point where its coming right. I literally leave my scene to bake on overnight and see the result each morning. But I’m still seeing tons of bugs, and often the Android device doesn’t show what the editor shows.

One thing I discovered is that you need to make sure you have shadows enabled in your quality settings, and make sure your Android default platform is set to that quality setting with shadows.

I’m still seeing some wierd black blotches on some of my props etc. Not sure how to fix this.