Texel Density for game art
Learn the process of using Texel Density to make your assets look great in game engines with 3D environment artist, Tim Diaz
What is Texel Density? Texel Density is the procedure of making sure your meshes and textures are the proper height, width and depth. Now once you apply your working textures and materials, your model's textures will look crisp and clean and not blurry. For this tutorial, we will be using 3ds Max and UDK to create modular pieces with appropriate Texel Density.
Understanding Texel Density and why it's important
Before we jump into this tutorial, we need an understanding of why we are doing this. Textures make the asset, area, level, characters and so on look a certain way and more believable to the player. Many games, however, break this suspension of disbelief by having certain assets break Texel Density.
So how can you find it? It's easy: load up any game and just run around your favorite interior or exterior. If you're outside, look at the terrain, and then look at a rock or a wall. You may see that one, two or even all these pieces look vastly different. One piece may be very crisp and clean, but right next to it is a rock or a wall that looks a little burry, or maybe stretched, or both.
This issue, while it may be minor to most, can distract a player, making them realize they are just playing a game. You don't want that. You are selling an experience – that is always the goal. Something like this leads to bad screenshots, negative feedback, and in some cases shows a lack of pride in your work. While there are always situations where you don't have a choice, or it wouldn't make much sense to follow these guidelines, this is to help you know what to look for and to avoid this issue as much as possible.
Setting up 3ds Max
First off we need to set up our 3ds Max software to work with UDK, so we can build with as few issues as possible. First, go to the top of your Menu and go to Customize, then click on Units Setup.
Setting up 3ds Max II
Once in this new window, make sure that your unit setup is set to Generic Units. These are the standard units within 3ds Max.
Setting up 3ds Max III
Once in this menu, under System Unit Scale, set the units to 1.0 and Inches. Once you have done this, you will now see that our grid settings in every orthographic view all equal 1 foot.
Understanding grid sizes
With our unit systems set up, we can now make assets that are engine scale, and we can use this scale to help determine how big we need to make our textures so they will look good from any distance. So, as mentioned in the previous step, one grid unit is equal to one foot. However, when you make a mesh, it's not going in feet, it's going in max units. So what do you do? Well, first we need to find out how many max units equal 1 foot. By taking a character from Unreal and loading it into 3ds Max, the most common size is a character that equals 8 grid units – so 8 grid units means that the character is 8 feet tall.
So let's create a box. If we build a box to fit one 3ds Max grid unit, its unit size is 16. So with that, 1 foot equals 16 units. 2 feet equals 32 units and so on using the ‘power of two' rule. With this in mind, create a box that has a height of 8 feet with a width of 16 feet, and a depth of 4 feet: 128 units x 256 units x 64 units.
Preparation to setting up your UVs
Now that the box is made, how can you start figuring out how big you should make your texture? The most common rule to go by is for every 1 foot, you have 128 pixels. So to have a 1 x 1 x 1 asset look good when you walk right up to it, you would need a texture that is 128 x 128 pixels. In our case, with the box we made, we would need a 1024 x 2048 texture. The depth can fit into the texture, since there is more than enough space. To help you along, here is an easy breakdown for you all. Remember that these are for UDK units; game engines such as Crytek, Hammer, Radiant and so on all have their own systems. For UDK use this breakdown:
• 16 units = 1 foot = 128x128
• 32 units = 2 feet = 256x256
• 64 units = 4 feet = 512x512
• 128 units = 8 feet = 1024x1024
• 256 units = 16 feet = 2048x2048
• 512 units = 32 feet = 4096x4096
As you can see, these are all powers of two. For those who are new, all game engines revolve around ‘powers of two' for textures. It keeps calculation simple and textures are easier to work with than having random numbers everywhere. Also, you may notice that all of the texture sizes listed are all squares. This is because most game engines tend to take texture sizes and make them square if it isn't already. While some now accept rectangles, having it squared can lead to fewer problems down the road. So does that mean everything has to be a perfect square? Of course not! You do whatever works best.
Another issue that may come up: "I went ahead and made a square texture, but my rectangle UVs don't fill it up all the way. Should I just leave all this empty space in my texture page?"
Yes, you can, but so you don't waste so much empty space, share your texture with another asset so you can fill it with as many assets as possible to get the most out of it.
Creating UVs (the wrong way)
For the sake of knowing what is good Texel Density and what is bad Texel Density, take the wall you just made and duplicate it. Move it to the side and we will set up one correctly and one incorrectly.
As you can see in the image, I have added a blue box to represent 4 feet. So with that as a guide, let's look at a bad unwrap. We are looking at one side of the wall. I have set my UV unwrap screen to go full 4096 x 4096, and have a texture with the proper sizes. As you know, our wall is 1024 x 2048. However, if you look at the wall, it's stretched to 4096 by something in-between 1024 and 2048. This will come in stretched and warped. And if we look at this shot with a checkerboard pattern, these are not perfect squares. This is the easiest giveaway that your texture will come in looking odd, and that it doesn't have proper Density.
Creating UVs (the right way)
To make it easier to understand, I have made a texture in PS that is 4096 x 4096, and in it I have made proper texture sizes of all the sizes mentioned in the breakdown. So let's select the other wall and unwrap it properly. I have grabbed the front face of the wall, and since we know the front is 8 feet by 16 feet, it has a 1024 x 2048 pixel size. Match the UVs to the texture as seen in the image. If you go into checker mode, you will also see the squares are perfectly equal.
Another way to do this is to use your grid and cut UVs to their proper size and use a Planar map or flatten mapping. It usually gets the UV to proper scale.
Checking your density in UDK
Jumping ahead, let's take a look at what the major differences are in these walls we made.
Looking at this image, we are about maybe half a foot away from it. We can see it is very crisp and clear. There's nothing blurry about it, the texture is coming in at full resolution and your player is happy.
As you can see here the bricks are completely warped, the brown-gold areas that are in-between the bricks in the texture are blurry, and this reminds the player that yes, I am in a video game. It's just a sloppy mess.
Texel Density tips and trade-offs
Now that you have seen what the good and bad of Texel Density is, here are a few things to keep in mind.
Texel Density is extremely important, and with newer hardware and software coming out, your art needs to hold up. But there are always exceptions to the rules.
If you're making smaller trims that, for instance, are going to be tucked away under something, you don't need to waste time making it to proper Texel Density, its barely going to be seen so make it so it works.
Consider elements outside of the playing space. They can get huge, and realistically, they would need textures that no engine could process. The player will never get close to them, so Texel Density here isn't as important.
One-off pieces should use the guidelines, but a hero piece in the end just needs to look the best it can be.
Check out Tim Diaz's website for awesome personal works!
3ds Max software link
Unreal's free UDK game engine!