collada and LODs
by Andy Simon · in Torque 3D Professional · 07/15/2009 (3:15 pm) · 9 replies
Hey guys,
I'd like to do some optimization to my levels. Is it possible to setup LODs with models exported in collada format? I couldn't find much on forum search and nothing specific to torque 3d on google.
Another question is does T3d support occlusion objects or is that something you have to develop yourself? Thanks for any input!
I'd like to do some optimization to my levels. Is it possible to setup LODs with models exported in collada format? I couldn't find much on forum search and nothing specific to torque 3d on google.
Another question is does T3d support occlusion objects or is that something you have to develop yourself? Thanks for any input!
About the author
#2
07/15/2009 (10:56 pm)
I think ill try out 1. tomorrow and see how it goes. Thanks a lot chris!
#3
07/16/2009 (1:23 am)
Am I to understand that TSShapeConstructor is kind of like an "auto-LOD" feature that will modify and create LOD meshes?
#4
No. TSShapeConstructor does not create LOD meshes. It does give you the ability to:
- change the detail size of a mesh
- add meshes from other DTS or DAE files into your shape
- add auto-billboards
07/16/2009 (4:32 pm)
Quote:Am I to understand that TSShapeConstructor is kind of like an "auto-LOD" feature that will modify and create LOD meshes?
No. TSShapeConstructor does not create LOD meshes. It does give you the ability to:
- change the detail size of a mesh
- add meshes from other DTS or DAE files into your shape
- add auto-billboards
#5
07/16/2009 (9:10 pm)
But perhaps someone could still explain how to access this TSShapeConstructor is the procedure to use it You have a DTS you need to edit nodes on then what??
#6
1. If you're only editing nodes and sequences of the DTS (or DAE) shape, just use the Shape Editor tool. It uses TSShapeConstructor behind the scenes, but takes care of the script creation and editing for you in an easy-to-use GUI (complete docs for this tool are also coming with beta4).
2. If you need to roll your own TSShapeConstructor script, follow the steps already posted on these forums here and here.
It really is quite straightforward (once you get started). Create the script, then add the commands that do what you want. The existing documentation might be a bit light on tutorials, but it is a fairly complete reference to the commands that are available.
07/16/2009 (11:33 pm)
@Richard: Updated TSShapeConstructor docs should be coming out with beta4. One of the examples outlines exactly the steps to create and use a TSShapeConstructor object. In the meantime, you have two options:1. If you're only editing nodes and sequences of the DTS (or DAE) shape, just use the Shape Editor tool. It uses TSShapeConstructor behind the scenes, but takes care of the script creation and editing for you in an easy-to-use GUI (complete docs for this tool are also coming with beta4).
2. If you need to roll your own TSShapeConstructor script, follow the steps already posted on these forums here and here.
It really is quite straightforward (once you get started). Create the script, then add the commands that do what you want. The existing documentation might be a bit light on tutorials, but it is a fairly complete reference to the commands that are available.
#8
I am also trying to get LOD working with collada files (T3D beta5).
I have tried this, a file named fountain.cs which is in the same directory as the fountain.dae file:
fountain.cs is executed, and I see this for dumpshape:
But I get this error:
The help I need is what syntax do I need for
that will work with this collada file?
Will this even work???
Cheers!
Andy
08/19/2009 (4:44 pm)
Hi all,I am also trying to get LOD working with collada files (T3D beta5).
I have tried this, a file named fountain.cs which is in the same directory as the fountain.dae file:
// Fountain
//--- OBJECT WRITE BEGIN ---
function FountainDae::onLoad(%this)
{
%this.addMesh("art/interiors/fountain/models/fountain_LOD.dae", "Mesh_Objec", "test128");
%this.dumpShape();
}
singleton TSShapeConstructor(FountainDae)
{
baseShape = "art/interiors/fountain/models/fountain.dae";
};
//--- OBJECT WRITE END ---fountain.cs is executed, and I see this for dumpshape:
Shape Hierarchy:
Details:
detail2, Subtree 0, objectDetail 0, size 2
Subtrees:
Subtree 0
dummy
Model
skp168C1
skp168C
Mesh_Objec1
Mesh_Objec
mesh1 --> Object mesh1 with following details: 2
mesh2 --> Object mesh2 with following details: 2
mesh3 --> Object mesh3 with following details: 2
mesh4 --> Object mesh4 with following details: 2
mesh5 --> Object mesh5 with following details: 2
mesh6 --> Object mesh6 with following details: 2
mesh7 --> Object mesh7 with following details: 2
mesh8 --> Object mesh8 with following details: 2
mesh9 --> Object mesh9 with following details: 2
mesh10 --> Object mesh10 with following details: 2
mesh11 --> Object mesh11 with following details: 2
mesh12 --> Object mesh12 with following details: 2
mesh13 --> Object mesh13 with following details: 2
mesh14 --> Object mesh14 with following details: 2
mesh15 --> Object mesh15 with following details: 2
mesh16 --> Object mesh16 with following details: 2
mesh17 --> Object mesh17 with following details: 2
mesh18 --> Object mesh18 with following details: 2
mesh19 --> Object mesh19 with following details: 2
mesh20 --> Object mesh20 with following details: 2
mesh21 --> Object mesh21 with following details: 2
mesh22 --> Object mesh22 with following details: 2
mesh23 --> Object mesh23 with following details: 2
mesh24 --> Object mesh24 with following details: 2
mesh25 --> Object mesh25 with following details: 2
mesh26 --> Object mesh26 with following details: 2
mesh27 --> Object mesh27 with following details: 2
mesh28 --> Object mesh28 with following details: 2
mesh29 --> Object mesh29 with following details: 2
mesh30 --> Object mesh30 with following details: 2
mesh31 --> Object mesh31 with following details: 2
mesh32 --> Object mesh32 with following details: 2
mesh33 --> Object mesh33 with following details: 2
mesh34 --> Object mesh34 with following details: 2
mesh35 --> Object mesh35 with following details: 2
mesh36 --> Object mesh36 with following details: 2
mesh37 --> Object mesh37 with following details: 2
Camera
Sequences:
Material list:
material #0: 'material_0_1_0'.But I get this error:
TSShape::addMesh: Could not find mesh 'Mesh_Objec' in shape
The help I need is what syntax do I need for
%this.addMesh("art/interiors/fountain/models/fountain_LOD.dae", "Mesh_Objec", "test128");that will work with this collada file?
Will this even work???
Cheers!
Andy
#9
I assume that the "fountain_LOD.dae" is another model that contains the LOD mesh you want to use? Or are you trying to change the detail size of existing meshes in the "fountain.dae" model file?
In either case, the second argument to the 'addMesh' method is the name of the mesh to add. The name you have specified, 'Mesh_Objec' is a node. If you wanted to add say, the 'mesh1' mesh, you would do:
This would create a new object called 'test' with a single mesh at detail size 128.
08/20/2009 (12:13 am)
The syntax for all of the TSShapeConstructor commands is listed under Artist Section/TSShapeConstructor here.I assume that the "fountain_LOD.dae" is another model that contains the LOD mesh you want to use? Or are you trying to change the detail size of existing meshes in the "fountain.dae" model file?
In either case, the second argument to the 'addMesh' method is the name of the mesh to add. The name you have specified, 'Mesh_Objec' is a node. If you wanted to add say, the 'mesh1' mesh, you would do:
%this.addMesh("art/interiors/fountain/models/fountain_LOD.dae", "mesh1 2", "test128");This would create a new object called 'test' with a single mesh at detail size 128.
Associate Chris Robertson
1. Setup your scene as for DTS export (with detail level markers and such), then export to collada.
2. Use TSShapeConstructor to operate on the model loaded into memory to add meshes and change their detail sizes (wait until beta4 to do this, beta3 has some bugs in TSShapeConstructor).