Posted by on 2008-11-20

Texture baking is your friend

Texture baking has been known to the Flash 3d community since a long time, but a quick look into Google shows us that it is not a very popular topic. I think it definitely should get more attention.

In Flash performance is always an issue, and high quality is always expected by our clients. Texture baking helps to achieve this goal.

In short, it consists of getting all the lightning effects of a material and "burning" them directly on the material itself. After such operation, the lights cannot change anymore, but the material gets a nice effect of depth and it doesn't require any more computations at runtime.

Most of the available 3D software offers a texture baking function. For the demo above, I did choose Blender because it's free (it also has a very weird user interface, but I digress). On the Flash side, it runs on Away3d.

To create a model with baked textures in Flash I followed this steps:

  1. Create the 3d model of the chair in Blender
  2. Project all the faces of the model on to an bitmap (in Blender its called UV Unwrapping)
  3. Paint the texture in Photoshop
  4. Import the texture to Blender and apply it to back the model
  5. Add lights and bake the texture on to another bitmap
  6. Export the geometry with the UV information included (Collada or Wavefront)
  7. Export the baked texture as a jpg
  8. Import both into Flash and use your favorite 3d engine to render

Each of the steps above could require a separate tutorial, so instead I published some files created in the process to give you a better idea. You can get them here. Please note, that this is only a reference material – it is not supposed to be built or compiled or anything.

Additionally, for those of you who use Blender a nice tutorial on both UV Texture Mapping and Texture Baking is available here.

In the current state of Flash 3D and its overall performance, texture baking is a highly useful technique that allows to achieve very good results. If you do not believe me, take look at some of the most awesome Flash 3d pieces that came out in the last few months:

I am sure you've seen them before anyway. They both combine great visual effects with a very high performance. And guess what… in both of them, you'll find baked textures all over the place!

More posts

Everyday3D is a blog by Bartek Drozdz

The blog is about web development and realtime 3d graphics. Started in 2007, first it focused on Flash (remember?) then Unity3d, WebGL and eventually - Virtual Reality and 360 photography. In 2016, Bartek co-founded Kuula - a virtual tour software - where he works currently.