8#include <entt/core/hashed_string.hpp>
12 using Id = entt::hashed_string;
26 glm::vec3 target = posOfLight + glm::normalize(lightDirection) * 10.0f;
27 auto up = glm::abs(glm::dot(glm::normalize(lightDirection), glm::vec3(0.0f, 1.0f, 0.0f))) > 0.99f ?
28 glm::vec3(1.0f, 0.0f, 0.0f) :
29 glm::vec3(0.0f, 1.0f, 0.0f);
30 glm::mat4 lightView = glm::lookAt(posOfLight, target, up);
31 glm::mat4 lightSpaceMatrix = lightProjection * lightView;
Definition GPUCamera.hpp:9
Definition GPUDirectionalLight.hpp:11
wgpu::TextureView shadowTextureView
Definition GPUDirectionalLight.hpp:17
void Update(const Object::Component::DirectionalLight &light, const Object::Component::Transform &transform)
Definition GPUDirectionalLight.hpp:20
uint32_t shadowTextureIndex
Definition GPUDirectionalLight.hpp:18
entt::hashed_string Id
Definition GPUDirectionalLight.hpp:12
glm::mat4 viewProjectionMatrix
Definition GPUDirectionalLight.hpp:14
Id buffer
Definition GPUDirectionalLight.hpp:15
Id bindGroupData
Definition GPUDirectionalLight.hpp:16
Definition DirectionalLight.hpp:8
glm::mat4 projection
Definition DirectionalLight.hpp:10