mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +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
58 lines
1.4 KiB
C++
58 lines
1.4 KiB
C++
#pragma once
|
|
|
|
#include <vulkan/vulkan.h>
|
|
#include <vk_mem_alloc.h>
|
|
#include <glm/glm.hpp>
|
|
#include <vector>
|
|
|
|
namespace wowee {
|
|
namespace rendering {
|
|
|
|
class Camera;
|
|
class VkContext;
|
|
|
|
class MountDust {
|
|
public:
|
|
MountDust();
|
|
~MountDust();
|
|
|
|
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
|
void shutdown();
|
|
void recreatePipelines();
|
|
|
|
// Spawn dust particles at mount feet when moving on ground
|
|
void spawnDust(const glm::vec3& position, const glm::vec3& velocity, bool isMoving);
|
|
|
|
void update(float deltaTime);
|
|
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet);
|
|
|
|
private:
|
|
struct Particle {
|
|
glm::vec3 position;
|
|
glm::vec3 velocity;
|
|
float lifetime;
|
|
float maxLifetime;
|
|
float size;
|
|
float alpha;
|
|
};
|
|
|
|
static constexpr int MAX_DUST_PARTICLES = 300;
|
|
std::vector<Particle> particles;
|
|
|
|
// Vulkan objects
|
|
VkContext* vkCtx = nullptr;
|
|
VkPipeline pipeline = VK_NULL_HANDLE;
|
|
VkPipelineLayout pipelineLayout = VK_NULL_HANDLE;
|
|
|
|
// Dynamic mapped buffer for particle vertex data (updated every frame)
|
|
::VkBuffer dynamicVB = VK_NULL_HANDLE;
|
|
VmaAllocation dynamicVBAlloc = VK_NULL_HANDLE;
|
|
VmaAllocationInfo dynamicVBAllocInfo{};
|
|
VkDeviceSize dynamicVBSize = 0;
|
|
|
|
std::vector<float> vertexData;
|
|
float spawnAccum = 0.0f;
|
|
};
|
|
|
|
} // namespace rendering
|
|
} // namespace wowee
|