Search Unity

Help Wanted Getting and using 2D Light data in Shadergraph?

Discussion in '2D Experimental Preview' started by GliderGuy, Oct 16, 2020.

  1. GliderGuy

    GliderGuy

    Joined:
    Dec 14, 2018
    Posts:
    246
    Has anybody successfully obtained and used 2D light data from the 2D Renderer in Shadergraph?

    I tried it myself, but I wasn't sure what to do with the data from _ShapeLightTexture0 (0,1,2,3) once I had it. I tried plugging it directly into the output after fiddling with it for a while (to no avail), and all I got was grays and whites on entirely different sprites.
    What I found odd was that the _ShapeLightTexture didn't seem to relate at all to lights in the scene. (Sprites were always completely one color, and the color never changed, EVER, even when they moved around).

    Not sure what I am doing wrong, I followed all of the steps from this thread (and did some of my own additional searching), but if there is anyone out there that has successfully used the 2D light data to make there own SpriteLit shader, would you mind throwing me a bone?

    I'd really appreciate it.

    EDIT:
    I am just now finding the "Alpha Blend on Overlap" option for the lights — I feel like a bit of a dunce, ha ha.
    Anyway... for the time being, Alpha Blend on Overlap is more than enough to satisfy me. I'm just surprised the docs don't give examples of what it does!
     
    Last edited: Nov 15, 2020
unityunity