Animate UVs Warning

Software: Away3D 4.x

John Brookes, Moderator
Posted: 31 January 2013 12:51 PM   Total Posts: 732

Warning: animateUVs is set to true with an IRenderable without a uvTransform. Identity matrix assumed.

If you use animate UVs and set the same U or V value as a previous one
uvTransformDirty is not set (submesh line 60 & 70)
and causes the trace warning (DefaultScreenPass line 583)

private function initObjects():void
{
 
var splitH:Number = 8
 
var splitV:Number = 8
 
var depth:Number = 69;
 var 
i:int = 0;
 var 
j:int = 0;
 
 var 
mat:TextureMaterial = new TextureMaterial(Cast.bitmapTexture(new ImageEmbed()));
 
mat.animateUVs = true;
 
 var 
cont:ObjectContainer3D
 
var planeFrontMesh:Mesh
 
var pg:PlaneGeometry
 pg 
= new PlaneGeometry(1920 / splitH, 1080 / splitV, 1, 1, false)
 
 for (
i = 0; i <= splitH - 1; i++)
 
{
  
for (j = 0; j <= splitV - 1; j++)
  
{
       c ObjectContainer3D
();
   
cont.x = 1920 / splitH * i - 1920 / 2 + 1920 / (splitH * 2);
   
cont.y = 1080 / splitV * -j + 1080 / 2 - 1080 / (splitV * 2);
   
cont.z = depth / 2;
   
scene.addChild(cont);
   
       
planeFr Mesh(pg, mat);
   
planeFrontMesh.z = -depth / 2;
   
cont.addChild(planeFrontMesh);
   
   
planeFrontMesh.geometry.scaleUV(1 / splitH, 1 / splitV);
   
//causes UV warning
   
planeFrontMesh.subMeshes[0].offsetU = ((1 / splitH) * i);
   
planeFrontMesh.subMeshes[0].offsetV = (1 / splitV * j);
   
   
//note this doesnt cause the trace warning as offsetU is never the same as the last value set
   //so uvTransformDirty is set and matrix assigned
   //planeFrontMesh.subMeshes[0].offsetU = 1/i;
  
}
 }
} 

 

   

John Brookes, Moderator
Posted: 31 January 2013 12:56 PM   Total Posts: 732   [ # 1 ]
for (j = 0; j <= splitV - 1; j++)
  
{    c ObjectContainer3D(); 


And this forum keeps eating code samples.
c o n t = new ObjectContainer3D();

Posted this
https://gist.github.com/4682713
and thats what I get above

   

Matej, Jr. Member
Posted: 20 February 2013 11:10 AM   Total Posts: 38   [ # 2 ]

I get the same, seems like you avoid the traces by changing to different uv and then return back to default:)

mesh.meshes[0].subMeshes[0].offsetU = 1;     
mesh.meshes[0].subMeshes[0].offsetU = 0; 
   

John Brookes, Moderator
Posted: 20 February 2013 11:18 AM   Total Posts: 732   [ # 3 ]

yeah.
I just comment out the line that traces the warning smile

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X