Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Using URP 2D Sprite-Lit-Default makes the texture black

Discussion in 'Universal Render Pipeline' started by Snackmix, May 28, 2020.

  1. Snackmix

    Snackmix

    Joined:
    Apr 3, 2013
    Posts:
    36
    I'm working on creating a tile map out of using a mesh. I've created the mesh, and triangles and was working on applying textures.

    I had everything working correctly with random colored pixels being applied as the texture. Everything looked really dark, and adding lights didn't help. I decided to switch and give the URP a shot to see how things would look using 2D lights.

    The texture is still being applied the same way, but instead of a normal diffuse it is now a URP/2D/Sprite-Lit-Default, and the entire texture appears black on the mesh. The texture is still being generated and changing appearances in the editor, just not being applied to the mesh correctly.

    I have attached a picture showing the current texture, and then the black in the screen. Any help would be greatly apprecaited!
     

    Attached Files:

  2. volvis

    volvis

    Joined:
    Jan 10, 2013
    Posts:
    11
    You possibly forgot to add 2D environment light. 2D lights != 3D lights.
     
    RascarCapack and eliteCompiler like this.
  3. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    You need to add a global light to your scene.
     
  4. choijaeyoung

    choijaeyoung

    Joined:
    Feb 8, 2020
    Posts:
    13
    If you had a global light and still have the same problem--it's probably because Target Sorting Layer in the Light Source 2D did not include the layer which is assigned to sprites that appear in black. That's what happened with my project.
     
  5. VuirenEva

    VuirenEva

    Joined:
    Dec 4, 2017
    Posts:
    1
    Thank you so much!
     
    shashankrisal and Snoozed like this.