MeshSerializer_V2.1

Discussion area about developing with Ogre-Next (2.1, 2.2 and beyond)


Post Reply
User avatar
GlowingPotato
Goblin
Posts: 211
Joined: Wed May 08, 2013 2:58 pm
x 10

MeshSerializer_V2.1

Post by GlowingPotato »

Hey,

I'am attempting to update my meshes. With the latest source, My mesh version is MeshSerializer_V2.1 R0 LEGACY. Is there a newer one ? I have a mesh from spookyboo thats beeing used on his HLSM editor that is using version MeshSerializer_V2.1 R2 ... where can I find this?
User avatar
dark_sylinc
OGRE Team Member
OGRE Team Member
Posts: 5271
Joined: Sat Jul 21, 2007 4:55 pm
Location: Buenos Aires, Argentina
x 1266
Contact:

Re: MeshSerializer_V2.1

Post by dark_sylinc »

I realized I never explained what this naming convention means.

There are two mesh file formats: v1 and v2.
v1 has had an update. The current latest v1 format is: MeshSerializer_v2.1 R0 LEGACYV1
  • "v2.1" means it was written during the development of Ogre 2.1
  • "R0" is the revision number. If we later add something new to the format while still developing Ogre 2.1; we will increase it to R1. Then R2, R3 and so on. This ensure we don't break compatibility with our users who are actively working with Ogre 2.1 the next time their pull from the repo. It would be a disaster if we broke compatibility. However we plan that the final version of Ogre 2.1 (when we officially release it) to remove compatibility with these temporary R0-Rn-1 formats and only leave RN as the final version. Users should be able to upgrade via OgreMeshTool before that happens. But forcing them to upgrade every single time we update something is insane.
  • LEGACYV1 means it's a v1 format, which can be opened by Entity. To open it via Item, you need to import the mesh to a v2 format (as shown in V2Mesh sample).
The v2 format has had already multiple revisions. At the time of writing, the latest v2 format is: [MeshSerializer_v2.1 R2]
  • "v2.1" means it was written during the development of Ogre 2.1
  • "R2" means this is the 3rd revision.
  • Lack of LEGACYV1 word means this is a v2 format, which can be opened by Item. To open via Entity, you need to import the mesh to a v1 format (OgreMeshTool shows how to do this; it's basically the reverse of importing a v1 into a v2)
Your mesh is a the latest version... of the v1 format. To convert to v2, use "OgreMeshTool -v2" to force a v2 mesh. The mesh tool recommends the following parameters for optimum performance and minimum file size:

Code: Select all

Recommended params for modern DESKTOP (w/ normal mapping):
   OgreMeshTool -e -t -ts 4 -O puqs sourcefile [destfile]
Recommended params for GLES2 (w/ normal mapping):
   OgreMeshTool -e -t -ts 4 -O qs sourcefile [destfile]
Recommended params for modern DESKTOP (w/out normal mapping):
   OgreMeshTool -e -O puqs sourcefile [destfile]
Recommended params for GLES2 (w/out normal mapping):
   OgreMeshTool -e -O qs sourcefile [destfile]
Add -v2 to force a v2 output.
User avatar
GlowingPotato
Goblin
Posts: 211
Joined: Wed May 08, 2013 2:58 pm
x 10

Re: MeshSerializer_V2.1

Post by GlowingPotato »

Hey!

Thanks very much!

On a quick note though...
Today I'am using a mesh version 1.8 (Entities) and I was testing the new format... I converted using this line "OgreMeshTool -e -t -ts 4 -O pus source.mesh target.mesh" (not using the 'q' flag since I'am not using QTangents).

The mesh opens and render correctly. But without material. I opened the mesh with a text editor to make sure the material name is OK, and it is. I haven't gone deep on this yet. But does it ring a bell for you?
User avatar
Kojack
OGRE Moderator
OGRE Moderator
Posts: 7157
Joined: Sun Jan 25, 2004 7:35 am
Location: Brisbane, Australia
x 534

Re: MeshSerializer_V2.1

Post by Kojack »

GlowingPotato wrote:The mesh opens and render correctly. But without material.
I had similar results to that. I couldn't use the mesh tool to convert a v1 with tangents to a v2 with tangents. No matter what I did with flags, the result was always having tangents stripped, so PBS materials fail to apply to the Item, leaving it white.
Using the v1 to v2 conversion in C++ worked fine, it's just the stand alone mesh tool that had the issue.

I haven't had time to look into it further yet.
User avatar
GlowingPotato
Goblin
Posts: 211
Joined: Wed May 08, 2013 2:58 pm
x 10

Re: MeshSerializer_V2.1

Post by GlowingPotato »

Thanks Kojack for replying!

I hope we can increment this fix along with this one. http://www.ogre3d.org/forums/viewtopic.php?f=25&t=85491
Post Reply