Blender to ATI nmf

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Blender to ATI nmf

Post by nfz »

I finally got around to writing an ATI nmf exporter for blender.

This exporter converts Blender meshes to ATI's nmf format so that the mesh can be loaded into ATI's normal mapper utility.

ATI nmf is the normal mapper format required for meshes that are to be loaded into ATI's command line normalmapper utility. The normalmapper can generate a normal map using a high poly model and a low poly model.

Usage:
Build a high poly model in one layer and a low poly model in another. Select them both and then export them using the nmf exporter. The nmf files can then be loaded into the normalmapper and a normal map generated. See the NormalMapper readme file on how to use
that utility.

Notes:
Low poly models must be uv mapped and the mappings must not overlap. The high poly model does not have to be uv mapped but if you are using a bump map for fine detail then you must uv the high poly model.

Make sure the models have the same orientation and position. The low poly mesh should sit inside the high poly mesh for best results.

The exporter places the new nmf files in the data directory as specified in the blender user settings and uses the object name as the file name with an extension .nmf.

The normal mapper tool can be downloaded from:
http://mirror.ati.com/developer/tools.html
there is also a NormalMapper windows User Interface called NormalMapperUI on the same download page which is highly recommended.

Eventually a UI in Blender Python script will be written so the tool can be used within blender. I converted the NormalMapper to Python but it ran way too slow to be practical. Having a Python UI will provide ease of use and the exe util will provide the speed.

So here is a link to the first version of the script: nmfexport.py.
Place it where you keep your python scripts for blender.
Hoorah
Gnoblar
Posts: 10
Joined: Sun Jan 23, 2005 6:22 pm
Location: New Mombasa

Post by Hoorah »

Cool, thanks a lot, I'll see what luck I have with it :lol:

"The high poly model does not have to be uv mapped but if you are using a bump map for fine detail then you must uv the high poly model."

Question about that: does it have to be exactly like the Low-poly version, or will the ATI tool only use it for the BumpMap Co-ords. only?

Thanks :)
User avatar
bana
Greenskin
Posts: 132
Joined: Mon Aug 02, 2004 7:40 am
Location: Austin, Texas
Contact:

Post by bana »

Excellent work nfz! This could really come in handy, any particular reason you chose to support ATI's normal map generator over Nvidia's? (just curious).

Keep up the great work. 8)
A proud member of the OpenFrag Coding Team.
http://coolhands.blogspot.com/
Hoorah
Gnoblar
Posts: 10
Joined: Sun Jan 23, 2005 6:22 pm
Location: New Mombasa

Post by Hoorah »

Ok, I'm back :D

I can't seem to find the Exported Files :?

"The exporter places the new nmf files in the data directory as specified in the blender user settings and uses the object name as the file name with an extension .nmf."

?I can't find it! :cry:
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

bana: I have the source code to the ATI normal mapper and I like the features and results.

Hoorah: I think the default data directory is /Documents and Settings/ *username* /Application Data/Blender Foundation/Blender/.blender/bpydata.

Thats for win xp.

The next version comming out has a user interface based on the one used for the ogre exporter and has a user definable output path along with being able to select high and low poly models and adjusting all the normal mapper settings. This way you don't need to launch the external normal mapper UI and do everything within Blender.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

Image

Here is the next version of the NMF exporter for Blender. It now includes a Blender GUI (as pictured above) for the ATI normal mapper. The nmfexport.py Python script has the ATI nmf exporter and the GUI, I didn't see the need to have them seperate. The GUI doesn't offer all the settings that the command line offers but for now it offers the most commonly used ones. Yes, the rest of the settings will be added.

I also modified the ATI normal mapper and I have included the modified exe and the source code. The ATI NormalMapper only supported the TGA and ATI image formats which meant doing conversions in another program. To improve workflow I have added more image formats to the utility by incorporating the use of the Devil Image library. Now supported are png, jpg, bmp, and of course tga and all others supported by Devil. There was a bug with using bump maps in the normal mapper which generated inverted normal vectors for the bump map. This has been fixed in the modified version.

Its highly recommended that you read the help.html located in the help directory after you unpack the zip. The help file has the installation instructions.

Ok, here is the download http://neuralfuzz.com/opengl/NormalMapper.zip
User avatar
Phantom
Greenskin
Posts: 106
Joined: Mon Aug 02, 2004 10:28 pm
Location: Helsinki, Finland

Post by Phantom »

Wow, nice work. Works like a charm.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

A new version has been uploaded. You can use the link in my previous post to get the latest build. The normal mapper now runs in a seperate thread so you can continue working in Blender while the normal map is being built. Check the Blender console window to see the status of the normal map being built.
P
OGRE Expert User
OGRE Expert User
Posts: 421
Joined: Fri Jan 07, 2005 9:49 pm
Location: UK
x 2
Contact:

Post by P »

I m still learning the basics with Blender, maybe too early to try it, but i can t wait beginning more experienced and use your great plugin :)
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Wow, this looks really useful. Makes me want to try blender again :)
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

I've put up the initial tutorial and Gui help: http://www.neuralfuzz.com/opengl/blende ... ping/Help/

Its a WIP and will be updated as time permits.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

the start of Part 3 of the tutorial has been uploaded. Also, a new version of the GUI has also been uploaded. Two settings were added to the GUI: Tangent/world space and border expansion setting.

download: http://neuralfuzz.com/opengl/NormalMapper.zip

tutorials: http://www.neuralfuzz.com/opengl/blende ... pping/Help
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Hi everyone,

I am very new to blender. I just found out this 3D package can do much more than I thought. I am very native to 3DSMAX since I have been using MAX for a very longggg time. But I try to use Blender more and more. It's very powerful.

Well what I am gonna say is I just wanted to say thank you. I was finding the tools to convert .nmf file or make a link to ATI's NormalMapper. And I found only one made by nfz. Just wanted to say thanks a lot for this tool. I thought most of the blender users would drop out any normal map creator, since they could just use the native tool to blender.

Thanks a lot,
Semicolon
"Nature is the mother of learning"
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

The exporter now supports the Ambient Occlusion setting. The ambient occlusion map is placed in the alpha channel of the normal map.
Image

The new download is here:
http://neuralfuzz.com/modules.php?op=mo ... load&cid=2
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

You're doing some great work here nfz; have you submitted this to Blender? I'm sure it would be useful for all their users.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

I have been making posts in the blender development forum and Elysiun forum but there has been very little interest in the exporter. I think its because the generated maps can't be used in Blender and are only usefull in a renderer that properly supports the tangent space normal map format like Ogre.
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19265
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 66
Contact:

Post by sinbad »

Thats bonkers. Well, I like the look of it :) We could make it an ogreaddon if Blender aren't interested.
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Hi nfz,

Thanks again for the cool tool. I was trying to create normal map using the ATI's normalmapper. By the way, do you have some clues of how to set those settings in there? Like "Use closest. Use closer to the low res model if equidistant." or such.

I was trying to create things like occlusion map as you was talking about but didn't know how to use it properly.

Cool!!
Semicolon
"Nature is the mother of learning"
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

I haven't put all the different options for ray hit test in the GUI yet, doing that now. Right now it defaults to using hit tests that result in closest to Low poly mesh which is far from ideal in lots of situations. If your high poly mesh does not have any over lapping geometry then using closests works ok since the ray projecting from the low poly to the high poly should only intersect one area in the high poly mesh. But I found out that a lot of high poly meshes that have complex detail have a lot of overlapping geometery and "use closest" produces incorrect maps. Anyway version 0.0.6 will have all the hit test options available.

As far as using the AO you will have to refer to the ATI readme (which is a little sparse on helpfull info) that is included in the zip since I haven't updated the help file yet because I am still learning about all this stuff. Basically you can think of an AO map as a lightmap used for attenuating the ambient portion of the lighting calculation in the pixel shader. I also use it to attenuate the diffuse calc and like the result. Having the normal mapper generate the AO map will triple the time to generate the final normal/AO map so be prepared to go for a coffee while generating the final map when using very high poly meshes.

I'll eventually put out a new FX shader that uses the AO map but you could also check out the shaders used in the INOUT demo which uses the tangent space Normal/AO maps too.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

semicolon: Just checked out you web site and I really like your art work, excellent stuff.
User avatar
semicolon
Halfling
Posts: 94
Joined: Sun Jul 04, 2004 4:42 pm
Location: Bangkok, Thailand
Contact:

Post by semicolon »

Hi nfz,

Wow!!! You just gave some inspiration. That's really interesting information to create both real-time 3D and full-motion video. I am really interested in creating normal map, but didn't know how to use it properly. I was thinking of using normal map for a long time. Right now I am just researching on those options for generating the best normal map that would bring me the highest details out of the hi-poly models. Any suggestions for doing this would be more than welcome.

By the way, thanks a lot for the comment on my gallery. Actually that would be a shame on me that I didn't create any new stuff for my site for a few years. I was thinking about what I wanted to do today and poped up with the idea of creating some stuff for Orge community. As I have faith on Orge that would be one of the top 3D killers in the future, I just wanted to create come art that could be put in Orge for showing her features. I will post the idea sketch on the forum as soon as I get some.

Thanks,
Semicolon
"Nature is the mother of learning"
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

A small update to the exporter which brings it to version 0.0.6. New options available in the GUI for the normal mapper:
  • 1. Normal Vector Intersection Rules - helps to reduce artifacts on complex shapes.
    2. all options for texel samples available - improves quality of normal map but slower to generate as samples increase
    3. all triangle padding options available - helps to reduce artifacts in normal map
Download available from here
bigbad
Gnoblar
Posts: 3
Joined: Thu Jan 12, 2006 11:47 pm

Post by bigbad »

Hi. This is my first post. I registred to say that the links doesnt work. Does anyone have an alternative link to normalmapper.zip.

That plugin was so great.

Please please someone keep this great plugin alive.
nfz
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 1263
Joined: Wed Sep 24, 2003 4:00 pm
Location: Halifax, Nova Scotia, Canada

Post by nfz »

Sorry, that site doesn't exist anymore and I don't have access to the .zip (long story). Maybe someone who downloaded it before could some how get it to you.
User avatar
Jerky
Orc Shaman
Posts: 791
Joined: Wed Mar 02, 2005 4:13 am
Location: Springville, Utah
Contact:

Post by Jerky »

Try this:

http://66.119.136.7/NormalMapper.zip

That should be the latest version since I got it in Novemeber.
Erik Briggs (Jerky)
My Blog
Project Wish
Image
Post Reply