mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 07:40:14 +00:00
Vulcan Nightmare
Experimentally bringing up vulcan support
This commit is contained in:
parent
863a786c48
commit
83b576e8d9
189 changed files with 12147 additions and 7820 deletions
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
#include <memory>
|
||||
#include <glm/glm.hpp>
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <vk_mem_alloc.h>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Shader;
|
||||
class Camera;
|
||||
class VkContext;
|
||||
|
||||
/**
|
||||
* Skybox renderer
|
||||
|
|
@ -20,15 +21,16 @@ public:
|
|||
Skybox();
|
||||
~Skybox();
|
||||
|
||||
bool initialize();
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Render the skybox
|
||||
* @param camera Camera for view matrix (position is ignored for skybox)
|
||||
* @param cmd Command buffer to record into
|
||||
* @param perFrameSet Per-frame descriptor set (set 0, contains camera UBO)
|
||||
* @param timeOfDay Time of day in hours (0-24), affects sky color
|
||||
*/
|
||||
void render(const Camera& camera, float timeOfDay = 12.0f);
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, float timeOfDay = 12.0f);
|
||||
|
||||
/**
|
||||
* Enable/disable skybox rendering
|
||||
|
|
@ -66,11 +68,16 @@ private:
|
|||
glm::vec3 getSkyColor(float altitude, float time) const;
|
||||
glm::vec3 getZenithColor(float time) const;
|
||||
|
||||
std::unique_ptr<Shader> skyShader;
|
||||
VkContext* vkCtx = nullptr;
|
||||
|
||||
VkPipeline pipeline = VK_NULL_HANDLE;
|
||||
VkPipelineLayout pipelineLayout = VK_NULL_HANDLE;
|
||||
|
||||
VkBuffer vertexBuffer = VK_NULL_HANDLE;
|
||||
VmaAllocation vertexAlloc = VK_NULL_HANDLE;
|
||||
VkBuffer indexBuffer = VK_NULL_HANDLE;
|
||||
VmaAllocation indexAlloc = VK_NULL_HANDLE;
|
||||
|
||||
uint32_t vao = 0;
|
||||
uint32_t vbo = 0;
|
||||
uint32_t ebo = 0;
|
||||
int indexCount = 0;
|
||||
|
||||
float timeOfDay = 12.0f; // Default: noon
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue