June 12, 2012

Amazing One - Texture Environment

By Dana Cowley

Amazing One-Texture Environment

What can one developer achieve with a single texture and the power of UDK?  Talented 3D artist Tor Frick explains his crafty ways in this interview. Download the content from this cool sci-fi lab environment now!

Optimizing gorgeous 3D environments for great performance on today’s array of gaming platforms is no small feat. After working with UV, texture and shader optimization on multiple projects, Tor Frick decided to test his own skills and produce an environment requiring as little memory as possible. His task: to create a realistic scene using one 256x512 texture.

As Frick explained, “Usually in a scene like this there would be a lot of textures, with each one generally larger than this, which would take up a lot more memory. Every bit of texture memory you don’t use in the environment means more you can use on characters or elsewhere. Savings like this could be especially useful for shipping better looking content on mobile devices.”

“I wanted to minimize texture sizes and also avoid having multiple materials to decrease draw calls,” he said. “This exercise forced me to look at textures in a different way. Instead of just using textures as they are, I pushed myself to get the most out of the texture and shader, and used the UVs more to my advantage in ways I normally wouldn’t consider.”

Experimentation and Iteration

Amazing One - Texture Environment

To describe the trial and error bits of his process, Frick had to rethink basic rules and change his approaches to enable more variety in the scene.

To give an example, he said, “I used the blue channel of the normal map as a mask between metal and plastic or painted parts, which allowed me to separate the two with specular, color, etc. After a while, though, I realized that one color per prop plus metal was pretty limiting. My first idea was to make cuts in the mesh and have another material on the polygons that would take on a different color, but that would require an extra draw call, and I wanted to avoid that.

“Instead, I came up with the solution that in one of the UV sets, I moved the polygons that I wanted to change color on one UV-grid to the side, and then used a small area of one of the color channels as a mask that I scaled up in the material editor. 

“This is only one example of how I had to think differently to fit everything in the texture and shader. Finding ways to create variety with the data you already have, such as UV-coordinates and texture channels, is a good challenge. Instead of looking at the textures strictly as diffuse, normal, etc., I tried to think of what I needed for the scene to look good, and how I could achieve that with minimal data, e.g., ditching the mask for the decals and solving it in the shader instead.”

“Working with UDK was really the first time I’ve had this much freedom in content creation, so I was a bit surprised by the power I got from the art pipeline – everything from the material editor to post-processing and rendering. I had seen the material editor before, but I didn’t realize how much you actually could do with just the shaders.

Amazing One - Texture Environment

Frick explained that he wanted to try out new approaches because over-optimization can waste valuable time.

“I would never construct an actual game using these exact techniques, but I can apply and build upon the lessons learned here in the future when making game art,” he said. “I have picked up some new tricks, explored new dead ends and learned a lot."

“Also, if there is one point where you should spend optimization, it’s where the benefits are the largest. I have built probably 50 assets with the same texture, and the pipeline for building new assets is super fast. I don’t need to import new textures or create new shaders. Every new trick and optimization I perform now affects 50 assets instead of just one."

“Every megabyte is worth a lot. Every day of work is worth a lot. If you can consistently free up a few thousand kilobytes of textures from the environments and they look the same, then suddenly your main character can have a 2k texture instead of a 1k texture, for example.”

How UDK Helped

Amazing One - Technology Environment

Frick says he chose to use UDK because it affords him the freedom to experiment with lots of different techniques and it’s easy to use.

“UDK gives me the most options in terms of how I create things,” he explained. “The huge community and amount of information available is also a big plus. If I ever get stuck, help is just a quick web search or forum post away.”

“I have used a number of different engines, and the biggest plus with UDK is definitely the great pipeline and ease of use, as well as its multipurpose capabilities.”

In terms of this specific environment, Frick praised UE3’s shader instance system. “It was a great help, and I used it extensively to create variations, fine-tune variables and control features in the shader, he said. 

Amazing One -Texture Environment

“Since almost everything in this scene is based on the same shader, I could easily update and change the master shader after iterating on the texture. Having full control of the texture channels and UV sets in the shader was a great help since I was constantly changing the way the texture was laid out until I had it all locked down, and having all that transferring into the scene and all the instances without having to change stuff manually saved lots of time. The real-time update of shader instances straight into the viewport helps decrease the iteration time a lot as well."

“The interface as a whole works great because it’s very accessible and things are easy to find. The material editor is really good; I love to play around with it. The material instance system is also a favorite, because I tend to lean a lot on material instances, like in this scene. Kismet and Matinee are thankfully very easy to use. They allow me to add extra polish, movement and interaction to my scenes without having to think too much!

“The size of the Unreal Engine 3 community is a huge benefit. It’s always a great source of inspiration to see what clever solutions other people have developed. I still watch tons of tutorials, because you never know what clever tricks you can pick up. UDN is also a great resource, I use it all the time, both for problem solving and keeping up to date with the engine.”

“Working with Epic has been great. I learned so incredibly much, and it really opened my eyes to whole new areas of art creation that I hadn’t even considered before. Having this much control over the entire art process really opens up the imagination,” said Frick.

To his credit, the Epic team has been impressed and inspired with Tor Frick’s project, and we’d like to thank him for sharing his content with the Unreal Engine community.