Ogre TextureAtlas creator/remapper materialfilecreator

While the part with the .j3m file is only for JME§ relevant, the rest could be usefull although for jme2 users that use OgreXml files, as a way to improve speed.

“As GPUs become faster, it becomes more and more important to group geometry into large batches.  This translates into fewer draw calls and reduced overhead, allowing the GPU to achieve higher performance.” Nvidia Homepage

Also we can abuse it, to create a model as usual, let the texture artist create additional normal , ect maps, and combine them into one larger, to be useable with the J3M material System while only using one Geometry.

This is probably kinda hacky in some parts, as I need this kinda badly to progress further, anyone is invited to change stuff and just post your changes here with a small text what it changes and why

Are there any related threads or articles of interest?
Written for Directx, just translate Draw calls with TextureStateChanges.

Download : http://empirephoenix.de/files/J3MOgreModelCompiler/J3MOgreModelCompiler.zip
Copy the AtlasCreationTool from  the /natives to c:

Copy your model with all textures and the material file into one Folder:

Start the Compiler/Remapper  and select your model. (only .mesh.xml supported as name)

Let it run, hope there are no errors


Names are:
_normal for normalmaps
_spectacular for spectacularmaps
_parallax for parallaxmaps

Note that either every of the used Textures has a optional Texture, or it will disable that part.
Also the normalmaps need to be same size as the diffuse map.
If a map is not power of two, the Programm will try to resize it, this is highly experimental und sometimes buggy

Here is the path to the model if you like to take a look how to input stuff into the Remapper/Converter.
(And yes, the original uv mapping was this terrible as well, as I’m ust started to learn modelling.

If your model looks like this:

Use the TangentBinormalGenerator class to generate tangents, or wait, untill I added it in the code of the tool

Hey thanks solved the problem. Later when the tool learns the second step , converting to jme3 binary I can just generate the Tangentstuff then, as one of the targets of this tool is, to make complex models easyer to made, and increase loadingspeed/performance for sacrificing a little flexibility(you can always do stuff the normal way ofcourse so no real limitation).

Zime to go to bed… 3 am again damn

ahh this is great i was just looking into Texture Atlas's this weekend =p

The normals are probably fucked up because they are not there. When you export OgreXML from blender there are no normals in the model… You have to use the ogrexml command line tool or the normal generator in jme to create them I believe…

The normals are there, its the tangents that are missing. You can also generate them for J3Os or at real time through TangentBinormalGenerator

These nvidia tools are windoze-only huh? Or are they POSIX compatible? I also want to incorporate the native ogre tools for creating tangents etc… but its not trivial compiling them on OSX for example…

No the nvidia tool is windows only, but i heard it runs under wine.

Empire Phoenix said:

No the nvidia tool is windows only, but i heard it runs under wine.

Yukk :(

Well if you can provide me a pure java atlas creator I would integrate it of course, the complete rest is pure java anyway and I think it is possible to use the JAI to create such atlas creator.