Search Unity

2d day and night cycle

Discussion in 'General Discussion' started by vertigostudios, Dec 11, 2019.

  1. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    101
    Hi Guys, I'm looking to hire a programmer to work on a 2d day and night cycle. However - I'm not entirely sure which is better suited and what kind of questions to ask.

    Would a total image replacement work better which is run by code or some kind of shader for the effect instead.

    The intended prototype would be from a top down perspective. Lastly, I would prefer to the day and night cycle to blend from one to the other over time.

    Any help is greatly appreciated.
     
  2. iamthwee

    iamthwee

    Joined:
    Nov 27, 2015
    Posts:
    2,149
    This sounds like some shader magic @Murgilod can work her magic on perhaps. IIRC @angrypenguin was doing something with a day night cycle as well, though not sure if it is applicable to your example.
     
    Last edited: Dec 11, 2019
  3. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    101
    Thanks!
     
    iamthwee likes this.
  4. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    Probably post processing could help achieve desired effect.
     
  5. vertigostudios

    vertigostudios

    Joined:
    Oct 1, 2012
    Posts:
    101
    Ahh ok, so I assume that post processing can be controlled by script ?
     
  6. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,778
    ADNCG likes this.
  7. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    10,155
    I'm currently elbow deep in a big project so I can't help a super huge amount, but what I'd do is set up a LUT for dawn, afternoon, sunset, and night; set up a shader to lerp between these at the appropriate time; then apply the lerp'd value to an image effect. It's not a terribly elegant solution, but it's a rough approximation of what I'm doing right now since LUTs aren't terribly computationally expensive.
     
    iamthwee likes this.