Search Unity

In the previous blog posts in this series we have looked at the team that created The Blacksmith, and the art production process that established the short film’s aesthetic. But now we turn our attention to more technical matters, as we consider the project’s production in Unity 5, here focusing on scene setup, shading and lighting.

Engine versions and dogfooding

The production of The Blacksmith was done on early alpha- and beta-versions of Unity, and was stabilized on 5.0.b22 to ship. The project has since been upgraded to the shipped version of Unity 5.

Using an engine in constant development involves instability and leads to some inevitable inefficiency when it comes to content production. We faced the weekly dilemma of whether to upgrade to get the fixes in the new version, or to skip a version to avoid disruption of the team’s work.

In addition, the sequencing of cameras and animation in The Blacksmith was based on Director, one part of the Storytelling set of tools in Unity, which at that time were in a very early stage of development (and still don’t have an announced release date). Getting this functionality into our project involved regular merges to the main Unity 5, which continued from about halfway in-production until we shipped.

As a content-production team at Unity, we communicate bugs and feature requests to the relevant development teams, and then usually keep our fingers crossed that they will be fixed quickly or implemented at all. If they aren’t, we workaround through our own solutions. Our feedback is weighed against the needs of the larger Unity userbase and we don’t usually get any prioritised treatment.

Scene setup

At the start of The Blacksmith’s production stage, we whiteboxed the scene in Unity.

whitebox_01

Using packages from the Asset Store, such as Better Rocks and Cliffs by Quantum Theory, was very helpful for prototyping, and ensured we were able to start working on look development very early on. We quickly achieved a rather detailed result:

BeachWhitebox_02Following our storyboard, which we did during pre-production, we did a first iteration of the cameras, loosely approximating the desired shots. Based on that, we were able to break down what assets needed to be produced for each shot. At that stage the 3D art for the characters was already in progress.

It was important for us to have as much artistic control per-shot as it would be possible. Therefore we extended the Unity Editor with a Scene Manager, which allows us to group objects per shot. We use it to enable or disable certain objects, or change their properties – location, scale, material and so on – only for a specific camera, in order to get a better shot composition. In the same way, every shot can have its own, specific light setup, and thanks to the realtime global illumination we have instant change of the lighting from shot to shot.

scene_dress

Shading

Unity’s Physically-Based shading system is fairly straight-forward to use and set up.

It was employed throughout the entire project. Since we didn’t scope this project to include the development of a proper skin shader, we used the Standard shader even for that:

challenger_01The Challenger – Screenshot from the Unity Editor

One of the great advantages of the Standard shader in Unity 5 is that it is meant to be extended and modified for the specific needs of any project. The source of the Standard shader can be downloaded from here: http://unity3d.com/get-unity/download/archive (under the ‘Downloads’ dropdown for the appropriate platform, select ‘Built in shaders’). Building project-specific shaders on top of it is quite straightforward, and we did it a lot on The Blacksmith. We will share some examples below.

We modified the Standard shader to make it aware of the custom shaders we have added to the project. We used two versions of this modification: one for the environment (e.g. it is aware of our atmospheric scattering) and a more complex one for the characters (which is also aware of our unique character shadows and wrinkle maps). The latter has a slightly enhanced UI, with sliders for the specular map.

CharacterShader_UI

To give the Challenger’s face some extra life and detail, we decided to develop a solution for blendshape-driven wrinkle maps. Based on the influences of the most prominent blend shapes at any time, we mixed together multiple normal and occlusion textures in a screen-space prepass. This was then fed directly to a Standard shader variation that sampled and unpacked normals and occlusion from this screen-space buffer instead of the regular material slots.

challenger_wrinkles3

The Standard shader is awesome for a wide range of real-world materials, but hair is, unfortunately, not one of these. Although hair rendering was never a primary focus area for The Blacksmith, we did want to ensure we had those characteristic anisotropic highlights for hair, while still integrating properly with the physically based environment used by the other materials. To achieve this, we modified a Standard shader to use a different reflectance distribution model, but left the sampling of reflection and light probes intact.

hair_01Hair shader – Screenshot from Unity Editor. Click to see full size.

We also wanted to have soft vegetation in some of the shots, as well as an easy way of painting varied vegetation in the scene. The solution was a two-stage process extending Unity’s builtin vegetation features. A small tool, PaintJob, automated the process of shrink-wrapping any static geometry in the world with a temporary terrain. Combined with a simple ruleset controlling the wrapping, this allowed us to paint vegetation layers on ground meshes, around structures and on rooftops. For rendering, we then captured this painted data into a custom component for handling view-dependent sorting, sampling dynamic GI and managing culling and LODing.

vegetation_01

vegetation_02

Lighting

We used different layers to separate the lighting for the characters and for the environment, and assigned the respective culling masks to lamps. This way we had better control over both, taking a similar approach to what is usually done in filming, where specific light conditions are set up with regard to the presence and position of characters in the scene.

To improve the look of the characters, we used additional small local light sources to soften the shadows (unlit parts) on their faces.

LocalLights_01

As our characters are very prominent in the demo, and we have lots of close-up shots, it was very important to make sure that they could receive shadows with reasonably high resolution. For this reason we added a separate shadow texture dedicated only to the character shadows.

uniqueShadows_01

The light in the smithy interior was intended to look like it was coming from holes in the walls and roof. This effect is achieved by a cookie with an appropriate pattern.

SmithyLighting_02

For the ocean and beach puddles, we wanted reflections that would provide sharp contacts where objects penetrated the reflective surface, while growing more diffuse as the distance from reflector to receiver increased. What we ended up building was something similar to water reflections, but with a depth-aware convolution step setting up data for variable surface smoothness. Again, the output for this system was fed into a Standard shader, this time replacing reflection cube maps with our custom reflection texture.

PlaneReflections_04

In the next piece in this series on creating The Blacksmith we’ll move on to exploring the way the Demo team approached post process, animation and audio/video production. So be sure to keep an eye out for the next post over at our special dedicated page for The Blacksmith.

25 Comments

Subscribe to comments

Comments are closed.

  1. Nice, I have a Doubt How did you build Unity file as a Video file?

  2. I am no longer positive the place you are getting your information, however good topic.
    I must spend some time finding out much more or figuring out more.
    Thank you for magnificent information I used to be searching for this info for my mission.

    My page SuzanWBlomstrom

  3. i really like this, a lot of things we can learn form this project. my question is how many poygons in blacksmit project and how do u handle this type of heavy projects.

  4. Simone Dunzendorfer

    June 25, 2015 at 8:20 pm

    There is no documentation on how you did the hair, is there?

    1. Veselin Efremov

      July 1, 2015 at 9:46 pm

      There is a Readme file in the package:
      https://www.assetstore.unity3d.com/en/#!/content/39945

  5. One one hand it is great that you can write all these tools by your own and that Unity is so expandable – I really like how smooth engine expansion goes. On the other hand, the amount of tools required to create this demo shows how many features are lacking in pure Unity. Competitive engines have a lot of these already integrated.

    Anyways, great work on the demo. I really like art style and visuals.

    1. Veselin Efremov

      June 18, 2015 at 2:28 pm

      Most games build on top of what an engine has to offer, as every project has its own specific requirements, after all.
      In The Blacksmith, all the new graphic features were developed by a single programmer (and that was only a part of his duties), as the engine is so easy to build on.
      That being said, I agree that it’s important to have more general-usage stuff out of the box – things like atmospheric scattering, unique character shadows and vegetation tools, for instance.
      Integrating these in the engine is much, much harder and time-consuming than developing them for a specific project on top of Unity, so it just takes time.

      1. Michal Piatek

        June 19, 2015 at 1:37 pm

        I totally agree. There will always be some project specific features that requires additional work. Now it is much easier than ever before (command buffers, exdended API, Mecanim, GI). There are still some tools that I would perceive as “fundamental” that are lacking in Unity but we are no longer hitting the wall as it were back in 3.5 for example :) Unity is fun and it’s heading in the right direction.

        1. Simone Dunzendorfer

          June 25, 2015 at 11:54 pm

          I totally agree to all of this. Could you put a skin shader on your todo-list well and lighting as in UE?
          I have seen on the SpeedTree forum that a great shader for SpeedTree is already on the way, so there is no need of asking for it again. I only hope it supports AA and SSS so that we are ahead of UE. I know it can be done by the “Advanced Foliage Shader” already offers it. The author of this asset said that he wouldn’t look into SpeedTree stuff because it has its own everything, so I am counting on the Unity devs here. Thank you!

        2. Simone Dunzendorfer

          June 26, 2015 at 12:50 am

          Perhaps you could move this to the forum so that people can edit their replies?

          I wanted to say “AO” instead of “AA”.

  6. Silvia Rasheva

    June 17, 2015 at 11:13 pm

    @all: We’ve promised to release all the custom tech that we can from this demo. We’re on it.

    1. Isaac Surfraz

      June 18, 2015 at 2:34 am

      The fact that your releasing the tech after we have asked you to just gives credence to the fact that you guys are awesome!

      Keep it up guys, today game engine domination, tomorrow world domination!

  7. Hair and Skin Shaders!
    If Unity developers had to modify the dtandard shaders for this project, imagine how the rest of us are suffering without these shaders at all!

    The standard PBR shader is great, but seems to be only convincing when used for hard surface materials.

    CryEngine and Unreal have had Screen Space Subsurface Skin shaders for quite a while that look fantastic. This is one area where Unity is way behind. The engine seems incomplete without these unless all your characters are robots :). It would be nice if the shaders used here were released as at least it is a step in the right direction!

    1. Silvia Rasheva

      June 17, 2015 at 11:34 pm

      We did not make a skin shader for this project. We used the Standard shader for the Challenger’s skin.

      I agree it would be nice to release everything else that we made, and this production was deliberately planned in a way that will allow us to do it.

  8. Bryan Livingston

    June 17, 2015 at 9:16 pm

    I’d love to hear some numbers on how much it cost to make the demo. Could you maybe give the budget and an idea of how much was spent on outsourcing vs. in house costs?

  9. I second the need for a download to the custom shaders, and the paintJob tool. Both sounds really useful.

  10. I think the anti-aliasing in unity is a huge problem. How did you handle that in blacksmith/

    1. Veselin Efremov

      June 18, 2015 at 2:19 pm

      We just used the regular Unity anti-aliasing post effect. Being careful with the assets – adding wear and tear on the edges, dust and dirt, etc., helped a lot as well. Strong fresnel reflections make aliasing really visible, so we tried to avoid that where possible, mainly by tweaking normal maps and smoothness textures

      A much better antialiasing is coming, stay tuned

  11. You mentioned atmospheric scattering. How did you implement this? I assume this involved custom lighting?

    1. Silvia Rasheva

      June 17, 2015 at 11:43 pm

      We’ll make sure to share a more detailed explanation about it.

  12. Please tell me I’m able to download all of this fine custom stuff. I would’nt understand why not. Please integrate it into Unity because we all need a working hair and skin shader, we all need proper Shadows and atmospheric scattering. Please give me a download link!

  13. I’d love to actually get my hands on some of the more complex assets you show off on these demo’s, as Rick says can we get our hands on PaintJob? I’d also love to see some of the hair shaders.
    I’m currently finishing up my own vegetation and hair directx11 shaders and it would of been immensely helpful to have access to some examples from your demo scenes especially considering I’m a long term pro-member and you’ve been touting DirectX11 shaders since the Unity 4 butterfly demo.

  14. Rick Rodriguez

    June 17, 2015 at 3:55 pm

    The post mentions a tool named PaintJob. Is that available for download somewhere?

    1. You can find the PaintJob tool inside the Blacksmith Environment asset, available in the Asset Store: https://www.assetstore.unity3d.com/en/#!/content/39948
      To create a new PaintJob, click the GameObject -> 3D Object -> Paint Job menu item, and its scripts can be found under the Features/PaintJob folder. However, I couldn’t figure out how it works just yet.