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

SimCity BuildIt and a lot of lights

Discussion in 'General Discussion' started by LSPredator, May 19, 2021.

  1. LSPredator

    LSPredator

    Joined:
    Jun 23, 2014
    Posts:
    35
    How did the developers of SimCity BuildIt implement the car lantern effect so that the light is reflected on the buildings? How did they fake it, which allows to display a huge number of fake lights on the screen? And this is on mobiles.
    upload_2021-5-19_23-57-26.png upload_2021-5-19_23-57-59.png upload_2021-5-19_23-58-19.png

     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,745
    I wouldn't be surprised if they're just projectors, or if it's making use of how much it can pack into a material, running in deferred mode, and using pooled deferred decals.
     
    Last edited: May 19, 2021
  3. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,904
    Probably emissive material.
     
  4. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,745
    For the buildings themselves and road lights, sure, but this is about the car headlights on the roads and buildings. My guess is leaning more towards it being deferred decals.
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,904
    Ah, I can't read today... you're right, I slipped over the word car. The lantern effect made sense and got associated with the street lamps.
    Sorry guys.

    I go and get a coffee,
     
  6. LSPredator

    LSPredator

    Joined:
    Jun 23, 2014
    Posts:
    35
    I made some research with RenderDoc.

    There are 4 passes:
    1. Render all light quads from top
    upload_2021-5-20_13-0-14.png
    2. Render objects from underground using texture from pass 1
    upload_2021-5-20_13-0-57.png
    3. Blur texture from pass 2. But I can't find where than they use this texture
    upload_2021-5-20_13-2-5.png
    4. Render final scene. Buildings using texture from pass 1
    upload_2021-5-20_13-2-38.png
     
  7. LSPredator

    LSPredator

    Joined:
    Jun 23, 2014
    Posts:
    35
    Can anyone reproduce this technique in Unity?
     
  8. MadeFromPolygons

    MadeFromPolygons

    Joined:
    Oct 5, 2013
    Posts:
    3,875
    Unsure, but probably important to realise that this game is made in marmalade game studio, not unity, so there are going to be fundamental differences in terms of how you would go about achieving it.

    Unfortunately marmalade game studio no longer is available for download so its probably going make reverse engineering their graphics etc more difficult than it would have been if it was available.
     
  9. neginfinity

    neginfinity

    Joined:
    Jan 27, 2013
    Posts:
    13,321
    Yes, but you'll be better off asking for that in commercial collaboration as this is not very interesting.

    Based on your breakdown, what they do is likely this:

    1. Render light blobs onto render target. This one acts as a "glow texture"
    2. Project render target onto the scene using planar projection. Basically they stretch the texture onto the visible part of the world, using X and Z as U and V respectively. With scale/offset.

    The blurry texture is likely used for screen reflections or something similar.

    This is definitely doable in unity.

    The caveat of this appraoch is that passing cars will light up building from the first to the top floor, even if that building is a skyscraper. I.e. rather than being a "light point" a car will act as a "light column". You can notice this happening on the video.
     
    LSPredator and JoNax97 like this.