Bad performance with Unity 2019.2b LWRP 2d point lights on mobile

,

Hello,

I have a bit problem. I’m using the new 2d lighting from the LWRP in 2019.2b. I’m making a game where two 2d point lights follows the player around, unfortunately this greatly decreases the performance of my game on mobile.

I’m using two point lights, one for the enemys and player and one for the background (which is a bit less bright then the light for the enemys and players).

Do you have any idea on how to increase performance, or can’t you increase the performance?

Objects

Background Light

Objects Light

This came up in the following thread a while ago:
https://discussions.unity.com/t/751061

Unity’s replied with:

1 Like

We’ve conducted some performance testing on some of the mobile devices we have, and found out we’re mostly bound by GPU memory bandwidth. We have some tangible ideas on how we can improve, but for now try reducing the Render Texture Scale of the Light Blend Style you’re using. That should give you noticeable performance boost.

5 Likes

Have the performance characteristics of the 2D lights improved since the previous post?
I’m considering using the 2D lighting system in a professional game, would you advise this?

As of 6.9.2 (default settings), nope. Adding 2 lights (1x global, 1x point) and my game performance bottoms out.

1 Like

Is there any solution for this? I too experience low fps when deployed in android. LWRP looks promising but these issues made this sick.

1 Like

Hey, I’m also facing an issue with performance, and really hoping someone has a recommendation please!

Right now, I’m in version 2019.2.18f1 but this same issue happens with 2019.3 as well.

I have a scene where I’m using three 2D point lights but each have one or more target layers:

  1. The target layers are my ground, background and my player, and the range covers my entire scene.
  2. The target layer is the interior of a building, my player and the range just covers the building.
  3. The target layers are a secret passage and my player and the range covers the secret passage.

I’m facing an issue that spawns when I add a combination of #2 and #3, or when I just add #1, or if I add all 3 point lights. What happens is the velocity of my character movement actually increases dramatically, but this only happens on mobile (I’ve only tested Android) and the velocity does not increase in the editor. Am I doing something wrong with how I should be handling this new light system in the pipeline? @yuanxing_cai would you know of any other workaround for this, or what I may be doing wrong?

@yuanxing_cai Any news/updates on this topic? I have a scene with plenty 2d lights rendered on one or (rarely) more than one layer. I deployed it for iOS → Pretty decent, no huge impact even on older iPhone models in fps after a little tweaking around with the target fps. But on Android I get huge performance knockdowns. It becomes unplayable basically.

1 Like

The lights should have no impact at all on your character movement. They do potentially affect FPS, but your character movement should be FPS independent. Do you time your movement speed by Time.deltaTime in your character controller script?

Did it run badly on all Android devices you’ve tested, or just a few specific ones?

@yuanxing_cai it did run badly on several, but I’ve also been using an excessive amount of 2d point lights that I’ve reduced massively now. Fact: The performance is getting better with each deactivated light source - but the performance hit it still fairly high.

1 Like

When you say an excessive amount, how many are we talking about exactly?

I’m using here the General Renderer with 2D lights. I have a point light following my player (child game object), 6 freeform lights spread in the level (but only 2 close to each other) and a global light. Since I have put this lighting setup the game has FPS drop on a AMD 6300 (6 cores) 3.5GHz, 8GB RAM with an onboard video card (a friend testing the game). Before using the lights the game was playing smoothly in this setup. Is this supposed to happen?

How many blend styles do you actively use and how many sorting layers do you have?

@yuanxing_cai I was using 2 blend modes (default one and one where I lowered everything to a minimum to get the best performance out of it) and I, how I mentioned, had about 6 or 7 layers in use (usually a light was only affecting 1 layer)

Any chance you can reduce the number of sorting layers in use? Because each unique layer adds significant overhead to the system.

LWRP with post processing is x2 performance compared to URP, so maybe i will drop unity light2d. Why don’t we have the independent 2D light package?

You reposted this twice already. How about not littering threads everywhere with this?

https://forum.unity.com/posts/5967317/
https://forum.unity.com/posts/5967296/

It won’t help get your point across.

1 Like

Do you believe that ? I achieved> 60 fps on a mobile samsung s7 with LWRP and some 3d lights, and it works with tile map as well as sprite renderer, just set z position = -2.5. So URP still really bad.

The 2D lighting system is not just 2D lights, there’s also a big chunk of code on the render pipeline side that controls how the lights are rendered. That’s why we can’t have an independent 2D Lights package. The lighting system has to be part of the render pipeline.