Set light to uniforms

This commit is contained in:
Vladislav Khorev 2024-06-10 22:48:52 +03:00
parent f346e55819
commit 75cadf21cc
2 changed files with 10 additions and 0 deletions

View File

@ -37,6 +37,7 @@ protected:
float FogEndDistance; float FogEndDistance;
vec4 FogColor; vec4 FogColor;
vec3 lightPos;
void CalcCamPosVec(); void CalcCamPosVec();
@ -101,6 +102,8 @@ public:
void SetFogBeginDistance(float distance); void SetFogBeginDistance(float distance);
void SetFogEndDistance(float distance); void SetFogEndDistance(float distance);
void SetLightPos(vec3 newLightPos);
}; };
} //namespace SE } //namespace SE

View File

@ -64,6 +64,8 @@ void TSalmonRendererInterface::SetUniforms()
RenderUniform3fv(CONST_STRING_CAMPOS_UNIFORM, GetCamPos().v); RenderUniform3fv(CONST_STRING_CAMPOS_UNIFORM, GetCamPos().v);
RenderUniform3fv("lightPos", lightPos.v);
ResourceManager->LightManager.SetLightUniforms(); ResourceManager->LightManager.SetLightUniforms();
} }
@ -976,6 +978,11 @@ void TSalmonRendererInterface::SetFogEndDistance(float distance)
FogEndDistance = distance; FogEndDistance = distance;
} }
void TSalmonRendererInterface::SetLightPos(vec3 newLightPos)
{
lightPos = newLightPos;
}
} //namespace SE } //namespace SE