Torque 3d and milkshape exporters - RESOLVED
by Bloodknight · in Torque 3D Professional · 09/04/2011 (8:39 am) · 15 replies
As far as I can tell this is consistent across all models I've exported.
oh, just as a side note, for the sake of this discussion poly=tri i may us the terms interchangeably many apologise if that upsets any pedantic purists out there, and if torque could be changed so that it says tri instead of poly in its reporting that may save confusion for other people too.
I have a model, 1152 polys, exported from milkshape it tranforms into a model with many more polys.
Shipped MS2DTS exporter : 6892 polys
MS2dtsplus exporter v2.7.3 : 2962 polys
MS2dtsplus exporter v2.8.3 : 2962 polys
I have no other way of testing whether or not this reported value is real or imagined, I suspect that the reported number is actually false but I have no way of proving that right now.
I do know that ive had several scenes with some horribly unoptimised and high poly models in it, and if the real poly value was over 2.5 as many I think I would have seen a further performance hit. So from a purely empirical opinion the values are false.
I did manage to get the model exported to blender and then blender to export a DAE and the model did report the correct number of faces, however this is not a real solution to the problem if in fact it is a real problem.
I'll continue to investigate and report any further findings in this thread.
oh, just as a side note, for the sake of this discussion poly=tri i may us the terms interchangeably many apologise if that upsets any pedantic purists out there, and if torque could be changed so that it says tri instead of poly in its reporting that may save confusion for other people too.
I have a model, 1152 polys, exported from milkshape it tranforms into a model with many more polys.
Shipped MS2DTS exporter : 6892 polys
MS2dtsplus exporter v2.7.3 : 2962 polys
MS2dtsplus exporter v2.8.3 : 2962 polys
I have no other way of testing whether or not this reported value is real or imagined, I suspect that the reported number is actually false but I have no way of proving that right now.
I do know that ive had several scenes with some horribly unoptimised and high poly models in it, and if the real poly value was over 2.5 as many I think I would have seen a further performance hit. So from a purely empirical opinion the values are false.
I did manage to get the model exported to blender and then blender to export a DAE and the model did report the correct number of faces, however this is not a real solution to the problem if in fact it is a real problem.
I'll continue to investigate and report any further findings in this thread.
About the author
#2
09/04/2011 (2:08 pm)
Is it counting collision polys? LOD polys?
#3
Ive tracked as far back as TSMesh::getNumPolys() beyond that needs somebody with more technical understanding than me at this point, but somweher between torque loading a DTS and showing it on the shape editor, the poly count is going somewhat astray
09/04/2011 (4:23 pm)
Nope, none of those exist, but i have a cube with 32 polys instead of 12 :pIve tracked as far back as TSMesh::getNumPolys() beyond that needs somebody with more technical understanding than me at this point, but somweher between torque loading a DTS and showing it on the shape editor, the poly count is going somewhat astray
#4
IMO this one needs to be looked at, whether or not T3D is importing 2-3x as many polys I dont know, for all I know it is, which means that my pipeline is badly broken.
And no, I dont want to hear about openCOLLADA, if your only response to this issue is collada go make yourself go blind in the corner, I'm not interested.
09/09/2011 (11:56 am)
Bumping this one up just for community hour.IMO this one needs to be looked at, whether or not T3D is importing 2-3x as many polys I dont know, for all I know it is, which means that my pipeline is badly broken.
And no, I dont want to hear about openCOLLADA, if your only response to this issue is collada go make yourself go blind in the corner, I'm not interested.
#5
I dont have experience with the MS exporter, no idea if it does any tri-stripping or listing, but try disabling it if it does and see if it helps... maybe?
09/09/2011 (3:16 pm)
I have had issues w the blender exporter and using the tri-stripping mode, doubling the number of polys on import of the dts. I dont have experience with the MS exporter, no idea if it does any tri-stripping or listing, but try disabling it if it does and see if it helps... maybe?
#6
I just tried exporting a cube from Milkshape using the v2.8.3 ms2dts exporter. The shape editor shows it having 12 polys (as expected). Can you send me your cube model that is displaying 32 polys in the shape editor?
I couldn't see anything obviously wrong in TSMesh::getNumPolys. Tri-stripping can increase the number of reported polygons (as some may be degenerate when restarting the strip), but I wouldn't have expected a 2-3x increase.
09/11/2011 (9:57 pm)
Hi Bloodknight,I just tried exporting a cube from Milkshape using the v2.8.3 ms2dts exporter. The shape editor shows it having 12 polys (as expected). Can you send me your cube model that is displaying 32 polys in the shape editor?
I couldn't see anything obviously wrong in TSMesh::getNumPolys. Tri-stripping can increase the number of reported polygons (as some may be degenerate when restarting the strip), but I wouldn't have expected a 2-3x increase.
#7
dl.dropbox.com/u/38119855/testcubebaby.rar
As stated, it shows fine in showtool pro, but in meshloop and T3D the count is increased. The exporter dump file states 12 polys, so i'm confident that the mesh and the number of polys in the mesh itself is fine, but something is definitely going on between import and display of the polycount.
09/12/2011 (5:44 am)
Heres the complete set, ms3d file, dts and texturedl.dropbox.com/u/38119855/testcubebaby.rar
As stated, it shows fine in showtool pro, but in meshloop and T3D the count is increased. The exporter dump file states 12 polys, so i'm confident that the mesh and the number of polys in the mesh itself is fine, but something is definitely going on between import and display of the polycount.
#8
So....TSMesh::getNumPolys will be modified in T3D 1.2 to ignore degenerate triangles in a strip. Code below for those that can't wait.
09/12/2011 (1:11 pm)
Thanks for the test file - I see now what the issue is. The shape editor is displaying the total number of triangles in the mesh, *including* degenerate triangles for triangle-strips. This is technically correct (the best kind of correct), but probably not as useful to display as the non-degenerate triangle count (12 in this case).So....TSMesh::getNumPolys will be modified in T3D 1.2 to ignore degenerate triangles in a strip. Code below for those that can't wait.
S32 TSMesh::getNumPolys() const
{
S32 count = 0;
for ( S32 i = 0; i < primitives.size(); i++ )
{
switch (primitives[i].matIndex & TSDrawPrimitive::TypeMask)
{
case TSDrawPrimitive::Triangles:
count += primitives[i].numElements / 3;
break;
case TSDrawPrimitive::Fan:
count += primitives[i].numElements - 2;
break;
case TSDrawPrimitive::Strip:
// Don't count degenerate triangles
for ( S32 j = primitives[i].start; j < primitives[i].start+primitives[i].numElements-2; j++ )
{
if ((indices[j] != indices[j+1]) &&
(indices[j] != indices[j+2]) &&
(indices[j+1] != indices[j+2]))
count++;
}
break;
}
}
return count;
}
#9
This does bring up another question however. why does this happen only to MS3D DTS exports? and does this impact on performance at all. If its counting them they are there right? I mean the fix is just not count the bits you dont like... sounds like a florida election count :p
09/12/2011 (5:35 pm)
Cool, i'll add that soon.This does bring up another question however. why does this happen only to MS3D DTS exports? and does this impact on performance at all. If its counting them they are there right? I mean the fix is just not count the bits you dont like... sounds like a florida election count :p
#10
It will happen for any DTS exporter that converts triangle lists to strips. The ms2dts exporter uses the tri-stripper included in the DTSSDK.
Modern hardware should detect and cull degenerate triangles. No idea what impact this has on performance, and whether it negates any performance gained by using triangle strips. Would likely depend on the mesh, and how well it stripifies. One opinion.
09/13/2011 (12:49 am)
Quote:why does this happen only to MS3D DTS exports?
It will happen for any DTS exporter that converts triangle lists to strips. The ms2dts exporter uses the tri-stripper included in the DTSSDK.
Quote:and does this impact on performance at all. If its counting them they are there right?
Modern hardware should detect and cull degenerate triangles. No idea what impact this has on performance, and whether it negates any performance gained by using triangle strips. Would likely depend on the mesh, and how well it stripifies. One opinion.
#11
10/05/2011 (12:32 pm)
To me a model of 5000 polygons, transforms it into polygons 28.000/30.000 from MilkShape to DTS format. is a real problem because we will slow down everything.
#12
10/05/2011 (12:50 pm)
@Antonio: what he's saying is there are a lot of "degenerate" triangles in there, which aren't really triangles. They are connections between less than three vertices, or basically line segments. This is necessary in order to make a TriStrip, which is an efficient form of storing a mesh. Chris is also saying that the graphics hardware should be ignoring all these anyway, so it shouldn't slow anything down.
#13
10/05/2011 (1:05 pm)
The problem is that everything slowed down when I approached the imported model.
#14
10/11/2011 (2:31 pm)
Fixed in 1.2
#15
02/08/2012 (6:32 pm)
im loving these fixes
Torque 3D Owner Bloodknight
Bloodknight Studios
Shipped MS2DTS exporter : 1152 polys
MS2dtsplus exporter v2.7.3 : 1248 polys
MS2dtsplus exporter v2.8.3 : 1248 polys
Which actually just confuses me more in some respects, i'm happy that the exporter isnt suddenly tripling my mesh size, but now i dont know what T3D is doing with the .dts file.