[Beta 3 Bug] UV Animation
by Gary Hoffmann · in Torque 3D Professional · 06/25/2009 (10:44 am) · 5 replies
UV animation in the materials doesn’t seem to work correctly on any layer except layer 0.
Go to layer 1, add a diffuse map. Check scrolling animation and set some simple values. Nothing will animate. Now, go back to layer 0, turn on scrolling animation and input some different values. Both layer 0 and layer 1 will animate using layer 0’s settings.
Now, if you return to layer 1 and uncheck scrolling, the layer 1 will correctly stop animating. However, if you uncheck layer 0 scrolling, instead, both layer 0 and layer 1 will stop animating.
Go to layer 1, add a diffuse map. Check scrolling animation and set some simple values. Nothing will animate. Now, go back to layer 0, turn on scrolling animation and input some different values. Both layer 0 and layer 1 will animate using layer 0’s settings.
Now, if you return to layer 1 and uncheck scrolling, the layer 1 will correctly stop animating. However, if you uncheck layer 0 scrolling, instead, both layer 0 and layer 1 will stop animating.
#2
//--- testobj.dae MATERIALS BEGIN ---
singleton Material(testobj_SimpleMultilayerMaterial)
{
diffuseMap[0] = "art/shapes/test/simpleBaseMaterial1.png";
mapTo = "SimpleMultilayerMaterial";
diffuseColor[0] = "1 1 1 1";
specular[0] = "0.5 0.5 0.5 1";
specularPower[0] = 13;
pixelSpecular[0] = false;
emissive[0] = true;
doubleSided = false;
translucent = false;
translucentBlendOp = "None";
diffuseMap[1] = "art/shapes/test/simpleBaseMaterial2.png";
animFlags[1] = "0x00000001";
scrollDir[1] = "0.172 0.276";
scrollSpeed[1] = "1.294";
};
//--- testobj.dae MATERIALS END ---
Still doesn't work when restarted. Yep, the editor shows the correct values, checkboxes for the material.
The only way I've been able to get the UV of layer 1 to animate correctly is to debug into the application and set the anim flag directly on the material object sitting in memory. It seems like the scroll direction and speed are loading correctly but that the animFlag itself is being lost somewhere when its loaded from the file.
06/25/2009 (11:30 am)
Here's the material.cs created by the editor://--- testobj.dae MATERIALS BEGIN ---
singleton Material(testobj_SimpleMultilayerMaterial)
{
diffuseMap[0] = "art/shapes/test/simpleBaseMaterial1.png";
mapTo = "SimpleMultilayerMaterial";
diffuseColor[0] = "1 1 1 1";
specular[0] = "0.5 0.5 0.5 1";
specularPower[0] = 13;
pixelSpecular[0] = false;
emissive[0] = true;
doubleSided = false;
translucent = false;
translucentBlendOp = "None";
diffuseMap[1] = "art/shapes/test/simpleBaseMaterial2.png";
animFlags[1] = "0x00000001";
scrollDir[1] = "0.172 0.276";
scrollSpeed[1] = "1.294";
};
//--- testobj.dae MATERIALS END ---
Still doesn't work when restarted. Yep, the editor shows the correct values, checkboxes for the material.
The only way I've been able to get the UV of layer 1 to animate correctly is to debug into the application and set the anim flag directly on the material object sitting in memory. It seems like the scroll direction and speed are loading correctly but that the animFlag itself is being lost somewhere when its loaded from the file.
#3
Weird that we haven't seen it before, but really it was only possible once the Material Editor put all the features and power of the material system in yout face to use.
06/25/2009 (2:00 pm)
Well... this is a bug then for sure. Weird that we haven't seen it before, but really it was only possible once the Material Editor put all the features and power of the material system in yout face to use.
#4
To get the UV animation working I changed line 645 in processedShaderMaterial from:
U32 i=0;
to
U32 i=pass;
However, I've now noticed a few bugs with the material editor itself:
1) Anytime I switch to a different layer in the material editor, the UV animation scrolling checkbox will be unchecked and I'll have to check it again.
2) If I remove a normal map from the material, the material updates in game but the normal map reference is never removed from the materials.cs, so it will just show up again when I restart the game (right now it looks like it has to be manually removed by editing the materials.cs)
06/27/2009 (4:09 pm)
Got this working. However, it made a couple of bugs in the material editor pretty apparent.To get the UV animation working I changed line 645 in processedShaderMaterial from:
U32 i=0;
to
U32 i=pass;
However, I've now noticed a few bugs with the material editor itself:
1) Anytime I switch to a different layer in the material editor, the UV animation scrolling checkbox will be unchecked and I'll have to check it again.
2) If I remove a normal map from the material, the material updates in game but the normal map reference is never removed from the materials.cs, so it will just show up again when I restart the game (right now it looks like it has to be manually removed by editing the materials.cs)
#5
I just committed the fix... lets hope this time we have it solved for good. :)
Thanks Gary!
06/29/2009 (12:11 am)
Funny... this bug has come up and been fixed many times.I just committed the fix... lets hope this time we have it solved for good. :)
Thanks Gary!
Associate Tom Spilman
Sickhead Games
When you save the material go and open the material.cs file for it. Does it show the right UV animation settings for layer 0 and 1? If you edit the material in the .cs file, save, and restart the game does it animate properly?