#ifndef FZDL_SKIN_INSTANCING
#define FZDL_SKIN_INSTANCING



//GPU SKin
#if defined(SUPPORT_INSTANCED_SKINNING)

//目前使用giant 
#include "../../../../Plugins/Giant/GiantEngine/BakedAnimations/ShaderLibrary/GiantEngine-BakedAnimation.hlsl"

#define _GIANT_BAKED_ANIMATION_ON

#define FZDL_BAKED_SKIN_INSTANCING_ATTRIBUTES GIANT_BAKED_ANIMATION_VERTEX_ATTRIBUTES


#define EXTRACT_SKIN_BAKED_DATA(input)	_GIANT_BONEINDICES(input),_GIANT_BONEWEIGHTS(input)



//处理顶点 应用Skin Instancing
void DoSkinning(inout float4 positionOS,inout float3 normal,inout float3 tangent,half4 indices, half4 weights)
{
	BakedAnimationSkinResult skinResult = BakedAnimationSkin(positionOS,normalOS.xyz,tangentOS.xyz,indices,weights);
	positionOS    = skinResult.position; 
    normalOS.xyz  = skinResult.normal;  
    tangentOS.xyz = skinResult.tangent;
}






#endif






#endif