Collada issue
by Chico Hermida · in Torque 3D Professional · 10/01/2009 (8:19 am) · 12 replies
Hi,
I'm just a beginner in Torque 3D engine, I'm having a issue using a Collada mesh, when I add the mesh for the first time in my project, the mesh looks fine:

But when i close and open the world editor again the mesh looks very bad:

Maybe i just need to change some settings, but as the documentation isn't complete i can't manage by myself how to solve this.
Looks like that the problem is something with the ".cached.dts" that is created.
Thanks,
Chico Hermida.
I'm just a beginner in Torque 3D engine, I'm having a issue using a Collada mesh, when I add the mesh for the first time in my project, the mesh looks fine:

But when i close and open the world editor again the mesh looks very bad:

Maybe i just need to change some settings, but as the documentation isn't complete i can't manage by myself how to solve this.
Looks like that the problem is something with the ".cached.dts" that is created.
Thanks,
Chico Hermida.
About the author
#2
I know we've seen this issue before... i can't remember at the moment what it was and how to fix it.
Hopefully Chris or one of the other artists on the forums will chime in here.
10/01/2009 (10:17 pm)
Hi Chico.I know we've seen this issue before... i can't remember at the moment what it was and how to fix it.
Hopefully Chris or one of the other artists on the forums will chime in here.
#3
10/01/2009 (10:41 pm)
How many polys Chico?
#4
OmegaDog, this model has 87.768 polys, i just imported one normal 3ds max model that i made here, to test the engine capability, without the .cached.dts this ran in a good performance with a gt260.
10/01/2009 (11:00 pm)
Thank you tom, i tried to find some fixes in the forum before post this, but i will look again for it :)OmegaDog, this model has 87.768 polys, i just imported one normal 3ds max model that i made here, to test the engine capability, without the .cached.dts this ran in a good performance with a gt260.
#5
For testing go ahead and export a <10k polys mesh or do this to your mesh before export use detatch and make 8 or 9 10k meshes then export.
AutoHD Link www.youtube.com/v/KlIeeK5waOE&hl=en&fs=1&rel=0&hd=1
10/01/2009 (11:18 pm)
I'am noticing a cached.dts problem with models with a huge single mesh split by the collada loader.For testing go ahead and export a <10k polys mesh or do this to your mesh before export use detatch and make 8 or 9 10k meshes then export.
AutoHD Link www.youtube.com/v/KlIeeK5waOE&hl=en&fs=1&rel=0&hd=1
#6
that building's LOD stages will be very difficult to control if the whole assembly uses one origin point.
10/01/2009 (11:37 pm)
why are you trying to make a 90,000 triangle building for a game engine? you're supposed to be trying to get the lowest plausible number of triangles for a single mesh. that building's LOD stages will be very difficult to control if the whole assembly uses one origin point.
#7
This is when portaling comes in. Though to be honest performance is decent without it.
10/02/2009 (12:14 am)
I've got a +90k untriangulated building, works fine ... admitedly it is the whole level. Split into an awful lot of seperate meshes.This is when portaling comes in. Though to be honest performance is decent without it.
#8
I'm trying this kind of highpoly models because i'm planning prepare some interactive applications for architectural visualization, and i need considering that i need a fast workflow to prepare this service, without the need to simplify the mesh. I'll need to work both with torquescript and maxscript reach a good speed in the whole process. At this moment i don't need a loot of control over the mesh, but this point that you touch make me think better for others not initialized projects.
Thanks
10/02/2009 (1:13 am)
OmegaDog, thank you very much, this trick worked perfectly here :).I'm trying this kind of highpoly models because i'm planning prepare some interactive applications for architectural visualization, and i need considering that i need a fast workflow to prepare this service, without the need to simplify the mesh. I'll need to work both with torquescript and maxscript reach a good speed in the whole process. At this moment i don't need a loot of control over the mesh, but this point that you touch make me think better for others not initialized projects.
Thanks
#9
A DTS exporter would have flagged a warning on export, but obviously COLLADA can be used for lots of things and has no idea that it'll be converted later to DTS format.
10/02/2009 (11:04 am)
Known as a truncated mesh - individual DTS mesh hits it's limit on vertexes and then mangles everything else. A DTS exporter would have flagged a warning on export, but obviously COLLADA can be used for lots of things and has no idea that it'll be converted later to DTS format.
#10
It will work on your modern PC,but will crash on others.
It's a potential bug,but it depends on the model,since each non detached vertex is a part in more than one triangle.
10/02/2009 (12:21 pm)
It is not good to export an object with 90k polygons,because not every one gpu supports 32 bit index registers.It will work on your modern PC,but will crash on others.
It's a potential bug,but it depends on the model,since each non detached vertex is a part in more than one triangle.
#11
T3D always uses 16-bit indices. The collada loader automatically breaks meshes up into 16-bit chunks if needed (you will see a warning message in the console when it does so), which is why the building appears correctly the first time it is loaded). It looks like something is going wrong when the shape is loaded/saved to DTS though.
10/19/2009 (2:00 am)
Quote:It is not good to export an object with 90k polygons,because not every one gpu supports 32 bit index registers.
It will work on your modern PC,but will crash on others.
It's a potential bug,but it depends on the model,since each non detached vertex is a part in more than one triangle.
T3D always uses 16-bit indices. The collada loader automatically breaks meshes up into 16-bit chunks if needed (you will see a warning message in the console when it does so), which is why the building appears correctly the first time it is loaded). It looks like something is going wrong when the shape is loaded/saved to DTS though.
#12
In tsMesh.cpp, in the TSMesh::convertToTris method, change the test to create a new primitive to this:
Then make a similar change for TSMesh::convertToSingleStrip:
and TSMesh::leaveAsMultipleStrips:
10/25/2009 (10:09 pm)
There was a bug when loading meshes that had more than 65k vertices with the same material from a DTS file. T3D automatically splits such meshes when loading from collada (DAE) but was incorrectly joining them back together when loading from DTS.In tsMesh.cpp, in the TSMesh::convertToTris method, change the test to create a new primitive to this:
newMat &= ~TSDrawPrimitive::TypeMask;
U32 start = primitivesIn[i].start;
U32 prevStart = (i > 0) ? primitivesIn[i-1].start : start;
U32 numElements = primitivesIn[i].numElements;
// Add a new primitive if changing materials, or if this primitive
// indexes vertices in a different 16-bit range
if ( ( newMat != prevMaterial ) ||
((indicesIn[prevStart] ^ indicesIn[start]) & 0xFFFF0000) )
{
if ( primitivesOut )Then make a similar change for TSMesh::convertToSingleStrip:
S32 newMat = primitivesIn[i].matIndex;
U32 start = primitivesIn[i].start;
U32 prevStart = (i > 0) ? primitivesIn[i-1].start : start;
U32 numElements = primitivesIn[i].numElements;
// Add a new primitive if changing materials, or if this primitive
// indexes vertices in a different 16-bit range
if ( ( newMat != prevMaterial ) ||
((indicesIn[prevStart] ^ indicesIn[start]) & 0xFFFF0000) )
{
// before adding the new primitive, transfer triangle indices
if ( triIndices.size() )and TSMesh::leaveAsMultipleStrips:
S32 newMat = primitivesIn[i].matIndex;
U32 start = primitivesIn[i].start;
U32 prevStart = (i > 0) ? primitivesIn[i-1].start : start;
U32 numElements = primitivesIn[i].numElements;
// Add a new primitive if changing materials, or if this primitive
// indexes vertices in a different 16-bit range
if ( triIndices.size() &&
(( newMat != prevMaterial ) ||
((indicesIn[prevStart] ^ indicesIn[start]) & 0xFFFF0000) ))
{
// material just changed and we have triangles lying around
Torque 3D Owner Chico Hermida