Chira Engine
A customizable MIT-licensed game engine.
LightComponents.h
1 #pragma once
2 
3 #include "TransformComponent.h"
4 
5 namespace chira {
6 
7 // These are arbitrary amounts, be careful not to increase by too much or the GPU will hate you
8 constexpr int DIRECTIONAL_LIGHT_MAX = 4;
9 constexpr int POINT_LIGHT_MAX = 32;
10 constexpr int SPOT_LIGHT_MAX = 16;
11 
13  TransformComponent* transform;
14  glm::vec3 ambient{0.1f};
15  glm::vec3 diffuse{0.8f};
16  glm::vec3 specular{0.1f};
17 };
18 
20  TransformComponent* transform;
21  glm::vec3 ambient{0.1f};
22  glm::vec3 diffuse{0.8f};
23  glm::vec3 specular{0.1f};
24  // x: constant, y: linear, z: quadratic
25  // default is 100 units
26  glm::vec3 falloff{1.f, 0.045f, 0.0075f};
27 };
28 
30  TransformComponent* transform;
31  glm::vec3 diffuse{0.8f};
32  glm::vec3 specular{0.1f};
33  // x: constant, y: linear, z: quadratic
34  // default is 100 units
35  glm::vec3 falloff{1.f, 0.045f, 0.0075f};
36  // x: inner cutoff angle, y: outer cutoff angle
37  glm::vec2 cutoff{glm::radians(45.f), glm::radians(60.f)};
38 };
39 
40 } // namespace chira