We implemented 2D lights in 2020.3. They work great. Our game is topdown 2D, however we use a perspective camera to add some depth.
Since updating to 2021.1, the lights appear in a small area in the centre of the screen, bleeding out to the edge. As soon as I change back to a orthographic camera they work correctly, but lose the lovely depth we’ve been working on.
Obviously, we could stop using the 2D renderer and implement normal lights, but we’ve put in so much work already and 2D lights have been giving us the desired effect. They look awesome (in 2020.3 at least!).
Thanks,
(I think I posted this in the wrong form before, sorry)
As far as I know, 2D lights where never meant or designed to work with perspective cameras. ( @Chris_Chu correct me if I am wrong).
Unfortunately you will likely need to go with option B (use 3D lights).
[EDIT] Yep. I stand corrected. Hopefully the 2D lights get patched!
That’s hilarious as one of Unity’s own videos from Unite 2020 heavily featuring the 2D lights system, Tails of Iron, is using a perspective camera with 2D lights!
I hope this is not the case, as the way they are working in 2020.3 is great.
I have the same problem. My lights don’t work anymore since I upgraded and setting the camera to orthographic fixes it. But as others have said, I want to use a perspective camera. This worked before and is also in multiple official tutorials. This needs to be fixed. You can’t expect everyone to use an orthographic camera for 2D games.
Let me start by saying, lighting with perspective is supposed to work.
There were a number of bugs that cropped up from changes made to the SRP core and Universal, that changed the behavior for our perspective lights. I thought I fixed most of the issues in 2021.1f1. Did either of you tried 2021.1f1? If so can you log a bug so I can look into fixing this?
We’ve just updated to Unity 2021.1.5f1 and 2D lights does work. However, ShadowCaster2D seems to be still limited to Orthographic camera. The Shadow texture is all wrong when using a Perspective camera. Is it possible to get a fix for this since we are using the ShadowCaster2D in our game?
Sorry I missed this when I made my fix. There is a fix for this incoming and I’ll be looking at adding more test coverage so that this hopefully won’t happen in the future.
@Chris_Chu I updated Unity to 2021.1.5f1 and can confirm that 2D lights work now!
However I have a new issue I can not explain.
Please see the image attached.
Basically: lights are mirrored by Y axis.
So in the editor I setup light at Y = -6 and in game view it turns in Y=6.
I made an image with examples. Second light is in Y=0 and it matches in both game view and editor.
Same behavior for both orthographic & perspective cameras.
UPDATE: the light position is correct in camera preview (smaill window in editor window when camera is selected).
UPDATE #2: Enabling Post-Processing on camera fixed the issue, but that is weird.
Hello. Any ETA when this fix will be released? We are getting really close to finish our Vertical Slice and we want to send it to some publishers. However, we cannot send the build until this is fixed since it breaks a gameplay feature in our game.
Worst case, is this something that I can fix on my side. Is this exposed in the package code?
Hello Chris, I just downloaded the latest 2021.1 staging repo and manually added com.unity.render-pipelines.universal to our project. It seems like the issue with ShadowCaster2D is still there. Has the fix been pushed in 2021.1? I can’t see anything related to this issue in the com.unity.render-pipelines.universal history. This bug is really problematic for us right now as it breaks the whole gameplay design of our level.
Just to add to this thread, the perspective issue I started this thread with, regarding 2D lights has been fixed, however the same issue still persists with ShadowCaster2D.
Could we get an update from the unity team on this?