BNA!@Posted: Sun Jan 26, 2003 6:29 pmĀ :
So here we are with a quick and short tutorial how to create that amazing looking textures for Doom3 from 3D models.

Here are all the surce files you need:
Souce file download - 110kb

The download contains:
- a simple 3D modelled panel with approx 11k polys
- a material file for it to spare you writing one of your own
- a grey tga texture I usually use for specular map testing

Now let's go with step 1:
Create a folder structure below the base folder:
bna/panels/

Step 2:
Unzip the contents of the file in the panels folder and move the "bna.mtr" to the materials folder in your Doom directory - the rest will sit happy where it is now.

Step 3:
Open Doom, lower the console and type:
Code:
renderbumpflat bna/panels/panel_3_trip.lwo


Doom will load the 3D file "panel_3_trip.lwo" into memory and renderbump it with the default settings, which will leave you with two 256 * 256 .tga's.

The normal map will be named:
Code:
panel_3_trip_local.tga


And the diffuse map will be named:
Code:
panel_3_trip_color.tga


Now what happened?

The Doom engine took the model, extracted the color information from the polygons and rendered it to a flat color map (which will look even more unimpressive as the underlying 3D model used).

At the same time the engine computed the surface normals in our newly toy - the beloved fancy looking normal map.

When you open up DoomEd and go to the media browser you should find a folder called "bna" and a subfolder called "panels" with one material called "panel_3_flat" in it.
Make a brush, apply the texture, compile the map and see how it's looking.
Well, not overly exciting I know, but you've successfully accomplished the task of rendering a 3D model into a flat texture :)

So far so good.

What are the common pitfalls?

1st:
The 3D model has face towards the Z - axis (= looking at you in a front view camera perspective) in your 3D mesh modelling program of choice when you save it.

2nd:
Make sure you have converted all your polygons into triangles (watch out for these little 1 and 2 vertex polygons)

3rd:
I had some problems when I did set up a UV map, but don't quote me on that.

What else can you do?

The most important thing is the ability change the resolution of the rendered images.

When you type "renderbumpflat -size 1024 1024 yourmodelfile" you'll get a 1024*1024 resolution image which may be a better source file for building a texture upon it.

For other options just type "renderbumpflat" and Doom will show you the common use of the command with additional options.

Have fun and leave your questions here...