PDA

View Full Version : m15 utils



kryton9
14-12-2007, 00:43
This is a small utility that analyzes a m15 file and tells you the number of vertices, quads, triangles and polygons that are in the m15 file.

Just click on the Add/Load Model button and you can select multiple m15 files at one time.
Check the window caption for the status of what is going on. Some files with lots of vertices can take some time to analyze.

Petr Schreiber
14-12-2007, 11:11
Hi Kent,

very interesting utility.
Just few things:

When I click "Add model" it opens Open dialog in MyDocuments path - I would prefer program path
On some models I get GPF, try attached one


Fact is that the attached model has some color problems in thinEdge_Viewer too :), it is older one so maybe something is wrong with it.


Thanks,
Petr

kryton9
14-12-2007, 11:50
I got a fault too Petr.... strange as I tested on my computer with a lot of m15 files... it must be something in the file. I will need to look study when more awake :)

Petr Schreiber
14-12-2007, 12:51
Do not worry so much,

it is possible that file is corrupted. Maybe you could just put analysing in TRY/EXCEPT block and put in ShowMessage something.


Thanks,
Petr

kryton9
15-12-2007, 07:34
Petr I can verify that it is a bug in my program. My viewer I wrote in PowerBasic is able to open up the file with no problems. It must be in the quad / triangle analysis as the powerbasic one doesn't do that.

Thanks for helping me trace down problems.

kryton9
15-12-2007, 08:23
I found out what the problem is. I thought we discussed this, but maybe I am wrong... I thought only quads or triangles were saved out. In this file I see some polys with more than 4 verts making a face. I guess I need to check for regular polygons then too. I will need to put that in. Feels good to track the problem down... it was driving me crazy wondering what was wrong :)

Ok, I also found a bug in the m15 file... the VERTEXNUM is off from what is actually there by a few vertices.

Petr Schreiber
15-12-2007, 22:52
Good job Kent,

you were faster than me in catching the problem, perfect!


Thanks a lot,
Petr

kryton9
15-12-2007, 22:59
Even though the m15 util was buggy... it helped do what it is to do, that is analyze an m15 file.

I will finish fixing the bugs and put the new version up today.

Added later: There is something really wrong with my application and that m15 file. When I assign the red color value from line 20 it messes up the vertex count.
I have no idea why?

I will try to rewrite the whole thing in PowerBasic and see what happens, so there will be a delay in getting a nice working version, sorry about that.
I will remove the download from the first post for now and put up a good working one when I can write it :)

kryton9
18-12-2007, 01:41
It seems to be working fine now. The latest version 4 is available in the first post in this thread.

Petr Schreiber
18-12-2007, 19:34
Kent,

thanks a lot, works nice!

I have one crazy idea, if too mad please stop me.

I have in head idea of "release advisor" for longer time.
You would pass directory where you have script ( game ), and it would make some stats and suggestions.

You could view models, sort them by vertexcount/polycount, it could also check whether textures are power of two...

So you could see where possible bottlenecks ( model uses more than texture, too high polycount ) are, if there is need for texture resize and so on.

What do you think? I would not let all this work on you of course, when I will have more time ( soon! ) I could contribute some code too.


Bye,
Petr

kryton9
18-12-2007, 23:45
Petr, I understand what you are saying and it is a good idea, but in my recent readings...

I read where there is a way you can take a non power of 2 texture and make it a power of 2 texture in the code.

Petr Schreiber
19-12-2007, 12:35
Hi Kent,

that was just idea. It could be also ignored in case you target OpenGL 2.0 compliant cards.
Regarding resizing in code - it is also option, but why prolong loading time with such a operation ?


Bye,
Petr

kryton9
20-12-2007, 00:31
That's true Petr.