Skip to content

Commit

Permalink
fixed an issue with lights
Browse files Browse the repository at this point in the history
  • Loading branch information
Klemmbaustein committed Jun 22, 2024
1 parent 46467e0 commit ae89aa7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion EngineSource/Rendering/Framebuffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void FramebufferObject::Draw()
for (int i = 0; i < Graphics::MAX_LIGHTS; i++)
{
std::string CurrentLight = "u_lights[" + std::to_string(i) + "]";
if (i < DrawnLights.size())
if (i < DrawnLights.size() && DrawnLights[i]->Intensity > 0 && DrawnLights[i]->Distance > 0)
{
s.second.UsedShader->SetVector3(CurrentLight + ".Position", DrawnLights[i]->Position);
s.second.UsedShader->SetVector3(CurrentLight + ".Color", DrawnLights[i]->Color);
Expand Down

0 comments on commit ae89aa7

Please sign in to comment.