[Flour] Flour released. Testers needed!

betajaen

03-04-2008 16:16:11

Brief
Flour is a self-contained no NxOgre or Ogre dlls needed application that can convert Ogre Meshes into triangle or convex meshes, and RAW 8 or 16bit images into NxOgre heightfields.

Download and Install

Flour can be downloaded from the flour directory at NxOgre.org, along with some samples to work with. If you have artists who do not wish to install the PhysX SDK on their computer, then I have provided the "light" silent installer of PhysX 2.8.0 they can use, you don't need to install it if you have the SDK installed.

To install; Double click the FlourInstaller.msi, it will be silently installed to c:/Program Files/Flour/ inside there will be a single executable which you use from a Dos prompt.

Examples
> flour
Bring up basic help

> flour meshes
Bring up help for meshes

> flour heightfield
Bring up help for heightfield

> flour meshes type: triangle, in: testmesh.mesh, out: triangletest.nxs
Convert 'testmesh.mesh' as a triangle mesh to triangletest.nxs

> flour meshes type: convex, in: testmesh.mesh, out: triangletest.nxs
Convert 'testmesh.mesh' as a triangle mesh to triangletest.nxs

> flour heightfield in: testhf.raw, out: testhf.xhf
Convert 'testhf.raw' as to a NxOgre heightfield (xhf)



Future

Flour will eventually support all of the meshes, and images for heightfields, as well as generate MaterialAliases.

Required LGPL Source

See "flour-src.zip" at the flour directory at NxOgre.org

reptor

03-04-2008 16:52:20

Haven't you got a small error:

H:\flour>flour heightfield hftest.raw
Terrain converter
====================
Description:
Converts an greyscale RAW image into a heightfield for use in NxOgre.


Params (Uses FlourParams):
FlourParams:
in = filename of mesh to be converted.
out = filename to save to; otherwise the saved file is the in filename with xhf appended
signed = Red pixel is considered a signed byte/short {default: no}
Yes:
- 8-bit images are "signed".
Zero is (128,128,128).
Highest height (+32768) is (256,256,256)
Lowest height (-32678) is (0,0,0)
- 16-bit images are "signed".
Zero is (32768, 32768, 32768)
Highest height (+32768) (65536, 65536, 65536)
Lowest height (-32768) (0, 0, 0)
No:
- 8-bit images are "not-signed".
Zero and lowest height is (0, 0, 0).
Highest height (+65536) is (256,256,256)
- 16-bit images are "not-signed".
Zero and lowest height is (0, 0, 0)
Highest height (+32768) (65536, 65536, 65536)

Note: Zero is considered to be the vertical position of the terrain shape the heightfield is attached to.

Examples:
flour terrain in: terrain.raw out: terrain.hxf
** Note currently all RAW images must be square (and width/height to the power of 2) **


You first say 'heightfield' then your example says 'terrain' which does not work.

The program seems to work. It converted the example files without errors. But I didn't use the files for anything so can't know if they are ok.

betajaen

03-04-2008 16:56:27

Ahh, thanks for the heads up and for the testing. Now I know I did the installer properly.

tregaro

04-04-2008 07:40:56


> flour meshes type: convex, in: testmesh.mesh, out: triangletest.nxs
Convert 'testmesh.mesh' as a triangle mesh to triangletest.nxs



Small error in the readme. It should say "as a convex mesh" right?

Also I tried to convert some meshes (the athene.mesh from ogre sample) but it doesn't seem to produce any files.

The full command I executed: flour meshes type: triangle, in: athene.mesh, out: test.nxs

I was also wondering if you need to supply a convex mesh to be able to convert a arbirary mesh to a convex? Or does it split the mesh into convex submeshes?

Otherwise great work! This will be a really useful tool.

betajaen

04-04-2008 11:10:47

No there are no sub-meshes in NxConvexMeshes, it's just one big mesh. It does optimize it; so the Athene mesh will probably "look" like a rough cut out of the source.

However it may be due to duplicate vertices. Flour does not clean up the meshes like it used to in NxOgre 0.9 and early 1.0 but I have successfully converted the OgreHead mesh which has several sub-meshes so it does work with a fairly complicated model.

tregaro

04-04-2008 12:40:04

Just wanted to say that the reason that flour didn't produce any output was that the console that I was running didn't have admin privileges (running vista). However flour didn't report any error when it couldn't open a file for writing which I would consider a small bug.

As for the question about suplying a non convex mesh (for example ogrehead.mesh which clearly isn't a convex mesh) and converting it to a convex shape (which has a restriction of 256 polygons). Is this possible? If so how does flour do this? Can you control this process in any way through flour?

betajaen

04-04-2008 12:48:56

N:\Flour\out>flour meshes type: convex, in: ogrehead.mesh, out: ogreconvex.nxs
PhysX Error! NXE_INTERNAL_ERROR (g:\scm\release\PhysX_2.8.0\novodex\SDKs\Cooking\src\ConvexMeshBuilder.cpp:544)
The hull has more than 255 polygons. This is invalid.


Apparently not.

tregaro

04-04-2008 13:13:04

c:\Program Files\Flour>flour meshes type: convex, in: athene.mesh
Converted 'athene.mesh' to 'athene.mesh.nxs' as PhysX Convex mesh


Why does this work then? The Athene mesh has far more polygons than the OgreHead mesh and both are obviously not convex meshes.

betajaen

04-04-2008 13:23:34

But you tried the athene.mesh with the triangle mesh, not a convex mesh. They are quite different.

tregaro

04-04-2008 13:29:44

c:\Program Files\Flour>flour meshes type: convex, in: athene.mesh
Converted 'athene.mesh' to 'athene.mesh.nxs' as PhysX Convex mesh


No, As you can clearly read above I used the convex type. That is why i'm a little confused... :?

betajaen

04-04-2008 13:54:13

Ahh, my mistake. I don't know why it would convert the athene mesh to convex and not the Ogre head. Perhaps the athene mesh is under 255 polygons but it looks more due to the normal maps it has.

toglia

08-04-2008 06:21:09

I first tried doing a very simple 14 sided poly:


exported the nxs file satisfactorily with:
flour meshes type:triangle, in:c.mesh, out:c.nxs

in cake:
mScene->createBody("c.mesh", new ConvexShape("c.nxs"), Vector3(0,10,0));

but I get this runtime fatal error on file:
dbghook.c


Honestly I don't know if this is Flour related, but I didn't see anything wrong on Ogre/Nxogre logs.

Of course it works if I do this:
mScene->createBody("c.mesh", new TriangleMeshShape("c.mesh"), Vector3(0,10,0),"static:yes");


tried with:
NxOgre 0.9-38
PhysX 2.7.3
Eihort 1.4.6
Vista

Don't know if that helps...

betajaen

08-04-2008 10:16:46

You should use Flour with Bleeding; older versions expect a Ogre mesh.

mr_burns

08-04-2008 10:53:47

Hi betajaen,

can you disclose what algorithm(s) you are using to generate the convex hulls?

can you go into any details that impacted upon your decision?

cheers,
B.

betajaen

08-04-2008 11:37:16

There is no algorithms. Flour just receives the vertices from the mesh and gives it to the PhysX Convex cooker which is where the convex hull is generated.

betajaen

09-04-2008 20:10:00

I've finally uploaded the source for anyone who wants it. It's mostly an empty shell though; nearly all of the processing is done by NxOgre.

gugus

14-04-2008 15:40:20

Floor doesn't create any file,only NxOgre.Leacks.What's happening?I tried convex and triangle on Ogre meshes.

betajaen

14-04-2008 16:02:59

Come on you know the rules. Details please.

gugus

14-04-2008 16:20:20

I installed flour with the .msi then i copied it to OgreSDK/media/models.I runed a terminal and wrote this in:
flour meshes type: convex, in: robot.mesh, out: test.nxs
and there are no message,only a new file NxOgre.leaks.What should I do?
Edit:the file NxOgre.leaks seems to be empty.

betajaen

14-04-2008 16:22:13

Convex meshes have a vertex limit of around 255. It's probably crashing because of that; use a simpler mesh that is a convex like and has less vertices.

gugus

14-04-2008 16:23:35

well the same thing happens if i put triangle instead of mesh.I am using PhysX 2.7.3,could it be the probleme?

betajaen

14-04-2008 16:37:52

Yes.

gugus

14-04-2008 16:42:44

Ok i am going to install PhysX 2.8.

Edit:it doesn't work.I unistall PhysX 2.7.3,installed 2.7.8,recompiled NxOgre,reinstalled floor,but it still doesn't work.
I am using XP Pro and Visual C++ express 2008(never know,could change some unknown parameters)

Artic_Ice83

14-04-2008 22:41:46

did you install the bleeding version of NxOgre?

betajaen

14-04-2008 22:53:52

Flour doesn't need NxOgre to run, it's statically linked, like Ogre. What it does need is the 2.8.0 PhysX Software. Which is of course available from Ageia but also a spare copy is in the flour folder at NxOgre.org

Artic_Ice83

15-04-2008 22:35:10

ok. now i've understood :oops:

gugus

16-04-2008 11:03:53

It seemes that my installation of PhysX_8.02.13_SystemSoftware was corrupted. I reinstalled it and it works fine now.

viperman1271

25-05-2008 20:27:41

Hello

Awesome tool. However, I might make a slight suggestion to add to the code.

For people who aren't necessarily used to using command line tools, adding a try and catch statement so that the code goes from:

int main(int argc, char *argv[]) {

std::string arg;

if (argc > 2) {
for (int i=2; i < argc;i++) {
if (i != 2)
arg.append(" ");
arg.append(argv[i]);
}
}
else {
what();
return 1;
}

std::string command = argv[1];

params.setToDefault();
params.process(arg);

if (command == "meshes" || command == "mesh") {
MeshConverter::Convert(params, arg);
}
else if (command == "heightfield" || command == "hf") {
HeightfieldConverter::Convert(params, arg);
}
else {
printf("What?\n");
help();
}


return 1;
}


to this:


int main(int argc, char *argv[]) {

try {
std::string arg;

if (argc > 2) {
for (int i=2; i < argc;i++) {
if (i != 2)
arg.append(" ");
arg.append(argv[i]);
}
}
else {
what();
return 1;
}

std::string command = argv[1];

params.setToDefault();
params.process(arg);

if (command == "meshes" || command == "mesh") {
MeshConverter::Convert(params, arg);
}
else if (command == "heightfield" || command == "hf") {
HeightfieldConverter::Convert(params, arg);
}
else {
printf("What?\n");
help();
}
}
catch (Ogre::Exception ogEx) {

printf("OgreException: %s\n\n", ogEx.what());
}

return 1;
}


The biggest reason being a path problem with people inputting the incorrect file location(s) and not being able to use the tool properly

fatpwnage

18-06-2008 17:50:02

When converting a large mesh I am getting the error: "This mesh is made up of more than 65536 convex parts. This is invalid. Please use a smaller mesh".

Is this a PhysX limitation or a Flour limitation? The mesh in question is a 50 MB .mesh file with around 200,000 vertices.

betajaen

18-06-2008 18:15:38

Both.

200,000 is an insane number of vertices that you can throw at a physics engine. You shouldn't have that amount in an entire scene let alone in a mesh.

You really need to turn that down to around 200.

fatpwnage

19-06-2008 00:11:03

Well, the mesh represents the terrain in the scene, but I think I will make it smaller. (I can't use a heightmap because the terrain requires overhangs)

betajaen

19-06-2008 08:35:12

You are using converting it as a triangle mesh (and not a convex mesh) with your mesh? I assumed it was for a convex mesh.

You can use higher numbers of vertices with triangle meshes, I don't know the exact number but start of with 16,384 and see how it goes. I would also suggest splitting up the mesh into separate quadrants, and attach each to a different actor. Implement a simple system to turn off each quadrant when there is no action in the area.

fatpwnage

19-06-2008 23:28:26

Sorry I didn't specify, i was converting it into a triangle mesh. In the mean time I have reduced the number of vertices in the mesh to around 40,000 which works fine with flour :)

I would also suggest splitting up the mesh into separate quadrants, and attach each to a different actor. Implement a simple system to turn off each quadrant when there is no action in the area.

If I split my mesh up into several actors will PhysX not automatically turn them on/off when there is no activity nearby?

betajaen

19-06-2008 23:34:30

I think it may do some optimisation but it would be very low-level internal collision code; it wouldn't disable any actors. That's all on you.

acropole

19-07-2008 10:38:49

The msi installer seems to be broken.
It start, then stop, and there is no way to find any flour folder, shortcut etc. in C:

betajaen

19-07-2008 11:26:51

It just quickly writes it self to C:/Program Files/Flour, and quickly exits.

zissakos

19-07-2008 13:49:08

It took me some time to realize that, too.

Why not just provide a flour.exe file?

reptor

19-07-2008 14:51:28

I recommend that the installer idea be dropped and just provide a ZIP file containing the Flour executable (and documentation).

*If* the case remains so that it actually does not need to write into a system folder, such as the "Program Files".

That way the "artist" does not need to have administrator access to his computer just for installing Flour. Installing PhysX is another thing.

It can be an installer and not a ZIP, but the requirement to install it to a system folder is what (unnecessarily) requires the administrator rights as it is now.


Or maybe you want to include the PhysX Game Installer in the Flour installer. The Flour installer would check if the user doesn't have the correct version of PhysX installed, and then would go on and install it from the PhysX Game installer (this would then at least require an administrator account, if I am not mistaken). That would be more simple for the users, but would increase the size of the Flour package.

betajaen

19-07-2008 15:51:05

I believe it's something to do with the manifests and visual c++ dll's that have to be included. I have a better solution which will install Flour/NxOgre/Cake and PhysX dlls in the next release of NxOgre instead of downloading it from SVN. It will also be a proper installer; specifying paths, setting up any required environmental paths, etc.

radsun

19-07-2008 20:36:04

I have a problem with flour:
D:\Ogre>flour heightfield in:mapa2.raw out:mapa2.xhf
[NxOgre] Unable to start the PhysX SDK!
[NxOgre]
[NxOgre] Please refer to the developer or publisher's website or support -
[NxOgre] line for information relating to the errors detailed.
[NxOgre]
[NxOgre] -> Error Code: NXCE_PHYSX_NOT_FOUND
[NxOgre] - Reason: Unable to find the PhysX libraries. The PhysX drivers-
[NxOgre] are not installed correctly.
[NxOgre]
[NxOgre]
[NxOgre]
[NxOgre]
[NxOgre] Application information:
[NxOgre] - PhysX => 2.8.0
[NxOgre] - NxOgre => NxOgre 1.0.22 Bleeding Edge
[NxOgre] - Ogre => 1.4.6 'Eihort'.
[NxOgre] - Platform => Windows
[NxOgre] - Error => NXCE_PHYSX_NOT_FOUND
[NxOgre]

Of course i have Physx sdk installed :)

betajaen

19-07-2008 21:17:15

It may be down to the version of the driver; Try installing the one that comes in the same folder as flour.

radsun

19-07-2008 21:26:33

Thanks, that helped :D

Prophet

20-08-2008 17:27:18

I made a "plug-in" for dummies (like myself) that spends to much timing on figuring it out. I don't know, just felt like sharing.
Download

Btw, where's cake?

reptor

06-09-2008 21:22:02

Flour crashes if it does not have write access to the directory in which the flour.exe is.

It writes the output file to the directory in which the input file is, but it tries to write a log file to the directory in which the flour.exe is.

Caphalor

16-09-2008 21:12:12

My Editor has the ability to generate, if necessary, .nxs files on the fly using flour. I do it this way:

Ogre::String command = "flour meshes type: triangle, in: " + path + ", out: Data/Media/Meshes/NXS/" + meshname + ".nxs";
system(command.c_str());

Flour says "flour.exe has occured a problem and must be terminated", although it does its job very well (nxs file is created and copied to the right directory). If I enter the same command directly in the command prompt there is no error. Do you have hints for me how to embed flour into my editor the right way? What am I doing wrong?
Maybe it's related to the error reptor posted, I don't know.

betajaen

16-09-2008 21:17:02

What am I doing wrong?

Not a clue, I'm afraid. Your syntax seems fine and I assume it's writing to the correct directory. Nothing in the NxOgre/Ogre log?

Anyway' I have rewritten Flour from scratch this time, amongst being more easier to add different modules in (and libraries/headers are separate from each other), it should be less "crashable".

Oh; I'm working on an new module called "view" that lets you see the PhysX NXS mesh compared to the Ogre mesh - within a window or within your editor. ;)

You'd better appreciate it; I'm working on an new image compression format just for a special never seen before BetaGUI just for that single feature!

Caphalor

16-09-2008 21:24:45

For the moment it's ok to click on "Nicht senden" (microsoft problem report). :D
Good to hear that you are working on a new version of flour.
My Editor is wxWidgets based so I don't use BetaGUI at the moment but the view feature sounds interesting. ;)

Edit: "Nicht senden" = "do not send". :P

betajaen

16-09-2008 21:30:50

The BetaGUI bit goes within the view window, just to give stats of the mesh and quit the application. To work inside your editor, you just provide a handle to what ever control you want it to render to, and it tells Ogre to render to it.

It's a very handy feature that seems so obvious and powerful when you think about.



Thanks for that report; I'm sure Microsoft will phone me with the answer. :D

Prophet

16-09-2008 22:04:35

I had the same "problem". Are you using Ogre 1.6 perhaps? I got this "error" when I switched, I think.

Caphalor

17-09-2008 09:14:31

Yes I use Ogre 1.6.

NoodlesOnMyBack

06-10-2008 18:08:45

I need to call Flour from code, but not from a command, its there already some version compiled to work as a helper? I do it myself if not already, but just to avoid some extra work.

betajaen

06-10-2008 18:17:11

No. Flour is a load of classes and functions.

What do you need to do? In most cases Flour is a wrapper for the ManualMesh in NxOgre.

NoodlesOnMyBack

06-10-2008 18:34:39

No. Flour is a load of classes and functions.

What do you need to do? In most cases Flour is a wrapper for the ManualMesh in NxOgre.


I need to generate the Triangle and Convex shapes as a batch process to the exported stuff just before i load the scene, i guess then that i'll do it from the cmd... but i had some problems running Flour, i'll keep trying...

[EDIT]Flour is working fine now...[/EDIT]