diff --git a/include/Render/SalmonRender/SalmonRenderInterface.h b/include/Render/SalmonRender/SalmonRenderInterface.h index f01e4ef..c944a44 100644 --- a/include/Render/SalmonRender/SalmonRenderInterface.h +++ b/include/Render/SalmonRender/SalmonRenderInterface.h @@ -37,6 +37,7 @@ protected: float FogEndDistance; vec4 FogColor; + vec3 lightPos; void CalcCamPosVec(); @@ -100,6 +101,8 @@ public: void SetFogBeginDistance(float distance); void SetFogEndDistance(float distance); + + void SetLightPos(vec3 newLightPos); }; diff --git a/src/Render/SalmonRender/SalmonRenderInterface.cpp b/src/Render/SalmonRender/SalmonRenderInterface.cpp index 035bc39..2838c2d 100644 --- a/src/Render/SalmonRender/SalmonRenderInterface.cpp +++ b/src/Render/SalmonRender/SalmonRenderInterface.cpp @@ -64,6 +64,8 @@ void TSalmonRendererInterface::SetUniforms() RenderUniform3fv(CONST_STRING_CAMPOS_UNIFORM, GetCamPos().v); + RenderUniform3fv("lightPos", lightPos.v); + ResourceManager->LightManager.SetLightUniforms(); } @@ -976,6 +978,11 @@ void TSalmonRendererInterface::SetFogEndDistance(float distance) FogEndDistance = distance; } +void TSalmonRendererInterface::SetLightPos(vec3 newLightPos) +{ + lightPos = newLightPos; +} + } //namespace SE