I’ve been messing around with the new lights and while they work for the most part, they seem to glitch out horribly on large sprites and when the Camera rotates on the X and Y axis. This is at least, when the Camera is set to Perspective. On Orthographic is seems fine. Are the 2D Lights compatible with a perspective camera? Is there anything I can do to get rid of the issues I listed?
I’m having the same issue. 2d lights seem not to work at all with perspective camera.
I know replied to you in another thread as well, but just for completeness.
They should work. If they don’t something is wrong. If anyone is having issues with this please submit a bug report if you can.
Can confirm - in 2021.1.15 they don’t work at all with perspective camera - the only working is global 2d light
2D Lights still don’t work with perspective camera in the official 2021.1.21 release.
There is a resolved bug report here: Unity Issue Tracker - Lighting Renders Incorrectly when using 2D Lighting and Perspective camera
But this has been resolved only for the beta release (2021.2.0a10)
Can someone please fix this issue in the official release?
This is critical for many game developers.
I’m at the unfortunate point now where I might need to strip out the 2D lights and rework everything with 3D lights. I have 3 weeks to port the game to switch (and actually finish the game) and I’m pulling my hair out.
Hi, I’ve backported the fix to the lighting issue with perspective camera. Apologies for the delay and I’ll keep you updated when the package is published.
Omg, that’s amazing. Thanks so much. I’ve been stressing about this so much. Just got into the office this morning with a plan to rewrite the whole lighting of the game with 2 weeks left to launch. THANK YOU
I can’t guarantee the package can be published in time. The fix is simple enough that you may want to change your package locally. Please take note, doing so will cause the package to not automatically update since it’s a local copy.
Here are the steps if you plan to proceed:
Navigate to ProjectName/Library/PackageCache/com.unity.render-pipelines.core@11.0.0
Copy this folder to ProjectName/Packages folder
Open ProjectName/Packages/com.unity.render-pipelines.universal@11.0.0/Shaders/2D/Sprite-Lit-Default.shader to edit
Change line 89
o.lightingUV = half2(ComputeScreenPos(o.positionCS / o.positionCS.w).xy);
Let me know if this works for you or if you need more help.
Ah, thanks for this. I tried to get the package locally before but didn’t manage it. I’ll give this a go.
That seems to work great, thanks. The editor seems a lot slower, a lot of slowdowns in gameplay, but that’s most likely a completely separate issue. (Builds run fine)
FYI - I installed the latest version (2021.1.22f1) and (for both of our workstations) playing the game in the editor was unplayable. Rolled back to 2021.1.20f1 and it’s working fine again.
Not sure this is a known bug, just throwing it out there. We’re totally up against it at the moment so no time to try get a simple repro to raise a bug report I’m afraid.
@kennyy , can you confirm that this fix will make it into a 2021.1.x release (or not)?
is this still the way to fix the lights in perspective camera?
My lights are all over the place in Unity 2021.1.17f1
Worked for me in 2021.1.19f1
@laserDogRob Thanks for confirming the local fix!
@kayroice Yes, I can confirm the fix will make it into the next packaged release 2021.1.24. Unfortunately, I cannot give you a release date.
@RuneShiStorm Please be aware that this is a local only fix. I would still recommend removing the copied package and updating to the new release once it is out.
any date when its out? - I see you cant give relase date yet. Thanks!
I, like some other users are ready to launch game but can’t due to the light -glitch :S
thnkas!
I just upgraded to 2021.1.24 and my 2D lights are still broken when using a perspective camera; this is using the URP-11.0.0 package.
I didn’t see a 2D lighting fix mentioned in the 2021.1.24 release notes (maybe I missed it?). @kennyy , do you happen to know if the fix missed the 2021.1.24 release, and if it’s maybe scheduled for a later release?
@kayroice It looks like the fix didn’t make it to 2021.1.24 release. I will check the release schedule and update this thread once I find out more.
any update on this? hope the fix makes it in the next release… really looking forward to starting lighting and LD with perspective cams.
[EDIT] Sadly light’s still seem broken on 2021.1.25f1.