top of page
HOW TO QUICKLY SET UP HDRI LIGHTING AND A FLAT BACKGROUND COLOR TO DISPLAY MODELS IN UE4
As a game artist, it's useful to be able to show off your models in an actual game engine. But if you're like me, you've hesitated because you can get it looking so much better in Keyshot, Marmoset, Substance Painter, and other tools that have easy HDRI lighting and reflections.
Well this tutorial will put in-engine presentation back on the map, because you'll finally be able to set up HDRI lighting in Unreal 4 quickly and easily!
Oh, and UE4 doesn't have a background color option, so I'll mention a workaround for that, too.
Click on the image thumbnails next to the descriptions to follow along visually. Also, I have no idea if there's a difference between "HDRI" and "HDR," so I use those terms pretty much completely arbitrarily and possibly totally wrong.
Also, some steps are not specifically labeled as a step, so beware.
STEP 1: Start by creating a new default level in an Unreal 4 project. Or create a blank level; I basically delete everything in the next step anyway.
STEP 2: File > Save As to save your level. Give it a name and location that makes sense, like in a Maps folder. I'm using a project for displaying different models, so I'll save it in my "SNES_Controller" folder, since that's where my model and textures are.
STEP 3: Delete all the scene objects so you just have an empty black level.
First we need a background so we can see things we place in our level. Drag an Exponential Height Fog into the scene.
STEP 5: With the new fog selected, change the Fog Inscattering Color to a dark gray. (Or whatever color you want your background to be. It helps to have the sRGB box checked to pick your color accurately.)
STEP 6: Place your textured model in the scene. If you don't have a textured model, you'll just have to give up.
STEP 7: Drag a Sky Light out into your scene!
Now we need an HDRI lighting image to use for the environment. Unreal can do it a couple ways, but I prefer using a Lat/Long HDR layout, because it's like stupid easy. Who knows if this website will remain available, but at the time of my writing this, you can download a few awesome ones here: http://gl.ict.usc.edu/Data/HighResProbes/
For this demo I'm going to use the Grace Cathedral one. If you use one, Download the .HDR format.
A Few Tips on Using HDRI in Unreal 4:
1. In order for it to work, it must be saved as the .HDR (Radiance) format. You can use .EXR files, but you have to convert them to HDR in Photoshop before bringing them into Unreal, or else they will be interpreted as a cube map, which can get the same results but requires some layout trickery. So if you have an EXR, simply open it in Photoshop, save as HDR, and it's ready to use in UE4!
2. These images don't need to be huge. Many HDRI images you download will be captured to accommodate film work and other massive-resolution projects. We humble game artists need not such extravagance. The Grace Cathedral image I just downloaded is only about 3000x1500 pixels, so that's actually okay, but some packs have images up to 10,000px or more, and that's mega overkill. I'm gonna reduce mine to 1500x750 just so I can feel like I'm resisting the system.
3. If you have Substance Painter, all the HDRI environments you can use there are stored as EXR images. If you find them and save them as HDR files you can use them all to show off your textured models in Unreal in nearly the same lighting environments you used to texture them! Hyper legit.
STEP 10: Import your HDR file into Unreal. Put it somewhere that makes sense, not like how I'm just tossing it in with my model textures. These files can take a little while to import, so don't be surprised when it seems like your computer has frozen for a minute or so.
STEP 11: With your SkyLight selected, change the Source Type from "SLS Captured Scene" to "SLS Specified Cubemap."
STEP 12: Drag your HDR image into the Cubemap slot. Presto! The scene is lit! Your model should be looking good and reflecting things nicely.
STEP 13: Our background looks good until we look up and find it's all dark above the horizon, and we remember that we're using weird height fog since Unreal doesn't currently have a simple background color option.
To fix this, select your ExponentialHeightFog and change the Fog Height Falloff to 0.001.
STEP 14: You'll want to lock the exposure so it doesn't randomly darken and lighten the image on you, especially if you're going to be taking a sequence of screenshots, like for a turnaround. Go to the Lit menu thing at the top of the viewport, select Exposure, and set it to Fixed at Log 0. You might have to move the camera a little for the scene to update.
Your scene is lit and you're ready to take some screenshots and show your model! Here are a few tips to help you get it ready to take some screen captures:
1. Press G to toggle visibility of all the helper junk, like the grid and object icons.
2. Press F11 to toggle full-screen view. Great for bigger screenshots!
3. With your model selected, press F to center the view on it. Then you can alt+LMB drag to rotate around your model and keep it centered.
4. To get rid of the move/rotate/scale gizmo, either click on an empty spot in the World Outliner, or just select the root Level object and the gizmo will disappear. (This is more of a problem when your scene is full of stuff and you can't click anywhere without clicking on another object)
5. You can control the brightness of your SkyLight by changing the Intensity value, and remember you can control your background color too. Balance them out and make sure you have a pleasing or neutral environment that doesn't detract from the colors and values on your model! When in doubt, a dark gray background is usually safe.
6. In the SkyLight settings, there is also a switch called "Lower Hemisphere is Black." This can really help or hurt your model, so try it both ways! I usually leave it turned off so I get the full HDRI lighting, but for this model I'm actually liking it on.
7. Try out a couple different HDR images in your sky light. I like to be surprised at the different looks that each environment can create!
If you're happy with what you have so far, there's no reason you can't stop here and start showing off your amazing models! But we can still have much more control over the look of our model, and you'll often run into cases where the HDRI sets a mood you like, but it doesn't quite make a certain important surface pop enough on your model, or maybe there's a surface that has really cool bumps so it needs to be hit by a strong light from the side. There are many situations where you'll want to control the lighting better. The following are two additional techniques I use when presenting my models in, literally, the best light possible, without losing a ton of time to rendering, compositing, and post work.
Rim Light: One simple effect that often makes a model look great is to add a subtle falloff glow to simulate a rim light. We can make a similar effect very easily in the material editor, if your model isn't currently using the Emissive slot. If you're using Emissive, you can either look up how to combine them using an Add node, or just forget about it and do it with a couple actual lights.
1. Create a Fesnel node, as pictured above.
2. Create a constant, set it to 15, and plug it into the Power slot of the Fresnel. This will be the Falloff Range that controls how tightly the rim light stays to the edges. A lower number will make the rim light thicker, and a higher number will make the rim light thinner just on the very edges of the model.
3. The Fresnel automatically outputs pure white on the edges, so we need to darken the output a little. Plug the Fresnel Result into a new Multiply node, and multiply it by a new Constant of 0.3. Now the edge light will only be 30% as bright as it is by default. You can adjust this new constant to make the rim light brighter or darker. (You can also use a 3-Constant to be able to pick a color for the rim light)
4. Plug the output of the Multiply node into the Emissive Color slot (or into an Add node to combine with your existing Emissive information, and then plug the result of that into the Emissive Color slot). The final result can be very subtle or very stylized, depending on the constants you use.
Well, as you can see, it looks like pretty much trash on this setup. I guess a hard rim light doesn't make much sense with a soft warm environment. WHAT WAS I THINKING!? UGH! IDIOT!!!! But sometimes it looks awesome, and it's really easy to set up, so I figured I'd include it.
Custom Lighting: Finally, you still can create any lights you want in your scene to add to it! If you combine a base HDR environment with good custom lighting, keeping good lighting theory in mind (key light, fill light, back lights, and obviously tons of kickers for pizzazz!), the sky's the limit with how unique and amazing you can make your model! I'm not the greatest lighting guy in the world, but if I pretend to know what I'm talking about at least I can maybe trick myself:
1. If you want to add your own lights, start by darkening your Sky Light to 0.5 or 0.7, or else the lighting will get blown out. Then add Point Lights to the scene, or Spot Lights if you prefer.
2. Just like when painting, only use white light very sparingly for small highlights and making details pop near your focal point. Otherwise, use colored lights, keeping the colors subtle. Or go all out and just blast everyone's eyes out like a 1980's music video!
3. Use large or long lights to create soft shadows and interesting reflections! To change the size of your lights, you can change the Source Radius and Source Length. Changing them can make your light dimmer, so you might have to turn up the intensity to get the brightness you want.
4. For some especially subtle fill lights, shadows can be distracting, and it's better to simply turn off the Cast Shadows setting.
5. Notice in the following comparison shot how adding a few custom lights can help demonstrate the surface of the model. The mood is basically the same in both, but look at how much better the surfaces are described in the custom-lit version to the right. Notice the gradient from top to bottom along the controller face; in the other one it just looks flat, but now the surface curve is really coming through. Plus, the little orange and blue lights on the edges are just fun touches! My lighting is by no means professional or technically excellent, but if it helps communicate the surface of my model more clearly, then it's good enough for me!
Here, at the end of all things, check out some of these lighting setups I quickly made just by replacing out different HDR images and tossing on a few quick point lights. Unreal 4 is an excellent tool for instant
high-quality model visualization, and if you want to put more time into it, the looks you can achieve are endless, even if you only have just a few different HDR images.
The end. Thanks for reading, and good luck!
bottom of page