Tips & Tricks

2 channel diffuse textures

Certain types of diffuse textures have a wide range of lightness and saturation values but they vary little in terms of hue.

We can exploit this property and pack the image into only two texture channel, complemented with a single color constant, allowing us to store arbitrary data in the remaining two channels of the image (normal XY, specular amount and roughness, etc).

Read more
Normal map sharpening

I’ve never liked how bilinear filtering makes normal maps resemble molten plastic when the camera gets too close. On certain types of surfaces like rock or rusty metal, this effect can be counteracted for some degree by applying a micro normal map. However when it comes to machine like assets with well defined, geometric features, that method doesn’t help much so I tried a different approach.

Read more
Reflections in UDK

The reason why we see an object is because light is reflected off its surface. In realtime applications this single physical phenomenon must be approximated for performance reasons, so we end up mixing simplified models: the diffuse term simulates evenly scattered light, the specular highlight is a fake reflection of a light source for example. Sometimes we need to create really shiny materials and that’s when texture reflections come in to play.

Read more
Multipurpose fire material

When I started working on the material I had the following goals in mind:

  1. Support for fires of different scales, from a single flame to massive fires. On the long run it’s more efficient to maintain and learn to use one material instead of several single purpose ones.
  2. High texture resolution with smooth animation. My target is usually 720p@60Hz and that ruled out flipbooks which don’t scale up well resolution and framerate wise.
  3. Adjustable complexity, visual quality vs performance tweaking.

Fulfilling these core requirements was simple enough after some experimentation and I ended up spending most of the time on optimizing and making the controlling parameters easy to handle.

Read more
Grayscale image compression

In realtime graphics grayscale images are often used as masks in shader and particle effects. In many cases (lens flares or vector masks for example) compression artifacts can become a problem.

The following table is a comparison between a few of the compression schemes present in current UDK builds.

Read more