mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-23 15:50:20 +00:00
- MSAA: conditional 2-att (off) vs 3-att (on) render pass with auto-resolve - MSAA: multisampled color+depth images, query max supported sample count - MSAA: .setMultisample() on all 25+ main-pass pipelines across 17 renderers - MSAA: recreatePipelines() on every sub-renderer for runtime MSAA changes - MSAA: Renderer::setMsaaSamples() orchestrates swapchain+pipeline+ImGui rebuild - MSAA: Anti-Aliasing combo (Off/2x/4x/8x) in Video settings, persisted - Update auth screen assets and terrain fragment shader
82 lines
2.2 KiB
C++
82 lines
2.2 KiB
C++
#pragma once
|
|
|
|
#include <memory>
|
|
#include <glm/glm.hpp>
|
|
#include <vulkan/vulkan.h>
|
|
#include <vk_mem_alloc.h>
|
|
|
|
namespace wowee {
|
|
namespace rendering {
|
|
|
|
class VkContext;
|
|
|
|
/**
|
|
* Skybox renderer
|
|
*
|
|
* Renders an atmospheric sky gradient using a fullscreen triangle.
|
|
* No vertex buffer: 3 vertices cover the entire screen via gl_VertexIndex.
|
|
* World-space ray direction is reconstructed from the inverse view+projection.
|
|
*/
|
|
class Skybox {
|
|
public:
|
|
Skybox();
|
|
~Skybox();
|
|
|
|
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
|
void shutdown();
|
|
void recreatePipelines();
|
|
|
|
/**
|
|
* Render the 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(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, float timeOfDay = 12.0f);
|
|
|
|
/**
|
|
* Enable/disable skybox rendering
|
|
*/
|
|
void setEnabled(bool enabled) { renderingEnabled = enabled; }
|
|
bool isEnabled() const { return renderingEnabled; }
|
|
|
|
/**
|
|
* Set time of day (0-24 hours)
|
|
* 0 = midnight, 6 = dawn, 12 = noon, 18 = dusk, 24 = midnight
|
|
*/
|
|
void setTimeOfDay(float time);
|
|
float getTimeOfDay() const { return timeOfDay; }
|
|
|
|
/**
|
|
* Enable/disable time progression
|
|
*/
|
|
void setTimeProgression(bool enabled) { timeProgressionEnabled = enabled; }
|
|
bool isTimeProgressionEnabled() const { return timeProgressionEnabled; }
|
|
|
|
/**
|
|
* Update time progression
|
|
*/
|
|
void update(float deltaTime);
|
|
|
|
/**
|
|
* Get horizon color for fog (public for fog system)
|
|
*/
|
|
glm::vec3 getHorizonColor(float time) const;
|
|
|
|
private:
|
|
glm::vec3 getSkyColor(float altitude, float time) const;
|
|
glm::vec3 getZenithColor(float time) const;
|
|
|
|
VkContext* vkCtx = nullptr;
|
|
|
|
VkPipeline pipeline = VK_NULL_HANDLE;
|
|
VkPipelineLayout pipelineLayout = VK_NULL_HANDLE;
|
|
|
|
float timeOfDay = 12.0f; // Default: noon
|
|
float timeSpeed = 1.0f; // 1.0 = 1 hour per real second
|
|
bool timeProgressionEnabled = false;
|
|
bool renderingEnabled = true;
|
|
};
|
|
|
|
} // namespace rendering
|
|
} // namespace wowee
|