T3D 1.1 Preview - Strange Material Behavior on Collada Model - LOGGED (THREED-3171)
by Ryan Mounts · in Torque 3D Professional · 05/23/2011 (10:38 am) · 12 replies
Build: 1.1 Preview, Release, Pro (no modifications)
Platform: Windows XP Pro 32-bit, and Windows 7 Home 64-bit
Target: Material Editor
Issue: Downloaded a car model from Turbosquid for testing, exported from 3dsmax 2011 using OpenCollada, and opened in T3D. Many materials that had only a diffuse color and no diffuse texture displayed with the wrong color (e.g. material had red diffuse color but displayed as dark gray). The colors were different on the two different platforms specified above, but both were wrong. Changing certain parameters would fix the color, like adding a white diffuse texture or enabling specular or sub surface. Changing some parameters like specular on one material would also change the color of another material. Also, not all parameters will save properly. For example, disabling/enabling specular on either of the chrome materials and saving seems to work next time you open T3D. But disabling/enabling specular or changing specular color on Material__38 (the car body) will save for the current session, but next time T3D is opened it will still be the old values.
Steps to Repeat:
1. Unzip the car model folder in your "game/art/shapes" directory of the FPS Example
2. Launch the game and load the Blank Room level
3. Place the car into the scene
4. Try some the things mentioned above in the Material Editor
Note: I have modified these materials to make them resemble the 3dsmax model. If you want to see the original state, delete the DTS and materials.cs and reload the model from the DAE.
Platform: Windows XP Pro 32-bit, and Windows 7 Home 64-bit
Target: Material Editor
Issue: Downloaded a car model from Turbosquid for testing, exported from 3dsmax 2011 using OpenCollada, and opened in T3D. Many materials that had only a diffuse color and no diffuse texture displayed with the wrong color (e.g. material had red diffuse color but displayed as dark gray). The colors were different on the two different platforms specified above, but both were wrong. Changing certain parameters would fix the color, like adding a white diffuse texture or enabling specular or sub surface. Changing some parameters like specular on one material would also change the color of another material. Also, not all parameters will save properly. For example, disabling/enabling specular on either of the chrome materials and saving seems to work next time you open T3D. But disabling/enabling specular or changing specular color on Material__38 (the car body) will save for the current session, but next time T3D is opened it will still be the old values.
Steps to Repeat:
1. Unzip the car model folder in your "game/art/shapes" directory of the FPS Example
2. Launch the game and load the Blank Room level
3. Place the car into the scene
4. Try some the things mentioned above in the Material Editor
Note: I have modified these materials to make them resemble the 3dsmax model. If you want to see the original state, delete the DTS and materials.cs and reload the model from the DAE.
#2
05/23/2011 (12:40 pm)
Works now.
#3
05/23/2011 (4:09 pm)
@Ryan Mounts: Have you tried saving the changes that you've made to the model and restarting Torque?
#4
Can someone upload this to here ? :
torque.abigholeintheweb.com/uploadpanel.php
thx
05/23/2011 (5:06 pm)
Mediafire isn't working for me..I've tried this several times.Can someone upload this to here ? :
torque.abigholeintheweb.com/uploadpanel.php
thx
#6
Absolutely. The changes seem to work for some materials on the car and not others. One of the problem materials I know off the top of my head is "toycar_Material__38". I change the specular color and specular power, save it, and it stays when I close the Material Editor. Close Torque and reopen it, and the changes are gone.
Also, I noticed that "toycar_Material__38" has a materialTag0 = "vegetation"; parameter in the materials.cs file. No idea why that is there. And there are several others with that tag.
... Ok, just did a little investigation. Reloading from the DAE and getting a new materials.cs, there are multiple copies of the same material (e.g. three Metal_Chrome, three Material__38) in the cs file. So who knows which one the Material Editor is seeing, and since they are all singletons, they're just overwriting each other, causing the changes to be "lost". As for the strange material tags, I don't see any of those, so they must have come from the Material Editor when editing and saving the materials.
Thanks for the help, guys. And sorry about the Mediafire issues.
05/24/2011 (6:45 am)
@ChristopherAbsolutely. The changes seem to work for some materials on the car and not others. One of the problem materials I know off the top of my head is "toycar_Material__38". I change the specular color and specular power, save it, and it stays when I close the Material Editor. Close Torque and reopen it, and the changes are gone.
Also, I noticed that "toycar_Material__38" has a materialTag0 = "vegetation"; parameter in the materials.cs file. No idea why that is there. And there are several others with that tag.
... Ok, just did a little investigation. Reloading from the DAE and getting a new materials.cs, there are multiple copies of the same material (e.g. three Metal_Chrome, three Material__38) in the cs file. So who knows which one the Material Editor is seeing, and since they are all singletons, they're just overwriting each other, causing the changes to be "lost". As for the strange material tags, I don't see any of those, so they must have come from the Material Editor when editing and saving the materials.
Thanks for the help, guys. And sorry about the Mediafire issues.
#7
@Ryan, are you all set or do you still need an extra hand ?
05/25/2011 (12:23 pm)
I just came back to check on the zip file. Thanks for the upload Steve. Mediafire was giving me all sorts of trouble.@Ryan, are you all set or do you still need an extra hand ?
#8
Out of curiousity, am I the only one seeing this behavior?
In the end, I don't mind chalking this up to a "bad" DAE, since it's not mine. :) But maybe this example could help lead to T3D handling bad DAE's more gracefully in the future.
05/25/2011 (12:41 pm)
Hey eb, any help would be much appreciated. I can't really devote much time to this at the moment. I modified my DAE by hand to give distinct names to the materials that were mapped to the same names, which "helped". In the end, though, I still get materials that don't save properly and can affect each other. It very well may be some wonky mapping of the materials in the DAE file (I've never had this problem with any Collada object I've specifically created for Torque... this one is from Turbosquid), but it is still interesting how the material system is getting confused. Changing a parameter for one material should not change the appearance of another material, for example.Out of curiousity, am I the only one seeing this behavior?
In the end, I don't mind chalking this up to a "bad" DAE, since it's not mine. :) But maybe this example could help lead to T3D handling bad DAE's more gracefully in the future.
#10
These are all material__38 because of the dae file having "Material__38_1","Material__38", and "Material__38_2" associated to "Material__38".
It's a cute car with an ugly set of properties. You're not crazy. :P
05/26/2011 (12:58 am)
I was able to save the materials fine. I was also able to see the multiple materials affecting each other: example:body/tires. These are all material__38 because of the dae file having "Material__38_1","Material__38", and "Material__38_2" associated to "Material__38".
It's a cute car with an ugly set of properties. You're not crazy. :P
#11
05/26/2011 (6:42 am)
Haha, that's kinda the conclusion I had come to also. Thanks for checking it out.
#12
01/11/2012 (2:46 pm)
Logged as THREED-3171.
Torque 3D Owner Andy Wright
BrokeAss Games