8 #ifndef _MBS_DIR_LIGHT_HH_
9 #define _MBS_DIR_LIGHT_HH_
15 class MbsDirLight:
public MbsLight
18 MbsDirLight(glm::vec3
const& rel_dir = glm::vec3(0.0f, 0.0f, -1.0f),
19 glm::mat4
const& parent_mat = glm::mat4(1.0f),
20 glm::vec3
const& color = glm::vec3(1.0f),
21 float ambient = 0.05f,
23 int depth_x_width = 1024,
int depth_y_width = 1024,
float shadow_bias = 0.0f,
24 float depth_near = -10.0f,
float depth_far = 20.0f,
25 glm::vec3
const& shadow_z_up = glm::vec3(0.0, 0.0, 1.0),
26 float depth_scale = 0.0015f,
27 glm::vec3
const& rel_shadow_point = glm::vec3(0.0f));
28 virtual ~MbsDirLight();
30 virtual void Update();
33 glm::vec3 GetNormDir()
const {
return norm_dir; }
36 void UpdateRelDir(glm::vec3
const& rel_dir)
38 this->rel_dir = rel_dir;
39 rel_dir_4 = glm::vec4(rel_dir, 0.0f);
45 virtual void UpdateParentPos(glm::mat4
const& parent_mat)
47 MbsLight::UpdateParentPos(parent_mat);
61 glm::vec3 rel_shadow_point;
63 glm::mat4 shadow_mat_pos;
64 glm::mat4 shadow_mat_rel;