Submeshes

Evak

07-08-2006 20:44:14

Hi, I'm wondering if there is any way in Ofusion to export multiple meshes as submeshes in a single .Mesh file.

I was asking in the main forum about whether it would be possible to have the mesh file updated to support basic heirarchy and Xavier mentioned that you could allready do that with his exporter.


At the moment, we have three-six .mesh files per single "entity" in the project.


Is there a reason you cannot model these entities as a single mesh?

If you are using Max you can try my plugin-based exporter, which allows you to group all selected mesh objects into a single file as submeshes (it's the only Ogre exporter I know of for any tool that has that feature).


Some features of ofusion arent well documented like groups etc, so maybe the option is already there.

Quick reason why I want submeshes is that I have a bunch of Aerial Antics objects for my game I'm porting to ogre. It uses inverted black meshes to create outlines and I want to be able to disable shadow casting and recieving from the outline mesh, and enable them for the regular mesh. And also disable edge list building for the outline mesh too.

Lioric

08-08-2006 03:15:00

Using subMeshes as a form of hierachy is wrong, that is not the purpose of submeshes, submehses are a collection of geometric data used to organize an efficient rendering of objects, that is why we dont support groups as submeshes (and because groups are used for scene managers partitioning)

In oFusion, the submehses (optimized submeshes) are automatically created by the mesh compiler, they are parts of geometry that has a different material, so in your example you can attach the "outline object" to the "solid object" and if they have different material (most probable in your case) they are created as submeshes (as parts of the object's mesh)

In your application you can load the exported object and access the outline subMesh with its material name, i.e


outlineSubMesh = objectMesh->getSubMesh("outLineMaterialName");


Its a myth that oFusion dont support subMeshes, submeshes are since the first iteration, the mesh compiler and optimizer always supported generation of optimized subMeshes

But we dont support using groups to create submeshes, when you see a group of people, you dont refer to each person in the group as a subPerson, or a group of cars, and to each element as a subCar

Object groups are used to help manage the hierachy of its elements, and to create a cell on Portal based scene managers, but not to merge its elements

In your example attach the outline to the regular mesh, and access the outline or the regular subMeshes with each material name

Evak

08-08-2006 19:13:43

Thanks for the info, I'm not very familiar with the low level workings of Ogre, so this is pretty usefull stuff. I'm going to have to start reading through the Ogre docs more thoroughly and work out how Ofusion interfaces with hte engine.

Paulov

21-12-2006 09:54:52

Hi.
I´ve a plaza scene wich is my test scene. Iám able to export the elements grouped (attached) according to their nature. They are exported as a single mesh depending on various factors, their entity (each building will be a .mesh) or in their lightmaps sice (streetlamps are attached not to have big lightmaps sices etc...)

so now I know how "cut" my scene in different pieces (.mesh) I want to have it loaded in other aplication in a single clik with objets in their place.

Talking with a person told me it was possible to do it with submeshes, and now I found this:

Using subMeshes as a form of hierachy is wrong,

well so, which one is the correct way to build a hierarchy?

I dont want to attach more the elements because it makes the scene very "rigid" you cant aply physics to certain objets etc, also makes the scene hard to upgrade in max.

Even more, I CANT attach more the scene since each objet that is a .mesh file has ogre materials, and I´ve seen that when attaching objets with iogre materials only the material of the initial objets is keeped, the attached objet will be untextured.

bye

Lioric

23-12-2006 15:19:00

The correct way to use hierarchy is via linking nodes, and load it using the exported osm file, this file contains all the hierarchy information needed to load the scene exactly as it was exported

If your application dont supports osm files, ask for its support, the osm scene loaded library can be added very easy to any application