Blender normal map export for 3d meshes?

Anyone know of a script to export uv normal maps from a 3dmesh in tangent space?

I’m working on a game with a pseudo celshader which creates shadows based off the curvature of a model. Due to the polycount restriction of games I think it would be better to apply a highres normalmap for the lowpoly model, so that the shader can apply smooth shadows similar to an anime.

I’ve been trying to use Dra[en]gine’s Normal Map generator which has a python script which exports some strange format from blender but the program is buggy and gives screwy results. I don’t really want to go through the trouble of exporting to 3ds and using Nvidia Melody as I don’t use 3ds and futhermore I have to run Melody through cedega and it doesn’t export the tga’s for some reason.

Anyone have any ideas of how to export these?

blender doesn’t have any inbuilt feature or any reasonable scripts

second to melody is ORB, but it’s also a windows only application [though it doesn’t require pixel shaders, it does require a 32 bit buffer]… however the site seems to be down at the moment

perhaps you can find another solution on this page:?

melody can import .obj right? [orb can too, but you have to triangulate for orb, something I don’t belive the exporter in blender has an option for]

melody supposedly can import obj, I tried it and it died horrible so I had to use 3ds.

I use the ogre exporter which exports the .nmf format for the ATI normal mapping tool, but my normalmaps seem more broke than just ‘artifacts’.
I have these seams all over the normal map which are at the same place as the polygon edges of the lowpoly mesh.
Here are pics:

// the lowpoly/highpoly meshes (i export with them aligned)

// the normal map exported by the normalmapper

And here is the result:

Instead of being a smooth head model like in the modeller pic, i get this weird lizardskin type thing. Anyone have any ideas?

something is intrepreting your faces as being in solid mode

I can’t help you with the nmf exporter or anything becuase I’ve not used it

orb and melody have worked just fine for me with .obj files [I even wrote a script to trianglulate 80+Mb .obj files for orb]

I’ve also been playing round with this Ati Normal Map exporter for Blender. (Scroll to the end of the page, there’s the link to it and also a tutorial how to use it.)
I think it does a good job. :slight_smile:

If you still have got the problem, here’s the solution: :wink:
You have to set all objects smooth, if you don’t want to have the lines.

I was wondering, is there a way to export the rendered image to a material. For example, say i setup a flat grey diffuse material on a UV mapped mesh. Then I put red, green, and blue hemi lights around the model to represent x,y,z then render. Could I export the rendered material as an unwrapped UV texture somehow?

Thats the same script I use @ post above.

i’m sorry i didn’t see that topic earlier damaged. the strange format is only an intermediary format to get the data over from blender to my tool, nothing more, nothing less. and the latest downloadable release has some troubles. those are sorted out in my current SVN version as you can see here. i need to apply a fix to the .dim format before i release the next version ( i stupid boy somehow managed to restrict to 65000 vertices, which turns out to be too less then do reasonable high-res with ).

kick me if i should forget that release once again :wink:

EDIT: concerning the tangent it depends also on how you produce the vertex tangents in your app (shader). i got myself into kind of troubles depending on how i calculate/smooth tangents. would help if you can specify your smoothing policy.

Oh, heh, well on that note, the normal mapper won’t compile under my gentoo 64 linux box, I’ve been having to run the windows version through cedega. It claims the glxGetProcAddress thing for extension can’t be resolved by the linker.

can you please post a bug-report at DENormGen Forum with the exact problem and output? then i can try to put in a fix in the same go before i release the new version.

It’s posted.

ok, to your model you send me there is a problem which prevents things from running.

EDIT: i noticed i didn’t correctly understand what you wanted to do. i took now the uv-mapped head and made a hi-res from it using a sub-div and then exported it. this worked (you just didn’t have a texture assigned telling the app what sizes to use).

the unwrapped uv is a bit… hm… tricky. if i look at the derived tangents in my app they are anti-parallel on the seems. this is a problem as with smoothing they end up beeing 0-length there :-? . anyways i made a normal-map from it.

I sent you the wrong .blend file actually but the otherone just has a better UV unwrapping. Anyway about the seams, do you have any idea of how I would fix this on the model?

I look forward to the new version of the normalmap exporter =)

about the seams it’s a general rule of thumb to place them where they are the least noticable, hence on the back of the head or at the arm pits for example, as they always impose troubles.

so far i see only one solution and this is an algorithme that smoothes only tangents of vertices which are only inside a polygon-patch, not on the rim (viewn from the uv-perspective). i’ve not implemented this algorithme yet but it should solve that problem. i’ll do that once.

this though is the problematic point: your application has to do the EXACT same tangent-calculation or else it looks off. that is something all the other tools don’t tell you but without knowing how they smooth tangents you are always on the loosing side of the game. i think i’ll add a function to allow you to select which kind of tangent calculation you want to use to generate the normal-map. i guess i’ll release the bug-fixed version of my tool in the next couple of days and start working on that function.

Lets continue this on your forums as to not junk up elysiun =)