Pushed latest changes (idk what they are)
This commit is contained in:
parent
fd522fe56a
commit
2477370912
8 changed files with 21 additions and 3 deletions
|
@ -3,7 +3,7 @@ set(VENDOR ${CMAKE_SOURCE_DIR}/vendor)
|
|||
|
||||
add_executable(example
|
||||
"main.cpp"
|
||||
"objects/lighting/PointLight.cpp")
|
||||
"objects/lighting/PointLight.cpp" "objects/lighting/AmbientLight.cpp")
|
||||
|
||||
file(GLOB SOURCE_FILES
|
||||
"${VENDOR}/src/*.c"
|
||||
|
|
|
@ -252,6 +252,7 @@ int main(int argc, char** argv)
|
|||
|
||||
texturedShader.Use();
|
||||
texturedShader.SetUniformMat4("projection", &perspective[0][0]);
|
||||
lightSource.Use(texturedShader);
|
||||
cam.Use(texturedShader);
|
||||
for (Cube* cube : cubes)
|
||||
cube->Draw(texturedShader);
|
||||
|
|
0
src/objects/lighting/AmbientLight.cpp
Normal file
0
src/objects/lighting/AmbientLight.cpp
Normal file
8
src/objects/lighting/AmbientLight.hpp
Normal file
8
src/objects/lighting/AmbientLight.hpp
Normal file
|
@ -0,0 +1,8 @@
|
|||
#pragma once
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
class AmbientLight
|
||||
{
|
||||
|
||||
};
|
|
@ -59,6 +59,11 @@ PointLight::PointLight(glm::vec3 position, glm::vec3 color, float intensity) :
|
|||
transformation = glm::scale(transformation, glm::vec3(0.05f));
|
||||
}
|
||||
|
||||
void PointLight::Use(const Shader& program)
|
||||
{
|
||||
program.SetUniformFloat3("lightColor", &color[0]);
|
||||
}
|
||||
|
||||
void PointLight::Draw(const Shader& program)
|
||||
{
|
||||
program.SetUniformFloat3("color", &color[0]);
|
||||
|
|
|
@ -13,6 +13,8 @@ public:
|
|||
PointLight(glm::vec3 position, glm::vec3 color, float intensity);
|
||||
~PointLight() = default;
|
||||
|
||||
void Use(const Shader& program);
|
||||
|
||||
void Draw(const Shader& program);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue