Custom Shader/Method, is updating fragmentData / fragmentConstant a heavy operation?

Software: Away3D 4.x

3dNewb, Sr. Member
Posted: 20 September 2012 01:28 PM   Total Posts: 105

I notice a serious performance decrease ( from 60FPS to 30FPS ) when my custom shader ‘s “activate” method is setup like this:

My method extends BasicDiffuseMethod

override arcane function activate(vo MethodVOstage3DProxy Stage3DProxy) : void
 {
 
var index int vo.fragmentConstantsIndex 3;
 var 
data Vector.<Number> = vo.fragmentData;
 
data[index+1] _data[0][0];
 
data[index+2] _data[0][1];
 
data[index+3] _data[0][2]
 data[index
+4] _data[0][3];

super.activate(vostage3DProxy);
  

When I drop the above lines, performance is back to normal.

Is this not the correct way of passing data to the shader code?

   

3dNewb, Sr. Member
Posted: 20 September 2012 01:38 PM   Total Posts: 105   [ # 1 ]

Nevermind, it seems that the shader AGAL code itself is causing the performance drop.

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X