Hello. Is there any progress on the Shadow Caster issue? This is preventing us from using this feature and create problems with a gameplay feature we have.
Thanks.
Hello. Is there any progress on the Shadow Caster issue? This is preventing us from using this feature and create problems with a gameplay feature we have.
Thanks.
Itās getting kinda frustrating now ![]()
Hello, I was waiting for the fix too and I finally fixed it myself. Hereās how:
URP package needs to be embedded in your project so you can modify it. To do this, copy the package from the package folder into your projectās Packages folder.
https://discussions.unity.com/t/743806
In the embedded package find the file LightingUtility.hlsl
Modify the line 68
output.ShadowUV = ComputeNormalizedDeviceCoordinate(output.PositionCS.xyz);
by
output.ShadowUV = ComputeNormalizedDeviceCoordinate(output.PositionCS.xyz / output.PositionCS.w);
The division by .w will correctly render your shadow UV with a Perspective Camera. Otherwise, it will only work with an Orthographic Camera.

Thanks for this! Much appreciated!
I just ran into the problem where 2D lights with a perspective camera stop working as well. The problem specifically occurred when upgrading 2021.1.13f1 to 2021.1.14f1; upgrading from 2021.1.13f1 directly to 2021.1.15f1 has the same result.
What Iām seeing is that 2D lights in the scene view render correctly. Unfortunately, 2D lights in the game view, or in a player build do not renderer correctly.
@Chris_Chu can you have a look at case 1353065? I filed a bug report detailing what I observed. Whatever change to URPās lighting from version 2021.1.13f1 (2D lights work fine) to 2021.1.14f1 is causing the problem to occur.
Iām still seeing the same problem where 2D lights using a perspective camera stop working after upgrading 2021.1.13f1 directly to 2021.1.15f1, or directly to 2021.1.16f1.
Something changed between 2021.1.13f1 and 2021.1.14f1 that affected 2D lighting when using perspective cameras.
@Chris_Chu can you help track down this bug? If not, do you know of someone that would be able to work on this issue (detailed in cases 1353065 and 1354732).
Sorry, I must have missed seeing this thread earlier. The shadow caster in perspective mode was fixed in 2021.2 but had not been backported to 2021.1. It is now backported so it should be out when the next version of URP is released with the editor.
As @flapierrelds mentioned it needed a divide by w. A while back URP core APIās changed which is what caused this breakage.
We are improving our automated test coverage to make sure we can catch things like this in the future.
Iām not sure why perspective lighting would be currently broken. I will check out whatās going on with this when I get your bugs.
Any updates on this?
Having the sample problem here on Unity 2021.1.16f1. With perspective camera all lights look very funky, both in scene and in game view. Depending on camera position/rotation everything changes. But when I make my camera orthographic everything looks dandy in game view. And in scene view all looks fine when I click the 2D icon.
Iām sticking on 2021.1.11f for now. Updating past that breaks the 2D lights system. Weāre close to launch on steam and consoles⦠Sucks really. Maybe weāll add shadows in a future update
I received a reply to one of my bugs (case #1354732) on the issue of 2D lighting being broken when used with perspective cameras. The response was simply that is was a known issue: 1315645.
Just upgraded to 2021.1.18f1 to see if itās been fixed, and it hasnāt.
yup, having the same issue as @kayroice
@Chris_Chu
Was forced to update to match nintendo switch software version and now Um running 2021.1.1.17f1 and its not working with perspective⦠All light are all over the place :S
Any news on a updates coming?
Cheers
Iāve come back to this thread to say the exact same thing. Had to update to 2021.1.19f1. Lights are all over the place.
I donāt think I need to specify more, but can if needed.
I would absolutely love some good news about this as Iām completely screwed as it stands. We need to push a build out on switch for the publisher ASAP.
Thanks
And to add to this, have the shadow casters been looked at at all? Last time I tried to use them they still had the GetComponent in the update method and performance dropped below playable rates.
I can see that itās stated as fixed in 2021.2, however it would be wonderful to see it back ported to 2021.1.x
As 2021.2.x is still in preview, Iām a little reluctant to use it for a game we plan to ship in a month or so
The bug report for this issue, 1315645, canāt be voted on since thereās a fix (2021.2.0a10), but you can comment on the issue. Not sure if that results in increased visibility, but itās worth trying. I just commented asking for a fix in 2021.1.x, more voices wonāt hurt.
@Chris_Chu do you happen to know if thereās an ETA for backporting the 2D perspective lighting fix from 2021.2.0a10 to 2021.1.x?
I will personally send a case of beer (or soft drink of your choice) to the person/team that back ports this to 2021.1.x
I need to do some other backports sometime this week. Iāll take a look.
Do you like beer? ![]()
I also have to port to switch⦠If you update, pls Tag me and let me know how it went.
Becuase; if you update, it might not work with the NDI Interface/Switch Version. Right?
As far as I can tell, the Unity version and the Switch Version need to match?