Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Recently I stumbled upon a demo reel in UDK about how one can attain beautiful results using just one (rather tiny) texture that's being sent to the shader pipeline. The famous link is this one.

Basically, the author states that they've used just one texture and give a snapshot of the technique here.

I see that every RGBA channel contains different grayscale information.. and that info could be used to inside a shader to obtain a colour blended output. The problem is that the reel displays a fairly complex scene. To top that, the author even makes use of a normal map. How did they manage to fit a normal map in an already cluttered texture? It makes sense to have a half-space normal map by using only RG from an RGB texture, but what about the rest of the information? Since it was proven to be possible, could someone please explain how it was done (the big picture, not the dirty details!)!?

Here's the texture being used. Click to see in full size.

enter image description here

share|improve this question
From the image, I think the normal map is in a separate texture. – David Gouveia Jun 19 '12 at 14:44
It seems rather obvious, I can't still imagine how the other things are put into place to yield the result in that video. It seems to encompass some techniques: texture atlas, emmissive textures are held in the alpha, the aspect/detail texture in the red, decals in the blue, in the green they must have some grayscale modulating factor for a colour modulation effect. Still, it's not lcear what's up with the normal map in the second part of the image. The first two components are (nx, ny), but the third is a mask. Or is that normal map just.. a normal map? – teodron Jun 19 '12 at 15:26
up vote 4 down vote accepted

Well to begin, it's actually two textures, but basically what he's done is cram lots of individual maps into separate channels of the textures. So in those two textures, you have specular, normal, masks, albedo etc.

Unfortunately, in order to extract all the separate bits of information and use them properly this means he has to have quite complex shaders and possibly multiple UV sets on his geometry as well. The trade-off here is saving texture memory (of which we have lots) by using more GPU cycles (of which we have relatively few) to do complex material processing.

If you want to know the specifics of that particular scene, you can download the package from the page you linked and view it in UDK yourself.

edit: In addition there is a lot of very fancy baked lighting in that scene, so really there are a lot more than two textures. :)

share|improve this answer
The scene is basically artistic masturbation. It's very cool that he was able to do that, but it's not very practical in a real game project. Like you said, GPU cycles are expensive, GPU memory is cheap. – knight666 Jun 27 '12 at 12:22
Myeah, I'd call it a bad approach having the motivation: "because we can". +1 for your observation on burdening the GPU to do unnecessarily complicated (decoding) work instead of using the (fragment) shaders for other, more common, purposes. (I should know, I have the experience of a complex shader that did similar stuff - except for the fact that the textures were not colour modulated as the example in the question). – teodron Jun 27 '12 at 12:27
To be fair, the artist does say in one of his comments "This is not really a good example of how to do things, but more a series of techniques and tricks that I combined to push it to the limit. " so its been done more as a technical exercise than anything else. – BpHinch Jun 27 '12 at 12:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.