#include "stdafx.h" #include "DiffuseAnimatedMaterial.h" DiffuseAnimatedMaterial::DiffuseAnimatedMaterial() : Material(L"Effects/PosNormTex3D_Animated.fx") {} void DiffuseAnimatedMaterial::SetDiffuseTexture(const std::wstring& assetFile) { m_pDiffuseTexture = ContentManager::Load(assetFile); SetVariable_Texture(L"gDiffuseMap", m_pDiffuseTexture); } void DiffuseAnimatedMaterial::InitializeEffectVariables() { } void DiffuseAnimatedMaterial::OnUpdateModelVariables(const SceneContext& sceneContext, const ModelComponent*) const { //Update the Light Direction (retrieve the direction from the LightManager > sceneContext) XMFLOAT4 lightDir = sceneContext.pLights->GetDirectionalLight().direction; SetVariable_Vector(L"gLightDirection", XMFLOAT3{ lightDir.x, lightDir.y, lightDir.z }); }