Game Development Community

Exporting to T3D gives strange values.

by Richard Marrevee · in pureLIGHT · 11/01/2011 (11:50 am) · 4 replies

I would appreciate it if someone can explain what is happening when I export a scene to T3D. The problem is that I get strange values for the lights.

I set up some lights in pureLight (imported with an .ASE) and changed the value for power to 5 and range to 1, bake it and published it to Torque 3 D. Now when I look at this light in the .mis file I get the following result:

new PointLight(LS_Floor1_0) {
				radius = "32";//<= strange value
				isEnabled = "1";
				color = "1 1 1 1";
				brightness = "1";
				castShadows = "0";
				attenuationRatio = "0 1 1";
				shadowStaticGeometry = "1";
				shadowDynamicGeometry = "1";
				lightDynamicGeometryDiffuse = "1";
				lightStaticGeometryDiffuse = "0";
				lightDynamicGeometrySpecular = "1";
				lightStaticGeometrySpecular = "1";
				position = "0 0 0";
				rotation = "1 0 0 0";
				scale = "1 1 1";
				position = "117.8712 92.99904 1.2947";
				color = "1 1 0.737255 1";
				radius = "5";// Right value I think but why is radius set twice?
				brightness = "5";// Don't know about this, but also set for the second time
				castShadows = "1";// again for the second time
				representedInLightmap = "1";
			};

I hope somebody can give me an explanation what is happening here.

Thanks

About the author

Started programming in 1984 on an Oric, when time progressed switched to MSX, Amiga and finally the Windows PC with T3D. Now developing an epic fantasy game: The Master's Eye. Creator of the DoorClass pack and VolumetricFog pack @ richardsgamestudio.com


#1
11/02/2011 (9:06 am)
That is a strange bug in our exporter. It was writing out the default value for those 3 settings and then writing out the proper setting for those 3 settings again.

It shouldn't cause any problems. Torque 3D just reads in and sets those properties twice, overwriting the first instance. If you look in the editor, its using the right values.

I've fixed this for the next release.
#2
11/02/2011 (12:59 pm)
I thought it was something like that, although setting the brightness level to the same value as the radius gives a lot of light.
#3
11/02/2011 (1:18 pm)
Yeah, its hard to get the lights to match between the 2 programs. Even if the equations were identical, the light in pureLIGHT would be effectively brighter because of the indirect lighting being present. There's also the difficulty that object lights pose in Torque, as it doesn't support using arbitrary mesh geometry as a dynamic light.

Actually, I see that the light range parameter isn't being factored into the radius of the exported Torque light either.

I'm torn on whether or not its better to just import the lights and have them turned off in Torque initially and let the user set them, or to try to automatically approximate the difference in lighting parameters between the 2 programs and risk overlighting/underlighting the scene (you'll likely need to adjust them anyways to get the specular light and dynamic objects lit right).
#4
11/02/2011 (1:54 pm)
@Thomas:
Thanks for the info, it's very useful.