float3 P = DoPos(inPos); //this might already be there, so just reuse it if it is
float force_x = DoDefault(vecSkill41.x*(0.1/50),0.1);
float force_y = DoDefault(vecSkill41.y*(0.1/50),0.1);
float offs = vecTime.w+0.2*(P.x+P.y+P.z);
float speed = sin(offs * DoDefault(vecSkill41.z*(0.05/50),0.05));
if(inPos.y > 0 ) // move only upper part of tree
{
inPos.x += speed * force_x * inPos.y;
inPos.z += speed * force_y * inPos.y;
inPos.y -= 0.1*abs(speed*(force_x+force_y)) * inPos.y;
}
Out.Pos = DoTransform(inPos); //this should already be in the other shaders, just make sure to put the code above in front of it