vengine  0.0.1
3D graphics engine
Loading...
Searching...
No Matches
pointLight.cpp
Go to the documentation of this file.
1#include <ranges>
2
4
6{
7 getShaders()->bind(frameInfo.commandBuffer);
8 vkCmdBindDescriptorSets(frameInfo.commandBuffer, VK_PIPELINE_BIND_POINT_GRAPHICS, getPipelineLayout(), 0, 1, &frameInfo.globalDescriptorSet, 0, nullptr);
9
10 for (const Light &light : frameInfo.lights | std::views::values) {
11 const LightPushConstantData push{
12 .position = glm::vec4(light.transform.translation, 1.F),
13 .color = light.color,
14 .radius = light.transform.scale.x
15 };
16 vkCmdPushConstants(frameInfo.commandBuffer, getPipelineLayout(), VK_SHADER_STAGE_VERTEX_BIT | VK_SHADER_STAGE_FRAGMENT_BIT, 0, sizeof(LightPushConstantData), &push);
17 vkCmdDraw(frameInfo.commandBuffer, 6, 1, 0, 0);
18 }
19}
This file contains the PointLightRenderSystem class.
VkPipelineLayout getPipelineLayout() const
Definition ABase.hpp:40
const std::unique_ptr< Shaders > & getShaders() const
Definition ABase.hpp:41
Class for light.
Definition Light.hpp:28
void render(const FrameInfo &frameInfo) const override
Definition pointLight.cpp:5
Light::Map & lights
Definition FrameInfo.hpp:53
VkCommandBuffer commandBuffer
Definition FrameInfo.hpp:48
VkDescriptorSet globalDescriptorSet
Definition FrameInfo.hpp:50