Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    Dismiss Notice
  2. Unity 2020 LTS & Unity 2021.1 have been released.
    Dismiss Notice
  3. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Choosing right shaders for small light in darkness effect.

Discussion in '2D' started by Kamajabu, Feb 14, 2016.

  1. Kamajabu

    Kamajabu

    Joined:
    Feb 14, 2016
    Posts:
    3
    Hey,

    I fought with this for several hours and just had enough, so I beg for your help :p

    I'm trying to make a scene when everything is hided in dark and player moves light to discover his surroundings and play where and how to move. I've succeed to do that by using 3D boxes and light built-in in unity and then just rotate it to 2D aspect, but as expected Android said "no-no" to CPU usage.

    Now i'm using 2DLightAsset from Asset Store https://www.assetstore.unity3d.com/en/#!/content/24083 . Problem is it's creating a solid light, and where shadow is supposed be there is just bare background. Putting it in simple word - I would like to revert it. Make everything dark, and only place visible where mesh renderer from 2DLight is.
    I've managed to do something similar by darkening whole scene in Lightning->Ambient Intensity and then using Particles -> Multiple (double) on light but this isn't enough. I would like to get a effect when shadow is completely dark and items hided in it invisible. Or just black shadow so i'll make walls black too and that's how I'll hide them.

    Is it possible to make some black sprite and cutoff shader on light? How?


    Thank you for your help Unity Knights :D dark scene.png
     
    Last edited: Feb 14, 2016
  2. vakabaka

    vakabaka

    Joined:
    Jul 21, 2014
    Posts:
    1,154
  3. Kamajabu

    Kamajabu

    Joined:
    Feb 14, 2016
    Posts:
    3
    Cool site, thanks for the link :D

    Still that wasn't exactly what I was looking for, anyway I found an answer, I've had to use custom shaders. Programmed my own light system too. If anyone occur similar problem they can find very nice video tutorial here (whole channel is great):
     
unityunity