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. Dismiss Notice

Question Materials turn textures white or black.

Discussion in '2D' started by Amoebozoa, Oct 8, 2023.

  1. Amoebozoa

    Amoebozoa

    Joined:
    Jun 2, 2015
    Posts:
    19
    My problem/Issue is as follows, attempting to add a material to any block other than a colour, will result in a white or black rendering.

    Now I will start by saying that I have tried to figure this one out over the course of several days and multiple hours, I have looked at 10+ tutorials and even copying that, I can not get it to work.

    I have created a new project in URP, but the results remain the same. I can't for the life of me figure this out and I am about to go insane trying to fix this.
    I have no idea what I am doing wrong, but I feel like I am missing something basic and I have ran out of ideas on how to fix it, other than just giving up.

    I have attached some screenshots showing the settings I am currently using on my materials. And one that shows the material, in which I only swapped it's colour, the one that for some reason works. Basic information.png Colour Sprite.png

    Any ideas as to what I might be doing wrong would be really appreciated.
     
  2. sildeflask

    sildeflask

    Joined:
    Aug 16, 2023
    Posts:
    158
    maybe you dont have a light, no light will make a lit shader black always, a strong light will make it white always

    you should start with an unlit shader maybe, and try from there
     
  3. Amoebozoa

    Amoebozoa

    Joined:
    Jun 2, 2015
    Posts:
    19
    It is a 2D game, even with the 2D URP shader that's lit, it still shows up white.
     
  4. sildeflask

    sildeflask

    Joined:
    Aug 16, 2023
    Posts:
    158
    if its 2d or 3d it doesnt matter

    anyway what you should put in your material is a shader called sprites default unlit

    if you want you can post your sprite square and we can see whats going on
     
  5. Amoebozoa

    Amoebozoa

    Joined:
    Jun 2, 2015
    Posts:
    19
    Thank you for your help, sadly it doesn't appear to make a difference.

    This is the unlit sprite material, it does not make a difference.
     

    Attached Files:

  6. Cornysam

    Cornysam

    Joined:
    Feb 8, 2018
    Posts:
    1,343
    So the only thing i can think of is that your shader is set to URP/2D/Sprite-Lit-Default. I just tried this as a test in my URP project and it works with the typical URP/Lit shader. When i turn it to the shader you are using, URP/2D/Sprite-Lit-Default, i get the same issue. I guess just try changing your material to the URP/Lit shader.

    As a test i just did, that 2D/Sprite-Lit shader does work if it is an Image or Raw Image from the UI objects.

    So TLDR, URP/Lit for 2D objects, URP/2D/Sprite shader for UI Images/Raw Images