Unity 6 Render Passes/Batching Breaks 2DLights

First of all I want to say my experience with getting a 2D project started has been something of a nightmare as a result of multiple bugs.

Start a new project and add your layers. 2DLights don’t light layers properly due to a caching issue. Restart Unity.
Go into the 2DRenderer and enable the CameraSortingLayer. It doesn’t render in the frame debugger. Restart Unity.
Create a simple circle sprite and apply a spherical normal map to it. Discover that U6’s new render batching has completely broken 2DLights with normals.

In this image there are 3 layers. White sphere on Background, red sphere on Default, and green spheres on Foreground. The Camera sorting texture is set to Background last. In the bottom left is a quad displaying that texture. The normals are wrong. This is reproducible in 10 minutes.

I’ll probably find more later but I jumped into U6 - finally - and I’ve literally run into 3 bugs in as many minutes. It’s just been a rough experience. And I know that this problem is not trivial to fix and it feels like given Unity’s track record it could be months before its deployed. Someone please give me hope.

Hi @CoraBlue, I wasn’t able to reproduce any of the issues with 6000.0.30f1. Which version of unity are you using? Could you explain what you mean by caching issue and what wasn’t behaving as you expected? For the normals, please check the texture type is set to be Normals in the import settings.

If you’re still experiencing any bugs, please submit your project through the editor so we can better investigate them :slightly_smiling_face:.

Hi Kennyy. I made a repro project for the main bug here and submitted it. The team reproduced it just fine. Its under consideration for a future patch.

It’s one of those things you really only catch in mid development because it requires URP, with 2DLights, with active sprite normals on multiple layers in the scene, with a camera sorting layer set before one of those layers.

So it is reproduceable, and I get this is why repro projects are helpful, but at the risk of talking your ear off, lets talk about one of the small bugs that I haven’t submitted.

  1. Start a new project using the latest U6 LTS. I have 6000.0.29f1 here, should do for our purposes.
  2. Select Universal 2D template and spin up the project.
  3. You should be in a scene with a global 2D light. Let’s set that intensity to something low so we can see the problem. 0.1 should do.
  4. Create a square sprite. Under sorting layer, let’s create a new sorting layer. We’ll call it Foreground. Doesn’t matter.
  5. Finally create a 2D spotlight. Set target sorting layer to only Foreground.

And I promise you Kennyy, I pinky promise, that square is not illuminated. Unity still thinks that square is on the Default layer. Rebooting Unity doesn’t seem like a big deal, but when I have to do it several times for several different issues it becomes a huge deal. Plus the frustration that comes with knowing that any regular interaction with what is a very normal and expected use case would have revealed these issues.

And then I come here in the heat of the moment, admittedly frustrated and vague, and get absolutely no traction. I’m not always the most articulate, particularly when frustrated, but I feel dejected. Either I am cosmically unlucky (my love of 2DLights since their inception seems to indicate so, it is one of your most beautiful, ugly children), or there is not enough dogfooding going on at Unity.

Sorry to hear your frustrations. I’ve managed to reproduce both issues regarding the normals and lighting with newly created sorting layers. Rest assured that we will be looking into a fix and will update you when the fix lands.

That’s great news. Sorry if I came off short. I’ll try to be more methodical with my bug reports in future.