Search Unity

  1. All Pro and Enterprise subscribers: find helpful & inspiring creative, tech, and business know-how in the new Unity Success Hub. Sign in to stay up to date.
    Dismiss Notice
  2. Dismiss Notice

Help Wanted Using URP with 2D Shader and Quad material?

Discussion in 'Universal Render Pipeline' started by dannyryba, Aug 20, 2020.

  1. dannyryba

    dannyryba

    Joined:
    Jun 22, 2020
    Posts:
    45
    Hi everyone - hopefully this is the right place for this question. I'm having some difficulty understanding how I can get a 2D shader material (sprite-default-lit) to work with a Quad. I'm very new to working with any sort of lighting so apologies if this is a dumb question.

    I currently have my background mapped to a quad so that it can scroll as the game runs. I also want some light sources to affect it. However, when I add another material I get a warning from Unity about multiple materials and the background does get affected by lightning, but turns black with the image not shown anymore. How can I get around this so that I have a visible background that is affected by lighting that also scrolls as I want it to?

    My Inspector:


    Thank you in advance!
     
  2. dannyryba

    dannyryba

    Joined:
    Jun 22, 2020
    Posts:
    45
    Bumping this to hopefully get some help.
     
  3. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    335
    I suppose the 'background' shader is where you implement the scrolling? In that case if you also want lighting you'll have to implement your scrolling logic in a sprite lit shader graph, and use that one shader/material instead of trying to stack two materials.
     
unityunity