#pragma once #include "scene_node.h" #include "texture.h" BEGIN_NAMESPACE // http://en.wikipedia.org/wiki/Shading#Lighting enum class light_type { directional, point, spot }; struct light_node : scene_node { explicit light_node(light_type type); void calculate_local_transform() override; light_type light_type_; glm::vec4 ambient = glm::vec4(0.2, 0.2, 0.2, 1); glm::vec4 diffuse = glm::vec4(0.5, 0.5, 0.5, 1); glm::vec4 specular = glm::vec4(1); glm::vec3 attenuation; glm::vec3 spot_target; float spot_cutoff; float spot_exponent; bool active = true; int shadow_map_width = 1024; glm::mat4 light_projection_matrix[6]; glm::mat4 world_to_light_matrix[6]; glm::mat4 shadow_map_bias_matrix; glm::mat4 final_shadow_map_matrix[6]; std::shared_ptr shadow_map[6]; }; END_NAMESPACE