3

I am working on a little mobile game in Unity in 2D. I want the player to be a light source and everything else to be dark, so I gave "everything else" the sprites/diffuse material. This works extremely well in the editor/Game view in Unity, but when I build to my Android phone it looks weird. See the pictures. Any ideas?

Currently I am using the realtime rendering mode for the light, I know it is not efficient, but that's a problem for later. I looked into baked lighting, but I spawn the rooms random and dynamically so I am not sure how to proceed there.

I can find very little information about lighting in 2D mobile games in Unity, not sure how to proceed, it is all very confusing.

How can I make the lighting look the same on the phone as in the editor/game view in Unity?

This is the game window in Unity itself

This is on my Galaxy S7 Edge

halfer
  • 19,824
  • 17
  • 99
  • 186
Ricardo Frederiks
  • 127
  • 1
  • 3
  • 13
  • Looks like it's doing per-pixel lighting on desktop and per-vertex lighting on mobile. To some extent, this may be a limitation of the device, but check the differences in the Quality settings to see if you can bump it up without destroying performance. – Louis Ingenthron Jan 22 '19 at 20:51

1 Answers1

3

Sry for writing an answer instead of a comment, but I'm new to SO and don't have the rep to write comments, yet. I had similar issues on my Android build and we would need way more information in order to help you. (1) Are you building for Android, iOS or both? (2) Check your graphics emulation. Make sure you use OpenGL3. (3) Check your graphics tier upon build. Try to use the highest tier with high settings. Lower tier settings might result in bad light. (4) Not necessarily corresponding to your issue but you might wanna try building with a 32-bit display buffer and see what happens. (5) Are you using post processing effects? There is very limited support on mobile devices. (6) Check the priority of each light source you are using. (7) Maybe it's a shader issue? Have you tried using mobile shaders?

Hope this helps, again, sry for answer while not being 100% sure. Cheers.

bastingup
  • 149
  • 7
  • Thanks! Setting the light source to important did the trick. As I said I am new to the world of lighting and with that also the world of shaders. Didn't had to to much those things before. I am not sure if it is allowed but I am really hoping to get in touch with you, because I think I can learn a lot from you if you are open to it. If you are, you can email me on ricardo.frederiks@bad-dice.com. Thank you very much! – Ricardo Frederiks Jan 23 '19 at 13:41
  • 1
    Just dropped you a mail! ;) – bastingup Jan 23 '19 at 13:53