添加多模型渲染,添加贴图渲染,添加平行光, 暂时不上传assets

This commit is contained in:
2026-09-21 14:07:20 +08:00
parent 381b7c0aa6
commit 7d628f8d8a
37 changed files with 9817 additions and 189 deletions
+49
View File
@@ -0,0 +1,49 @@
//
// Created by atdunbg on 2026/9/21.
//
#ifndef HELLOVULKAN_MESH_H
#define HELLOVULKAN_MESH_H
#include <Engine/Core/Types.h>
#include <Engine/Renderer/Vertex.h>
#include <vulkan/vulkan.hpp>
#include <vector>
namespace Engine
{
class Device;
class MemoryAllocator;
class Buffer;
class Material;
class Mesh
{
public:
Mesh(Device& device, MemoryAllocator& allocator,
const std::vector<Vertex>& vertices,
const std::vector<u32>& indices,
Scope<Material> material);
~Mesh();
Mesh(const Mesh&) = delete;
Mesh& operator=(const Mesh&) = delete;
void Draw(vk::CommandBuffer cmd) const;
Material* GetMaterial() const { return m_Material.get(); }
u32 GetIndexCount() const { return m_IndexCount; }
private:
Scope<Buffer> m_VertexBuffer;
Scope<Buffer> m_IndexBuffer;
Scope<Material> m_Material;
u32 m_IndexCount = 0;
u64 m_VertexBytes = 0;
u64 m_IndexBytes = 0;
};
} // namespace Engine
#endif //HELLOVULKAN_MESH_H