Get in Touch!

Experimenting with Unity

Posted on 8th February 2013  |   Catagories: 3D, Illustration, Scripting, Unity
12 comments

Last year, I began a several-month-long process of learning to use Unity – a highly accessible, cross platform 3D game engine – with the ultimate goal of exploring it’s potential to create an interactive ‘toy’ along the same lines as Windosill by Vectorpark.

In the process I built a series of experiments, each focusing on different aspects of the engine and all contributing towards a final “proof of concept” design. It’s unlikely that these experiments will become part of a finished project in their own right, so I’m keen to share them here, with a few things I learned along the way.

From Dawn till Dusk

For this first post, I’ve put together a demonstration of the dynamic day/night cycle I developed for the project. From the outset I knew I wanted to play heavily on the use of light and how it changes throughout the day.

Below is an interactive demo, making use of the Unity Web Player, which you’ll be prompted to download if not already installed. It’s a lightweight plugin, and highly recommend – once installed, you’ll be able to play with all the official Unity demos and other user generated content too.

The game clock will automatically tick forward at a rate of 2 in-game minutes per second, but you can also click and drag across the sky to move time forwards or backwards manually. A couple of tips: right click to go fullscreen or click on the windmill to make it to rain!

I’ve also included a few of the birds sprites I developed, which are controlled by some (very) basic AI behaviour – be careful, they’re easily spooked!

A few other notes about the underlying system:

  • The colour/shading of all objects is determined by a single light source, which moves as part of the rotating sky plane.
  • The precise colours for dawn, day, dusk and night can all be adjusted to suit the environment.
  • Other objects and their attributes (such as the stars, clouds, porch light, etc) can also be adjusted depending on the time of day.
  • the overall art style is largely informed by the need to optimise performance across multiple platforms – I’m keen to talk more about the challenges and opportunities this presented, as overall, I’m pretty happy with the result.

That’s all for now – stay tuned!

Edit: I’ve now posted part two, click here to continue reading!

  • Alexander

    Looks quite nice. But that night-sky with shimmering stars, how did you do it? It looks amazing!

    • http://www.harrynesbitt.com/testing Harry Nesbitt

      Hi Alexander, thanks for commenting!

      The way the stars ‘twinkle’ is actually a happy accident, resulting from the lack of mipmapping and each star being smaller than a single pixel – as they pass between pixels, they get dimmer :D

  • Alex

    Man, this is sick! I can rotate this all day long!
    I’ve been wanting to learn Unity for a long time. Now I’m definitely gonna do that.

  • lennartbnl

    How did you achieve this lighting and shading? Any particular plugins or settings?

    • harrynesbitt

      Thanks for commenting! I’m using a modified version of the default toon shader in unity along with a custom ramp. All lighting is controlled by a single directional light combined with a script to adjust colours and attributes based on the time of day. Hope that helps!

      • Ryan

        Any chance you would like to post these assets?

  • http://twitter.com/fffabs Fabio ↬

    Really loving this, I am at that learning stage right now and doing a bit of unity 3ds max and zbrush at the same time, hoping to get a little beta out soon. Have you modelled your own scenario in a 3d package or did you reuse some existing assets?

    • harrynesbitt

      Hi Fabio, thanks for commenting! I built the 3D assets myself using Maya (I’ve dabbled in 3D before – http://bit.ly/Y6Su3Z). I personally found zBrush to be hugely challenging and couldn’t get to grips with it, I’d love to know how you get on!

      P.S. I love your avatar, did you design it?

      • http://twitter.com/stalkbrandon Brandon V. Fletcher

        I found Zbrush to have a higher learning curve. I think Mudbox is a lot more accessible especially if you’re used to using Maya.

        • http://twitter.com/fffabs Fabio ↬

          I agree but I think that’s because of the strange UI in Zbrush and the bazillion tools at your disposal.

      • http://twitter.com/fffabs Fabio ↬

        Hmm I am sure I replied to this yesterday but for some reason is not showing up, silly disquss :) anyway lovely work with 3d as well, and with your illustrations! Zbrush is quirky but it’s really powerful, loads to learn, I am giving myself a few months and see what I come up with.

        Thanks the avatar is my first non-UI work experience, it was made for fun and I did prepare some more for some of my colleagues http://drbl.in/gJtk :)

  • http://www.miletbaker.com/ Jon Milet Baker

    This is great! I look forward to reading about your progress.