vengine
0.0.1
3D graphics engine
Loading...
Searching...
No Matches
pointLight.cpp
Go to the documentation of this file.
1
#include <ranges>
2
3
#include "
VEngine/Core/RenderSystem/PointLight.hpp
"
4
5
void
ven::PointLightRenderSystem::render
(
const
FrameInfo
&frameInfo)
const
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
}
PointLight.hpp
This file contains the PointLightRenderSystem class.
ven::ARenderSystemBase::getPipelineLayout
VkPipelineLayout getPipelineLayout() const
Definition
ABase.hpp:40
ven::ARenderSystemBase::getShaders
const std::unique_ptr< Shaders > & getShaders() const
Definition
ABase.hpp:41
ven::Light
Class for light.
Definition
Light.hpp:28
ven::PointLightRenderSystem::render
void render(const FrameInfo &frameInfo) const override
Definition
pointLight.cpp:5
ven::FrameInfo
Definition
FrameInfo.hpp:45
ven::FrameInfo::lights
Light::Map & lights
Definition
FrameInfo.hpp:53
ven::FrameInfo::commandBuffer
VkCommandBuffer commandBuffer
Definition
FrameInfo.hpp:48
ven::FrameInfo::globalDescriptorSet
VkDescriptorSet globalDescriptorSet
Definition
FrameInfo.hpp:50
ven::LightPushConstantData
Definition
PointLight.hpp:13
ven::LightPushConstantData::position
glm::vec4 position
Definition
PointLight.hpp:14
src
Core
RenderSystems
pointLight.cpp
Generated by
1.11.0