Blender to ATI nmf
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
Blender to ATI nmf
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.
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.
-
- Gnoblar
- Posts: 10
- Joined: Sun Jan 23, 2005 6:22 pm
- Location: New Mombasa
Cool, thanks a lot, I'll see what luck I have with it
"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
"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
- bana
- Greenskin
- Posts: 132
- Joined: Mon Aug 02, 2004 7:40 am
- Location: Austin, Texas
- Contact:
-
- Gnoblar
- Posts: 10
- Joined: Sun Jan 23, 2005 6:22 pm
- Location: New Mombasa
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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.
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.
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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.
-
- OGRE Expert User
- Posts: 421
- Joined: Fri Jan 07, 2005 9:49 pm
- Location: UK
- x 2
- Contact:
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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.
Its a WIP and will be updated as time permits.
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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
download: http://neuralfuzz.com/opengl/NormalMapper.zip
tutorials: http://www.neuralfuzz.com/opengl/blende ... pping/Help
- semicolon
- Halfling
- Posts: 94
- Joined: Sun Jul 04, 2004 4:42 pm
- Location: Bangkok, Thailand
- Contact:
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
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"
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
The exporter now supports the Ambient Occlusion setting. The ambient occlusion map is placed in the alpha channel of the normal map.
The new download is here:
http://neuralfuzz.com/modules.php?op=mo ... load&cid=2
The new download is here:
http://neuralfuzz.com/modules.php?op=mo ... load&cid=2
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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.
- sinbad
- OGRE Retired Team Member
- Posts: 19269
- Joined: Sun Oct 06, 2002 11:19 pm
- Location: Guernsey, Channel Islands
- x 66
- Contact:
- semicolon
- Halfling
- Posts: 94
- Joined: Sun Jul 04, 2004 4:42 pm
- Location: Bangkok, Thailand
- Contact:
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
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"
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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.
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.
- semicolon
- Halfling
- Posts: 94
- Joined: Sun Jul 04, 2004 4:42 pm
- Location: Bangkok, Thailand
- Contact:
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
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"
-
- OGRE Retired Team Member
- Posts: 1263
- Joined: Wed Sep 24, 2003 4:00 pm
- Location: Halifax, Nova Scotia, Canada
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
- Jerky
- Orc Shaman
- Posts: 791
- Joined: Wed Mar 02, 2005 4:13 am
- Location: Springville, Utah
- Contact:
Try this:
http://66.119.136.7/NormalMapper.zip
That should be the latest version since I got it in Novemeber.
http://66.119.136.7/NormalMapper.zip
That should be the latest version since I got it in Novemeber.