NormalMapper format specs?

So yes, this is a bit OT, so please forgive me. I tried site-searching and then Googling first to no avail, so I thought I’d take it to some of the ATI developing proponents here.

With the recommendations from various normal-mapping tutorials posted on the OpenGL.org front page links lately, I’ve downloaded ATI’s NormalMapper tool.

Unfortunately, it requires objects to be in their NMF format. Though the zip file came with various converters from Maya, Max, etc. to NMF, I found no format specification. (If I was the kinda guy who could afford to use 3DS Max, would I have to be messing around with the simplistic command line utility that, well, happens to be free?)

Anybody know where I can find an NMF spec so I can write a converter for my files?

Thanks a lot.

Just look at the source code. It’s all there…

If I was the kinda guy who could afford to use 3DS Max, would I have to be messing around with the simplistic command line utility that, well, happens to be free?

Yes. It is a good utility. And it certainly beats writing your own.

Originally posted by Korval:
Yes. It is a good utility. And it certainly beats writing your own.

Well, yeah. I’m sure it is good, and that it does beat writing my own.

However, if I had >$1000 of cash lying around, I’d probably choose buying something like Crytek’s PolyBump over my current approach, i.e. spend time locating/researching decent free polycount reducing and normal map generating utilities, write functions to convert my models to and from format #1, write functions to convert my models to and from format #2, and step-by-step convert each model to the appropriate utility format, use the utility, convert back, and repeat.

Which reminds me, any of you guys worked enough with freeware poly reduction utilities enough to have any recommendations?

Originally posted by NitroGL:
Just look at the source code. It’s all there…

Yeah, but I’ve never been either fast or particularly good at interpreting other people’s code. Especially when it’s something like the code that comes with NormalMapper… there’s stuff like a complete vector math library rewritten as about a page and a half of #defined functions, etc.

I’ll do it if I have to, I was just wondering if any of you guys knew if such a spec existed somewhere, cause it would really save me some time.

Thanks again

We recently started using the following tool: http://www.soclab.bth.se/practices/orb.html
The artists seem to like it so far. And we will probably use it for all or game models.

Charles

You really only care about the NmFileIO.h and NmFileIO.cpp files. The format is pretty basic:

First a file header:

4 bytes : character hader : "NMF "
4 bytes : 32 bit int : size

where size is 8 bytes (for the next chunk header) + sizeof int (for the number of triangles) + sizeof NmRawTriangle * number of triangles

Next is the triangle chunk header:

4 bytes : character hader : “TRIS”
4 bytes : 32 bit int : size

Where size is sizeof int (for the number of triangles) + sizeof (NmRawTriangle) * number of triangles

Next is the number of triangles

4 bytes : 32 bit int : number of triangles

Finally the block of triangles which are defined as the following structure(s):

typedef union
{
struct { float x, y, z; };
struct { float v[3]; };
} NmRawPoint;

typedef union
{
struct { float u, v; };
struct { float uv[2]; };
} NmRawTexCoord;

typedef struct
{
NmRawPoint vert[3];
NmRawPoint norm[3];
NmRawTexCoord texCoord[3];
} NmRawTriangle;

Another option is just to make your own file reader that fills an NmRawTriangle array with the data from your files. Use the following header prototype:

bool SMDReadTriangles (FILE* fp, int* numTris, NmRawTriangle** tris)

Put it in SMDFileIO.cpp. Then you can just #define USE_SMD_FILES in the NormalMapper.cpp file (uncomment the line near the top of the file) and rebuild. It should then use the file reader you added.

Hope that helps.

Originally posted by Pentagram:
[b]We recently started using the following tool: http://www.soclab.bth.se/practices/orb.html
The artists seem to like it so far. And we will probably use it for all or game models.

Charles[/b]

except the console is broken…
neither ‘.’ or ‘_’ were available on my FR setup.

Originally posted by Ingenu:
[b] except the console is broken…
neither ‘.’ or ‘_’ were available on my FR setup.

[/b]

Yeah, sorry about that. It works best with
US/ENG Input locale (you can add/switch Input locales in Win 9x/2000/XP.

If you don’t want to bother with that, simply
put your commands in a .cfg “batch” file like
the examples.
(most things are covered in the .pdf manual)