Repository navigation
Expand file tree
/
Copy pathApplicationData.h
More file actions
53 lines (43 loc) · 1.58 KB
/
Copy pathApplicationData.h
File metadata and controls
53 lines (43 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**
* @file ApplicationData.h
* @brief This header file keeps user-provided application data (vertices, indices etc.).
* @author Mustafa Yemural (myemural)
* @date 16.12.2025
*
* Copyright (c) 2025 Mustafa Yemural - www.mustafayemural.com
* Released under the MIT License
* https://opensource.org/licenses/MIT
*/
#pragma once
#include <glm/glm.hpp>
#include "Vertex.h"
namespace examples::real_time_lighting::light_sources::spotlight
{
inline const std::vector enabledMaterialComponents{
common::scene::MaterialComponent::DIFFUSE_COLOR_VEC4, common::scene::MaterialComponent::SPECULAR_COLOR_VEC4,
common::scene::MaterialComponent::AMBIENT_STRENGTH_FLOAT, common::scene::MaterialComponent::SHININESS_FLOAT,
common::scene::MaterialComponent::SPECULAR_STRENGTH_FLOAT};
inline const std::vector attributeLayouts{
std::pair(common::scene::AttributeType::POSITION, common::scene::AccessorType::VEC3),
std::pair(common::scene::AttributeType::NORMAL, common::scene::AccessorType::VEC3)};
// Constants
inline constexpr auto kLightCount = 2U;
struct alignas(16) LightUbo
{
glm::vec4 lightPosition; // xyz = Light Position
glm::vec4 lightDirection; // xyz = Light Direction (normalized)
glm::vec4 lightColor; // xyz = Light Color
glm::vec4 spotlightParams; // x = cos(cutoffAngle)
};
struct alignas(16) LightBlock
{
LightUbo lightUbo[kLightCount];
};
struct MeshPushConstants
{
glm::mat4 view;
glm::mat4 projection;
glm::vec4 cameraPosition;
std::uint32_t objectId;
};
} // namespace examples::real_time_lighting::light_sources::spotlight