Elevate Engine 1
Loading...
Searching...
No Matches
PointLight.cpp
Go to the documentation of this file.
1#include "eepch.h"
2#include "PointLight.h"
5
6namespace Elevate
7{
8 void PointLight::UploadToShader(Shader* shader, uint32_t index)
9 {
10 const std::string name = "pointLights[" + std::to_string(index) + "]";
11 shader->UseLight(this, name);
12 // Todo utiliser les paramettres
13 shader->SetUniform3f(name + ".position", gameObject->GetGlobalPosition());
14 shader->SetUniform1f(name + ".constant", 1.0f);
15 shader->SetUniform1f(name + ".linear", 0.09f);
16 shader->SetUniform1f(name + ".quadratic", 0.032f);
17 }
18}
GameObject * gameObject
Definition Component.h:73
glm::vec3 GetGlobalPosition()
void UploadToShader(Shader *shader, uint32_t index)
Definition PointLight.cpp:8
virtual void SetUniform3f(const std::string &location, float x, float y, float z) const =0
virtual void SetUniform1f(const std::string &location, float value) const =0
void UseLight(Light *newLightSetting, const std::string &lightName)
Definition Shader.cpp:104