UE3 vert count in 3DSMAX?

Anyone have some fast maxscript code to get an accurate UE3 vert count? AFAIK UE3 creates an extra vertex for every “hard vertex” (achieved via smoothing groups) and all texture verts (i.e. open UV edges will create double verts along the edge).

If no one has anything I’ll make something and then post it here. Thanks!

I have never encountered this problem when exporting meshes into unreal from Max. Unreal chews through polys and verts, what kinds of number differences are you getting?

off topic: on your company’s website, i like how the word polish turned into “Beautification” :slight_smile:

[QUOTE=Gizmosan;3975]I have never encountered this problem when exporting meshes into unreal from Max. Unreal chews through polys and verts, what kinds of number differences are you getting?

off topic: on your company’s website, i like how the word polish turned into “Beautification” :)[/QUOTE]

Its not a “problem”, it just that you get better performance the more polygons share vertices because they will be cached. This will be the same for all engines.

I’d be interested in a script, I thought about doing something similar but later on in our pipeline for inspection use. You could have Max verts vs Engine Verts and work out how “good” the model is. Another quick thing to add is polygon density checking, for when too many polys are used in a small space.

[QUOTE=Gizmosan;3975]I have never encountered this problem when exporting meshes into unreal from Max. Unreal chews through polys and verts, what kinds of number differences are you getting?[/QUOTE]

I believe Unreal Engine actually duplicates the verts. For example, I have a mesh in Max that uses a lot of smoothing groups and has unwelded UV vertices. The vert count in max is 172 and in Unreal it is 280. Go ahead and try it! Create a mesh with smoothing groups and broken UVs and you’ll see that there is a huge discrepency in vert count between the two. This is actually a legitimate performance concern!

[QUOTE=Gizmosan;3975]off topic: on your company’s website, i like how the word polish turned into “Beautification” :)[/QUOTE]

Ah, yes. Marketing buzzwords for teh win. 2 year old videos still on the website? Fail.

[QUOTE=mikiex;3979]Its not a “problem”, it just that you get better performance the more polygons share vertices because they will be cached. This will be the same for all engines.

I’d be interested in a script, I thought about doing something similar but later on in our pipeline for inspection use. You could have Max verts vs Engine Verts and work out how “good” the model is. Another quick thing to add is polygon density checking, for when too many polys are used in a small space.[/QUOTE]

Not super-high on my priority list at the moment but when I find out exactly what’s happening to the verts I’ll post it here!

[QUOTE=jrapczak;3984]

Not super-high on my priority list at the moment but when I find out exactly what’s happening to the verts I’ll post it here![/QUOTE]

This happens in every engine. This is how the verts are inside the GPU on all modern hardware, if you haven’t noticed before its because it was hidden from you.

There is no way to improve this other than trying to have as many “shared” verts as possible in your model and not as many “unique” verts.

[QUOTE=mikiex;3986]This happens in every engine. This is how the verts are inside the GPU on all modern hardware, if you haven’t noticed before its because it was hidden from you.

There is no way to improve this other than trying to have as many “shared” verts as possible in your model and not as many “unique” verts.[/QUOTE]

Indeed, however, my point is that I’m trying to figure out how to actually count this up inside 3DSMAX since MAX’s default stats don’t operate this way. I want the artists to be able to judge how efficient their modeling and texturing is using this as a factor… A single bevel using shared verts costs as much as no bevel with unique verts, and from an artist’s perspective this is not intuitive and not obvious in MAX.

[QUOTE=jrapczak;3987]Indeed, however, my point is that I’m trying to figure out how to actually count this up inside 3DSMAX since MAX’s default stats don’t operate this way. I want the artists to be able to judge how efficient their modeling and texturing is using this as a factor… A single bevel using shared verts costs as much as no bevel with unique verts, and from an artist’s perspective this is not intuitive and not obvious in MAX.[/QUOTE]

Im pretty sure its easy to work out, I dont have Max to check here though, I’ll look when I’m at work.

someone at polycount posted a script for this I think, you may search the forums there or search scriptspot. I am fairly sure it has been done before.

edit after searching:
http://boards.polycount.net/archive/index.php/t-34743.html
http://jhaywood.com/stuff/HaywoodTools-UberVertCount.zip

don’t forget that number of bone influences also affects this. it has been a couple of years since i used unreal, so you should double check this number on udn (i know it has been posted in unprog and unedit several times), but i think the max bones per mesh is something like 45. after that, the mesh gets chunked and your vert count increases again. it’s a lot of bones but it can easily add up when you start tossing in fingers etc.

just another case to consider if you’re writing a script, don’t want to make it work for some cases but not others.

[QUOTE=CrazyButcher;3989]someone at polycount posted a script for this I think, you may search the forums there or search scriptspot. I am fairly sure it has been done before.

edit after searching:
http://boards.polycount.net/archive/index.php/t-34743.html
http://jhaywood.com/stuff/HaywoodTools-UberVertCount.zip[/QUOTE]

Nice find! Mr. Haywood’s script reports the exact UE3 vertex count inside 3DSMAX for the skeletal mesh I tested, albeit after a pause for processing (287 verts vs. 145 in MAX). Gonna see if I can speed it up.

Maybe an option to highlight (select) edges where the mesh is split would be useful.

What you really want to show the artists is the vert to tri ratio - which you can get by dividing the number of triangles in the model by the number verts that the script gives you. The least efficient model will have a vert to tri ratio of 3 - meaning that each triangle has its own unique set of three verts and there’s no vertex sharing happening at all. The most efficient models will have a vert to tri ratio of 1 or less - meaning that every tri is sharing its verts with other tris. If you can keep your vert to tri ratio for all models below 1.2 or 1.3 you’re doing pretty good.

At that last company I worked with, the model exporter spit out this info and then gave the artist an efficiency score that helped them see how well their model was using verts. This really helped our performance since the artists started caring about getting good scores and noticing when there were problems.

It’s pretty amazing how many more polygons the game can push when everything is using verts efficiently.