void ParticleSystemEffectBinder::Init(DeviceDependableFactory * factory)
{
	colorTexture = TexturePtr(true);
	dataBuffer = factory->CreateConstantBuffer();
	ConstantBuffer * b = dataBuffer.Get();

	b->InitBuffer(sizeof(ParticleGPUData) * MAX_PARTICLES_IN_SYSTEM);

	cameraVectorsBuffer = factory->CreateConstantBuffer();
	b = cameraVectorsBuffer.Get();

	b->InitBuffer(sizeof(CameraVectorsChunck));
	camVectorsChunck.padding1 = 0;
	camVectorsChunck.padding2 = 0;

}
void SceneShaderData::Init(DeviceDependableFactory * factory)
{
	cameraPtr = factory->CreateConstantBuffer();
	globalAmbiantPtr = factory->CreateConstantBuffer();
	illuminationInfoPtr = factory->CreateConstantBuffer();
	directionLightsPtr = factory->CreateConstantBuffer();
	pointLightsPtr = factory->CreateConstantBuffer();

	ConstantBuffer * buffer = cameraPtr.Get();
	buffer->InitBuffer(sizeof(CameraData));

	buffer = globalAmbiantPtr.Get();
	buffer->InitBuffer(sizeof(Vector4));

	buffer = illuminationInfoPtr.Get();
	buffer->InitBuffer(sizeof(IlluminationInfo));

	buffer = directionLightsPtr.Get();
	buffer->InitBuffer(sizeof(DLData) * MAX_DIRECTIONAL_LIGHTS);

	buffer = pointLightsPtr.Get();
	buffer->InitBuffer(sizeof(PLData) * MAX_POINT_LIGHTS);
}
void AnimatedEntity::Init(ModelHandler model,SkeletonHandler skeleton,ResourceManager * resMgr, DeviceDependableFactory * factory)
{
	EntityBase::Init(model,resMgr, factory);

	this->skeletonHandler = skeleton;


	palleteBuffer = factory->CreateConstantBuffer();
	ConstantBuffer * buffer = palleteBuffer.Get();
	buffer->InitBuffer(sizeof(DirectX::XMFLOAT4X4) * MAX_BONES);

	currentAnimController = nullptr;

	DirectX::XMFLOAT4X4 id;
	DirectX::XMStoreFloat4x4(&id,DirectX::XMMatrixIdentity());
	FillBindPosePallete(0,id);

	EffectMaskUtil::Bind(effectMask,SKINNING);
}