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 : MethodVO, stage3DProxy : 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(vo, stage3DProxy);
}
When I drop the above lines, performance is back to normal.
Is this not the correct way of passing data to the shader code?