Game Development Community

Loading collada model in Torque Demo

by Jim (WhiteRaven) Burchfield · in Collada Test · 02/15/2011 (5:31 pm) · 8 replies

Trying to load a static model (28,129 polys)created in Blender (2.49a) and exported to Collada 1.4.1 .dae file. I am attempting to use Collada because of the poly limitation of the .dts file. Using .dts would require the model to be exported in multiple parts and them reassembled in Torque.

If the model is exported in parts (2 or more) they convert and load fine in the Torque Demo.

When I export the model in one piece, Torque crashes when attempting to initialize the shape. Is this possibly a memory or video problem? Based on the poly count information the export from Blender to .dae is fine. Torque does created the cached.dts file but again, crashes when attempting to display(initialize) the model.

Also, if I can solve this problem, how does one go about getting the collision model for the Collada shape?

#1
02/17/2011 (11:32 am)
Quote: Also, if I can solve this problem, how does one go about getting the collision model for the Collada shape?

Open T3D ( Torque Toolbox )
Select your Mission in the left window.
Open "World Editor" in the right Window.
Across the top of the new Window.. choose "Editors"
A drop down list opens.. choose "Shape Editor"
In the "Shapes" section on the right.. open your collada file you want to add a collision mesh to.
In the "Advanced Properties" window ( left of where you chose your model ).. click the "collision" tab.

If you need further help for the included options:
Across the top of the Torque Toolbox window, select "Help"
A Drop down list appears.
Choose "Online Documentation" , "Offline Documentation" , "Torque 3D Forums" , or simply press <ALT> F1
The Documentation has a search feature to easily locate the parts that interest you.
If there are multiple answers to your search, you can choose one of the links that are returned to you after the search is done.

Hope this helps.
#2
02/17/2011 (4:48 pm)
Thank you very much.

That will help a lot once I get the other part solved.

Not sure what the problem is, but I'm going to try to upgrade my memory and video and see if that solves it.

Are you aware of any file size limitation when importing a Collada model?
#3
02/17/2011 (5:21 pm)
Most folks suggest 9,000 to 10,000 polygon for a DTS object and that's likely because of the DTS exporter.
For all I know, there is no hardline limit for Collada in T3D but you need to consider the platform your game will run on.
Most times, a game will be played on low end computers and not on systems that can match your Developement System.

Just incase here is a tip or two:
When modeling your goal is to get a decent look with the fewest polygons possible.
When modeling, many polygons can be avoided by using properly UV'd textures.. so that say for example:
Your modeling a Home. The interior has old style Benches with Claws on the bottom of each leg of the bench.. those claws can be "faked" with few polygons for basic shape, and painted to appear like they are made from a much higher resolution.
Or:
House Windows, the entire side of the house can be covered with a texture that includes windows and you won't need to add polygons to create the illusion.
House floor moldings.. they can be just a shadow texture painted in rather then actual polygons.

Generally speaking, fewer polygons is your goal. The amount you use will depend on how close the player is to the object to scrutinize the object or how close the camera will be to the object.
The closer the camera or player camera will be to an object.. the higher the possibility you will need to add polygons.

This all depends on you and the game style.
#4
02/18/2011 (4:46 am)
Quote:Most folks suggest 9,000 to 10,000 polygon for a DTS object and that's likely because of the DTS exporter.

The Triangle 'limit' is on a PER MESH GROUP basis; I keep reading people posting this hard 'limit' of 10,000 Triangles for a DTS shape. IT IS SIMPLY NOT TRUE....please read up on the DTS format in the SDK!

I have exported shapes with close to 60,000 Triangles....works fine, not crashing the engine.

I think a lot of the 'Collada' crashing is due to the scale of the object....simply 'too large' physically, in regards to it's bounding box. What I see on a regular basis with DAE 'exports' is that the shape is roughtly 100 times larger than what you think it 'was' in the modeling program. If I remember correctly, if the centroid of the object is out of the camera 'view' things get really goofy....

My opinion is limit your crazy drawcalls and material memory usage....

Exporting to DTS straight away is not an option??

Quote:Also, if I can solve this problem, how does one go about getting the collision model for the Collada shape?

Read the documentation on the TSShapeConstructor object....with this construct, you can 'build' shapes...add meshes, add nodes, remove meshes, remove nodes......a lot of things are possible inside the engine.

...'Blender'...M'eh! Look where it's gotten you so far?!?

Milkshape3D is well within the budget of the 'Indy' developer and has a much better exporter to boot! Authored by the writer of the DAE/Collada loader for T3D....so, the choice is yours!
#5
02/18/2011 (1:21 pm)
As you indicated, everything that I have read indicates the 9-10k poly limit for .dts files. I don't know if that is because of the various exporters or an import limit in Torque. I do know that the models are truncated if they exceed that 9-10k poly limit.

I also know that I can export other formats (obj, 3ds, collada, etc) from Blender with no limitation on poly's but not .dts.

You indicated that you exported shapes with 60,000 polys but did not indicate what program you were exported from or to.

I am not the level creator. I am simply a modeler and am using the Torque 3D Demo package to verify loadability and textures, although I am planning on buying the engine.

You specifically mentioned Milkshape. I have tried Milkshape in the past and would be willing to give it another look.....if it will indeed export a model that large (60k) in one piece.

Again, thanks for the information.

#6
02/19/2011 (8:22 am)
It must be the 'Blender' exporter, if your meshes are being crunched into 10,000 Tris. I've used a few programs to generate the DTS/DSQ binaries; I mention Ms3d due to it's relatively inexpensive cost. I really only use Ms3d to produce my DTS/DSQ files and use other more animation centered packages for my mesh and sequence 'work'.

Milkshape3D has a natural program limitation of ~64,000 Triangles; those are the exports that I've pushed to my 'limit' for a DTS shape. I believe the format and the engine can handle more Triangles than what Milkshape can render/memory.

Quote:.....if it will indeed export a model that large (60k) in one piece.


You will need to 'regroup' in Ms3d to achieve a shape containing that number of triangles. If you do it 'logically' and 'intuitively', you can even get some nice effects for 'mesh hiding'. Your mesh groups for exporting to DTS should not contain more than the 10K limit.

NB: Don't confuse mesh groupings and a single DTS shape...you can have many 'groupings' of meshes inside a DTS shape, each of those can not exceed 10k tris...so you would break your 60K 'shape' into 6 separate groups, understand?
#7
02/25/2011 (5:15 pm)
Thanks Rex,

Your explanation of mesh groups versus single dts shapes allowed me to figure out how to use the Blender exporter to export large shapes.

I successfully exported this model (28k) to Torque from Blender in a single .dts shape.
#8
03/30/2011 (12:09 am)
good day everyone,
i bought milkshape 3d, and my models do not import correctly. I also get an error when texturing. do you have any tutorials to simply and successfully give me an idea of what i am doing? thanx in advance!