mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-15 20:08:54 +03:00
Removed Z offset from quad mesh + draw a quad for each light
This commit is contained in:
@@ -217,6 +217,14 @@ void ViewportWidget::OnDebugDraw(DebugCmd& debugCmd)
|
||||
auto view = cam->GetTransform();
|
||||
auto proj = cam->GetPerspective();
|
||||
Matrix4 model = glm::translate(Matrix4(1.0f), Vector3(0, 3, 0));
|
||||
|
||||
debugCmd.DrawQuad(proj * view * model);
|
||||
|
||||
auto scene = debugCmd.GetScene();
|
||||
|
||||
auto lightView = scene->m_Registry.view<TransformComponent, LightComponent>();
|
||||
for (auto e : lightView)
|
||||
{
|
||||
auto [transform, light] = scene->m_Registry.get<TransformComponent, LightComponent>(e);
|
||||
debugCmd.DrawQuad(proj * view * glm::translate(Matrix4(1.0f), Vector3(transform.GetGlobalTransform()[3])));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,12 +33,12 @@ void VkSceneRenderer::Init()
|
||||
|
||||
const std::vector<Vertex> quadVertices
|
||||
{
|
||||
{ Vector3(-1.0f, 1.0f, 1.0f), 0.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, 1.0f, 1.0f), 1.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3(-1.0f, -1.0f, 1.0f), 0.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, -1.0f, 1.0f), 1.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3(-1.0f, -1.0f, 1.0f), 0.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, 1.0f, 1.0f), 1.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) }
|
||||
{ Vector3(-1.0f, 1.0f, 0.0f), 0.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, 1.0f, 0.0f), 1.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3(-1.0f, -1.0f, 0.0f), 0.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, -1.0f, 0.0f), 1.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3(-1.0f, -1.0f, 0.0f), 0.0f, Vector3(0, 0, 1), 0.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) },
|
||||
{ Vector3( 1.0f, 1.0f, 0.0f), 1.0f, Vector3(0, 0, 1), 1.0f, Vector4(1, 0, 0, 0), Vector4(0, 1, 0, 0) }
|
||||
};
|
||||
|
||||
const std::vector<uint32_t> quadIndices
|
||||
|
||||
Reference in New Issue
Block a user