Bringing Lily to life in UE4 – Scott Knapp
Bringing Lily to life in UE4
This project was incredibly fun because I got to work with two other amazing artists who are very talented at what they do. Niyazi Selimoglu was responsible for sculpting/modeling Lily, Marco Tomaselli textured her, and I did the look development/materials, environment setup, lighting, camera work, and final renders in UE4. Niyazi and Marco previously rendered Lily in Maya and Arnold, but I wanted to see if I could bring her to life in real-time.
Because she has gills, I thought it would be sweet if she was a water demon who wants to bring hell on Earth, hence the lava, flames, and embers (so metal). I brainstormed some ideas, and came up with an environment where lava meets the ocean. I love the contrast and the idea of these two opposing elements crashing together.
A little disclaimer before we get started: this setup is purely to get some sick renders and isn’t really good for current gen game lighting because of the amount of overlapping shadow casters.
First, I composed my environment in UE4 using a terrain piece and some volcanic rocks assets from Megascans. Also, I set UE4 to use ray tracing. To use ray tracing, I enabled it in my project settings under Engine – Rendering, then set my targeted RHI to DirectX 12.
The first thing I started with for lighting was my sky. I made a simple material based on the HDR material that Epic made and added a few extra parameters.
After you create your material, right click it and create a material instance (this will be what we apply to our skydome and can adjust the parameters we created in the master material).
For my sky texture, I downloaded one that fit the mood I was going for from HDRIHaven.com, which is an incredible resource of high quality skies you can use to help light your scenes.
The great thing about these skies, is they are a full 32-bits per channel floating point, high dynamic range image. These panoramas were captured at multiple exposures, then combined together to store a ton of lighting data. Using HDRI to help light your scenes is very valuable if they were captured correctly because the light information is much more accurate than a low dynamic range jpg.
I brought my HDR sky into UE4 and set the Maximum Texture Size to my intended resolution (4096×2048). Next, I turned off sRGB, and changed Mip Gen Settings to NoMipmaps. This will ensure that your sky is as crisp as possible.
Next, I piped the texture into the Material Instance I created.
Then, I tuned values to get closer to my reference and get the angle I wanted.
This served as my base to build off of and a quick environment for Lily to live in.
I knew I also wanted to use area lights because they seem to light characters the best when ray tracing for two reasons. One, is I’m able to control the softness of my shadows based on the size of the light, and two, I can use HDR textures in the lights themselves to have more accurate light behavior.
I downloaded this light texture from sIBL: http://www.hdrlabs.com/sibl/archive.html
Using HDRI for lights can give some pretty tasty results. Similar to the sky texture, you have to make sure compression settings are set to HDR and uncheck sRGB. The difference with light textures however, is you actually want to blur them a lot in the Mip settings because of how Unreal approximates things, so set Mip Gen Settings to Blur5.
After getting all my light textures set up, I can actually light!
I matched the bright part of my sky with a simple key area light. You can scale area lights to adjust the sharpness/softness of your shadows. In this case, I wanted my key to have a little bit of sharpness so I changed my Source Width and Source Height to 32. If you want softer shadows, you want the light source to be larger, so you can scale those parameters up to get the desired result. In film, gaffers will use large silks or diffusing sheets to soften bright light sources, so scaling up area lights simulates this effect.
I like to add complexity to my key light side by having a subtle back light that rims the character as well. This gives more shape to the screen left side of Lily around her neck, cheek, shoulder and clavicle.
Then I added a soft light coming from underneath Lily to simulate bounce lighting coming from water since I wanted her to be near the ocean.
Then I added a rim light coming from above to separate the top of her head and horns from the background.
Since I knew I was going to have a really shallow depth of field in my renders, I didn’t spend time making proper lava, but rather had some really hot, orange/red point lights really close to my geo pieces and made fake trails that I knew would help light up the rocks and also create some bokeh in my final renders. I adjusted the source radius and length to have longer strips of brightness
After placing my point lights, I added a really warm rim light using another rect light to help integrate her with the lava.
Next I started working on Lily’s look dev/materials. I was provided some really awesome textures from Marco, but I had to bring them to life in Unreal. I knew I wanted some believable skin, and wanted it to look aquatic, almost like a shark’s skin. To achieve this, I set up a really simple material and used Subsurface Profile as the shading model. First I made a subsurface profile.
Then I made my material:
And finally, piped my subsurface profile into the Subsurface Profile slot:
Subsurface profiles are a way to tell light how to transmit through a surface and at different wavelengths (red, geen, and blue). You can control things like color, depth and world unit scale. This shading model also allows dual specular lobes which helps make skin look like skin because one lobe is your main spec, and the other can serve as oiliness and they work together to make believable shading. I enabled burley and used the mean free path to drive my subsurface. To read up more about it, there’s some dope documentation from Epic on the subject:
These are the settings I used for Lily, but keep in mind there is no one size fits all set of parameters for subsurface shading. Your scale, base color, thickness of body parts, etc. all factor into how the mean free path will have light scatter through your object. Also, because I wanted her skin to look more like a marine animal, mine is pushed differently than someone shading a human.
After I had my master material set up, I made material instances for each element and applied them to Lily.
I was bummed out that I wasn’t seeing the Subsurface effect in areas like her gills and behind her ear as much as I wanted, and started investigating why. It turns out it was because I needed to turn on transmission on each light that I wanted to affect her subsurface.
After seeing what she looked like with proper textures and materials, I kept tweaking my lighting until I was happy, and did some lighting tweaks per camera angle.
For my cameras, I used CineCameraActors so I could better control my focal length and aperture. I wanted Lily to be the primary focus, so I used a pretty shallow depth of field with each camera.
A super quick photography lesson: the more shallow your depth of field, the less stuff that is in focus.
This allows you to keep your main subject in focus while blurring out everything else. The lower your aperture, the more shallow your depth of field. I usually chilled between 1.8-3.5 for my aperture depending on the lens I was using. For focal length, the higher the number, the more pushed into your subject you will be (and the flatter the distortion will be).
So if you have a really small focal length like 12mm, your image will be a lot more distorted and have almost a fish eye look. This also means you will need your camera much closer to your subject, but if you have a high focal length like 200mm, you’ll need your cam further away, and you will have less distortion.
Here’s an example of the same camera location rendered at 200mm, 85mm, 50mm, 12mm to show how focal length affects framing.
I went with focal lengths of 200mm, 85mm and 50mm for my shots.
For Post processing, I kept my tweaks pretty minimal. I adjusted color slightly and enabled more raytracing features through the post process volume.
Here are my final results! Keep in mind all shots had their own individual love with light placement and final touches.