Confirmation needed: bug with CmodTool??

General discussion about Celestia that doesn't fit into other forums.
Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Confirmation needed: bug with CmodTool??

Post #1by ElChristou » 07.12.2005, 14:07

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?
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #2by Cham » 07.12.2005, 15:48

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 ?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #3by dirkpitt » 08.12.2005, 22:00

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.

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #4by Cham » 08.12.2005, 22:19

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #5by dirkpitt » 09.12.2005, 02:35

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.

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #6by Cham » 09.12.2005, 02:38

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?
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #7by dirkpitt » 13.12.2005, 17:51

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.

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #8by Cham » 13.12.2005, 17:57

Thanks Dirkpitt,

I'll try the new version later today.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #9by ElChristou » 13.12.2005, 18:45

dirkpitt wrote:...After some painful hours...


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

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #10by Cham » 13.12.2005, 19:22

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #11by Cham » 13.12.2005, 19:32

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #12by ElChristou » 13.12.2005, 20:00

Ok, the wireframe is also good for me, but as Cham, the FPS is quite bad... :?
Image

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #13by dirkpitt » 14.12.2005, 01:32

Is the size of your generated mesh smaller or bigger with the triangle-strip option selected, compared to when the option is not selected?

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #14by Cham » 14.12.2005, 01:35

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.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #15by ElChristou » 14.12.2005, 01:48

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...)
Image

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #16by dirkpitt » 14.12.2005, 15:20

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.

Topic author
ElChristou
Developer
Posts: 3776
Joined: 04.02.2005
With us: 19 years 9 months

Post #17by ElChristou » 14.12.2005, 15:23

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...
Image

Avatar
Cham M
Posts: 4324
Joined: 14.01.2004
Age: 60
With us: 20 years 10 months
Location: Montreal

Post #18by Cham » 14.12.2005, 15:28

Going inside the model doesn't show any face. They are transparent on one side.
"Well! I've often seen a cat without a grin", thought Alice; "but a grin without a cat! It's the most curious thing I ever saw in all my life!"

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #19by dirkpitt » 14.12.2005, 16:04

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.

Avatar
dirkpitt
Developer
Posts: 674
Joined: 24.10.2004
With us: 20 years 1 month

Post #20by dirkpitt » 14.12.2005, 16:07

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...


Return to “Celestia Users”