• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by SimplyNew · Nov 02, 2020 at 10:04 AM · 2dlightingrenderinguniversal

URP 2D lights not working as expected

Hi,

I am facing a weird issue with 2D lights. Lights are not correctly applied. And another issue is: even if I dont apply light to a layer, all layers are still lit.

Please, see below screenshots. Its a sample scene with only 3 sprites each in different sorting layers in sequence (Background, Middleground, Default). Scene has only one Global Light. When I set target sorting layers to none, light gets applied to all layers. Only when I disable the light from inspector all sprites turn black. Ideally, none target sorting layers should also turn my scene black. Another issue is: when I set specific layer, it doesnt apply to that particular layer. This is just an example of Global Light. Point and Parametric light behaves the same way.

I have also put all sprites in different z position to be sure.

URP Version: 8.2.0

Unity Version: 2020.1.2f1

Material Used for all sprites: Universal Render Pipeline/2d/Sprite-Lit-Default alt text
alt text

Any help would be appreciated.

step4.jpg (155.9 kB)
step1.jpg (115.9 kB)
Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by justincredibleg · Nov 02, 2020 at 03:49 PM

Are you sure you're using the URP/2d/Sprite shader on all of the actual sprite objects? Within your sprite renderer are you setting the sorting layer there? The Layer up at the top of the editor isn't what you're targeting with the light.

Is there a reason you're using 2020 instead of 2019.4? Unless there is a specific feature you need in 2020 I'd recommend using a LTS version of 2019.4.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SimplyNew · Nov 05, 2020 at 05:01 AM 0
Share

Thanks for reply. I am certain that I am using correct sorting layers. Not layers. Please, see below screenshot of background layer sprite. That screenshot also shows the material and shader.

While playing around this, I also found that if I add another Parametric light just sake of keeping it. Everything started working. So, it's not like URP and lighting are not working at all.

I am not looking for any specific feature in 2020. But, since I just started out project and 2020 will likely be LTS by next year spring, I thought let's start with latest. I think my project will go beyond 2021 December for sure.

Before I hit this snag, I didnt have any issues. $$anonymous$$oreover, I am not using any major preview version packages to be on safer side. But, I will certainly keep your suggestion in mind and decided sooner.

alt text

spritescreenshot.jpg (149.5 kB)
avatar image
0

Answer by SimplyNew · Nov 21, 2020 at 01:41 AM

Update:
I tried with different URP versions and looks like this works fine till 7.3.1. Post 7.3.1 all versions have this issue.

Do anyone else has similar issue? I have reverted URP version to 7.3.1 for now.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

303 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Extrange Behaviour with 2D Lights in Universal RP 0 Answers

Universal Render Pipeline use 2D and 3D lights at the same time 0 Answers

Sorting layer ignores 2d lights from the 2d renderer 0 Answers

2D Lights are Opaque on White Background (URP) 0 Answers

,Why universal RP lightings doesn't works on 2D project? 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges