DirectZ
Loading...
Searching...
No Matches
dz::ecs::Light Struct Reference

#include <Light.hpp>

Inheritance diagram for dz::ecs::Light:
dz::Provider< Light >

Public Types

enum  LightType : uint8_t { Directional , Spot , Point }

Public Attributes

int type = 0
float intensity
float range
float innerCone
vec< float, 3 > position
int padding1 = 0
vec< float, 3 > direction
int padding2 = 0
vec< float, 3 > color
float outerCone

Static Public Attributes

static constexpr size_t PID = 4
static float Priority = 3.5f
static std::string ProviderName = "Light"
static std::string StructName = "Light"
static std::string GLSLStruct
static std::unordered_map< ShaderModuleType, std::string > GLSLMethods
static std::vector< std::tuple< float, std::string, ShaderModuleType > > GLSLMain

Additional Inherited Members

Static Public Member Functions inherited from dz::Provider< Light >
static constexpr size_t GetPID ()
static constexpr bool GetIsComponent ()
static constexpr char GetComponentID ()
static constexpr bool GetIsDrawProvider ()
static constexpr bool GetIsCameraProvider ()
static constexpr bool GetIsSceneProvider ()
static float GetPriority ()
static const std::string & GetProviderName ()
static const std::string & GetStructName ()
static const std::string & GetGLSLStruct ()
static const std::unordered_map< ShaderModuleType, std::string > & GetGLSLMethods ()
static std::vector< std::tuple< float, std::string, ShaderModuleType > > & GetGLSLMain ()
static std::shared_ptr< ReflectableGroupTryMakeGroup (BufferGroup *buffer_group)

Member Enumeration Documentation

◆ LightType

enum dz::ecs::Light::LightType : uint8_t
Enumerator
Directional 
Spot 
Point 

Member Data Documentation

◆ color

vec<float, 3> dz::ecs::Light::color

◆ direction

vec<float, 3> dz::ecs::Light::direction

◆ GLSLMain

std::vector<std::tuple<float, std::string, ShaderModuleType> > dz::ecs::Light::GLSLMain
inlinestatic
Initial value:
= {
{3.5f, R"(
vec3 frag_pos = vec3(inPosition);
vec3 view_dir = normalize(camera.position - frag_pos);
int lights_size = Lights.data.length();
vec3 light_color = vec3(0.0);
for (int light_index = 0; light_index < lights_size; light_index++) {
light_color += CalculateLight(inNormal, frag_pos, view_dir, Lights.data[light_index]);
}
current_color = vec4(light_color, 1.0) * current_color;
}
@ Fragment
Definition Shader.hpp:17

◆ GLSLMethods

std::unordered_map<ShaderModuleType, std::string> dz::ecs::Light::GLSLMethods
inlinestatic

◆ GLSLStruct

std::string dz::ecs::Light::GLSLStruct
inlinestatic
Initial value:
= R"(
struct Light {
int type;
float intensity;
float range;
float innerCone;
vec3 position;
int padding1;
vec3 direction;
int padding2;
vec3 color;
float outerCone;
};
)"

◆ innerCone

float dz::ecs::Light::innerCone

◆ intensity

float dz::ecs::Light::intensity

◆ outerCone

float dz::ecs::Light::outerCone

◆ padding1

int dz::ecs::Light::padding1 = 0

◆ padding2

int dz::ecs::Light::padding2 = 0

◆ PID

size_t dz::ecs::Light::PID = 4
inlinestaticconstexpr

◆ position

vec<float, 3> dz::ecs::Light::position

◆ Priority

float dz::ecs::Light::Priority = 3.5f
inlinestatic

◆ ProviderName

std::string dz::ecs::Light::ProviderName = "Light"
inlinestatic

◆ range

float dz::ecs::Light::range

◆ StructName

std::string dz::ecs::Light::StructName = "Light"
inlinestatic

◆ type

int dz::ecs::Light::type = 0

The documentation for this struct was generated from the following file: