Game Development Community

First test failed. Deled Collada to collada test engine

by Mike Rowley · in Collada Test · 02/16/2009 (6:21 pm) · 15 replies

let's get this started with:

Sys specs: 
Hp Media Center 
Windows XP PRO media edition 
3700+ amd athlon 64 
1gb ram 
nVidia Geforce 7600 GT

Using DeleD pro with DeleD's collada exporter.


In DeleD

In the collada test engine

The files

All the parts of this object appear in the collada file. They just don't appear in torque.

#1
02/17/2009 (12:24 am)
Hi Mike,

Torque still only supports triangles, whether loaded from collada or DTS. If you look in the console log when the collada model is loaded (delete the cached DTS to force a reload), you will see a number of warning messages about unsupported geometry.
#2
02/17/2009 (3:43 pm)
That's odd becouse I have had that model in torque as a dts before. My test with another object that I've had in torque didn't even show at all.
I've asked the writer of the collada exporter for DeleD to contact Matt directly. It may be the way the collada exporter was written.
#3
02/17/2009 (4:00 pm)
There's nothing wrong with the collada file, it's just that it contains quads and Torque only supports triangles at the moment. The collada loader ignores (with a console warning) any unsupported geometry.

Most of the collada exporters I've seen have an option to triangulate on export.


Did your other object (that did not display at all) also give warnings in the console about unsupported geometry?
#4
02/17/2009 (5:00 pm)
Yes it did. I found by doing a box test that the exporter does Not triangulate on export, so I triangulated it in DeleD. It now shows,
but what's up with the shadowing? The side you are looking at is a solid blue. My other 2 objects are shadowing the same way.
The black shadow overlays the texture as I walk. It's weird that it's not square but rounded.
Both my other objects show up, but parts are missing. I'll have to dig into them to figure out why.
#5
02/17/2009 (6:49 pm)
Missing parts of objects are usually unsupported geometry (check the console for warnings about this => note that you only get the warning when loading the DAE file, not the cached DTS).

Feel free to pass on some of the DAE files that are causing you problems.


As for the shadowing => take a look at the materials.cs that was generated by the collada loader. Perhaps there is something weird going on there.
#6
02/17/2009 (7:14 pm)
You are correct about the missing parts. (I suspected it as well)

As for the shadowing, the material.cs files look great. Here is an example of the box. Only 1 side even shows the texture, another side shows 1 texture. (or actually a small circle of it)

Here is a video showing an in game view of the shadow problem.

Here is the box.dae, textures and material.cs that was generated by torque.
I included the box in the zip becouse it being the simplest model, shows the most problems. Odd.

I have one question... Would having numbers at the end of a texture name make any difference with the collada import? I know that when I export a dts from milkshape that the numbers are interpreted as lod.


#7
02/17/2009 (7:41 pm)
Numbers at the end of a texture name won't have any effect.

I think the trouble is the specularPower[0] value in all of the generated materials. eg:

if (!isObject(_delBox_dae_oliveGreen)) new Material(_delBox_dae_oliveGreen)
{
	baseTex[0] = "oliveGreen";
	mapTo = "oliveGreen";

	diffuse[0] = "1.000000 1.000000 1.000000 1.000000";
	specular[0] = "0.000000 0.000000 0.000000 1.000000";
	specularPower[0] = 0.000000;
	pixelSpecular[0] = true;
	emissive[0] = false;

	doubleSided = false;
	translucent = false;
	translucentBlendOp = "None";
};

The DeleD exporter does not specify any value for <shininess> in the collada file, so a value of 0 is used. If you change specularPower[0] to (eg) 100, the textures show up just fine.
#8
02/17/2009 (8:12 pm)
Ok. Thankyou. This is actually my first attempts with collada, so Im learning a lot.

For reference, Deled doesn't apply shininess to any texture. There is no way to add it at this time. It just exports whatever texture you use as is.

Thanks for the tip. I'll give that a try and see if it fixes my problems.
#9
02/18/2009 (2:45 pm)
Thanks Chris. That worked for the model exported directly from deled, But didn't for the one exported from milkshape.

I use milkshape a lot to export objects for torque. I export from deled in obj format, import into milkshape, export to dts. This time, (the building on the right) I exported from milkshape as collada. Still missing parts, but at least I'm getting somewhere.

I'm wondering if you could add to the importer to look for specpower, and if it isn't there, add a 100 instead of the default 0?
#10
02/18/2009 (3:24 pm)
Quote:That worked for the model exported directly from deled, But didn't for the one exported from milkshape.

Could you share the model exported from milkshape?

Quote:Still missing parts, but at least I'm getting somewhere.

Is it still the 'unsupported geometry' problem? Or something else?

Quote:I'm wondering if you could add to the importer to look for specpower, and if it isn't there, add a 100 instead of the default 0?

I think that's a good idea. Along with better defaults for other Material settings as well. Other Collada exporters I have encountered always include these values!
#11
02/18/2009 (3:41 pm)
Quote:Could you share the model exported from milkshape?

Sure.
It's the obj with the dae included that was exported from milkshape.

Quote:Is it still the 'unsupported geometry' problem?
Yes. It's still the unsupported geometry. It seems that it doesn't matter wether I triangulate this model or not. I still get the same errors, other than it shows up when it's triangulated with missing parts as opposed to just being a blank space.

Quote:
I think that's a good idea. Along with better defaults for other Material settings as well. Other Collada exporters I have encountered always include these values!
Cool. I've asked Paul-Jan from Deled to add this to his exporter.
The collada exporter for deled is relatively new.

Btw, thanks for all the help here. I'm learning as you are.
#12
02/18/2009 (6:51 pm)
I can be such a dunce. There is a triangulate feature in the exporter. I just missed it. The shadow problem is almost fixed. There is still an odd shadow with only a circle of color on the box. Aside from that, it appears I'm starting to sort out some of the problems I've had. (not doing too bad for using collada for the first time.)
#13
02/18/2009 (7:38 pm)
Good to hear about the triangulation. Ideally the Torque loader would perform this task automagically, but for now we're relying on the collada exporters to do it.

Problems with shadowing are almost certain to be issues with the materials.cs script generated by the loader. If you move the generated Materials above the BEGIN/END comment block, you can edit the values and they will not be overwritten when the collada file is next loaded.

Try setting these values (they are the defaults used by TGEA if no value is specified in the script):

specular[0] = "1.0 1.0 1.0 1.0";
specularPower[0] = 8;
pixelSpecular[0] = false;
#14
03/04/2009 (3:12 pm)
Hi Mike,

The new new Collada Test build here uses more appropriate default values for Material properties not present in the collada file.
#15
03/04/2009 (3:41 pm)
Cool. Downloading now. Thanks.