Page 1 of 2

Confirmation needed: bug with CmodTool??

Posted: 07.12.2005, 14:07
by ElChristou
Here is a problem found by Cham about the CMODtool:

When converting a model with the option "Optimize Triangle Lists to
Strips", the convertion is done but the result is a model with a really low frame rate within Celestia and a very strange wireframe (see picts):

Picture 1: the wireframe of a model in 3DS or in Cmod without "Optimize Triangle Lists to Strips" (good frame rate):
Image

Picture 2 : the same model converted with "Optimize Triangle Lists to
Strips" (very bad frame rate):
Image

The bad point is that a model converted without the option "Optimize Triangle Lists to Strips" is much bigger...
Now this convertion as been done on osX, so before all we need to know if the same problem occurs on Linux/Windows; someone can do the test?

Posted: 07.12.2005, 15:48
by Cham
Guys, this problem is very important. It appears on all models (any), but especially on big models with lots of pieces and details.

At first, I didn't noticed that bug, as we don't use the "wireframe" mode (ctrl-w) very often in Celestia. But then, I noticed that some big models became very slow in Celestia, if I used the CMOD version. The frame rate was MUCH lower than for the 3DS version, so there was clearly a problem. I had the idea to watch the model in "wireframe" mode, and discovered all that mess of "random" lines, on MANY big models (not just mine). I then used the CMODTool (OS X version from Dirkpitt) to make some new CMOD versions, trying the various options, and found that the "Optimize triangle lists to strip" was the culprit. Without that option, the CMOD version is working fine, like the 3DS version, but the CMOD file is then much biggger on the hard disk. So, any comments on this ?

Dirkpitt ?

Posted: 08.12.2005, 22:00
by dirkpitt
I've checked in my notebook for repairs so I can't do any meaningful debugging for the time being. I'll try and see what happens on a PC today. It seems likely that this is a problem with the NVIDIA tristrip library, or maybe a bad combination of option settings in CModTool.

Posted: 08.12.2005, 22:19
by Cham
dirkpitt wrote:or maybe a bad combination of option settings in CModTool.


I was using these options :

- Weld Vertices
- Generate Normals (usually 30% for spaceships and 60% for asteroids)
- Eliminate duplicate vertices
- Optimize triangle lists to strips.

I'm now using only the first, second and third of those options.

Posted: 09.12.2005, 02:35
by dirkpitt
hmm, I'm not seeing this on the PC version of cmodtool that I downloaded from Selden's page (http://www.lns.cornell.edu/~seb/celestia/) but I'm not sure that it actually uses the NvTriStrip library so results are inconclusive for now.

Posted: 09.12.2005, 02:38
by Cham
Dirkpitt,

I'm not using the other two options (Generate Tangents and Merge submeshes), because they are giving me some obscure message errors while trying to convert something. What do they do, anyway?

Posted: 13.12.2005, 17:51
by dirkpitt
Generating tangents can fail if the 3ds model does not already have normals and texture coordinates specified (I suspect that's why it fails in your case). I'm not sure what merge submeshes actually does or why it can fail.

Update: After some painful hours of debugging on my 400Mhz iMac G3 (the "megahertz myth" is indeed a myth: this piece of junk is certainly more than 3 times slower than my 1.33Ghz PowerBook and feels 10 times slower...), I made a new build of CModTool:

Download CModTool 1.0.2

Please try it out and let me know if it fixes the triangle strip optimization issue.

Posted: 13.12.2005, 17:57
by Cham
Thanks Dirkpitt,

I'll try the new version later today.

Posted: 13.12.2005, 18:45
by ElChristou
dirkpitt wrote:...After some painful hours...


Many, many Tx DW, I'll test it as soon as possible.
Bye.

Posted: 13.12.2005, 19:22
by Cham
Dirkpitt,

I've just tried the new version.

Well, the mesh in wireframe mode is now clean (no more messy lines), after using the "triangle lists to strip". However, the FrameRate is MUCH lower than without that option selected. On a complex model, I get about 8 FPS with the option selected, while I'm getting around 18 FPS without the option selected. So actually the problem isn't solved at all.

I'm using an ATI video card (X850 XT) on OS X Tiger 10.4.3, dual G5 2.0 GHz.

Posted: 13.12.2005, 19:32
by Cham
I've just made another test on another complexe model. With the new version and the option selected, I get a nice looking mesh in wireframe mode, but 6.6 FPS (in normal mode). The same model without the option selected gives 15.3 to 15.7 FPS.

Posted: 13.12.2005, 20:00
by ElChristou
Ok, the wireframe is also good for me, but as Cham, the FPS is quite bad... :?

Posted: 14.12.2005, 01:32
by dirkpitt
Is the size of your generated mesh smaller or bigger with the triangle-strip option selected, compared to when the option is not selected?

Posted: 14.12.2005, 01:35
by Cham
dirkpitt wrote:Is the size of your generated mesh smaller or bigger with the triangle-strip option selected, compared to when the option is not selected?


The file is bigger when it's made WITHOUT the triangle option.

The difference can be as big a one megabyte.

Posted: 14.12.2005, 01:48
by ElChristou
dirkpitt wrote:Is the size of your generated mesh smaller or bigger with the triangle-strip option selected, compared to when the option is not selected?


Yep can be much bigger... (got a model without -> 26Mo, with -> 18...)

Posted: 14.12.2005, 15:20
by dirkpitt
Since the triangle strip optimization reduced the geometry size, it really shouldn't increase rendering times unless something else is wrong, such as if the triangles were now being rendered double-sided. What this means it could be a problem with the triangle strip optimization library being used. Fixing the library, or trying out a different one will take some time unfortunately.

Posted: 14.12.2005, 15:23
by ElChristou
but then, why the problem don't occur on the Windows version???

If the triangles are rendered double face, it will be easy to verify this within Celestia; I cannot right now but I have some doubts...

Posted: 14.12.2005, 15:28
by Cham
Going inside the model doesn't show any face. They are transparent on one side.

Posted: 14.12.2005, 16:04
by dirkpitt
ElChristou wrote:but then, why the problem don't occur on the Windows version???


I can't confirm personally that the Windows version of cmodfix uses NvTriStrip (the triangle strip optimizer), and if it does, whether the same problem exists. The library is supposed to be cross-platform (see here: http://developer.nvidia.com/object/nvtr ... brary.html ), and ought to produce the same results on both Windows and OS X.

Posted: 14.12.2005, 16:07
by dirkpitt
Cham wrote:Going inside the model doesn't show any face. They are transparent on one side.


I guess the double-sided theory is busted...