mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Add configurable MSAA anti-aliasing, update auth screen and terrain shader
- 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
This commit is contained in:
parent
6d213ad49b
commit
e12141a673
54 changed files with 2069 additions and 144 deletions
|
|
@ -32,6 +32,7 @@ public:
|
|||
*/
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* Render celestial bodies (sun and moons).
|
||||
|
|
|
|||
|
|
@ -58,6 +58,7 @@ public:
|
|||
void update(float deltaTime, const glm::vec3& cameraPos = glm::vec3(0.0f));
|
||||
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera);
|
||||
void recreatePipelines();
|
||||
bool initializeShadow(VkRenderPass shadowRenderPass);
|
||||
void renderShadow(VkCommandBuffer cmd, const glm::mat4& lightSpaceMatrix);
|
||||
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/// Try to load M2 spell models (Charge_Caster.m2, etc.)
|
||||
void tryLoadM2Models(M2Renderer* m2Renderer, pipeline::AssetManager* assets);
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@ public:
|
|||
*/
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* Render clouds.
|
||||
|
|
|
|||
|
|
@ -39,6 +39,8 @@ public:
|
|||
*/
|
||||
void shutdown();
|
||||
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* @brief Render lens flare effect
|
||||
* @param cmd Command buffer to record into
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
void update(float deltaTime, const Camera& camera);
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet);
|
||||
|
|
|
|||
|
|
@ -281,6 +281,8 @@ public:
|
|||
double getQueryTimeMs() const { return queryTimeMs; }
|
||||
uint32_t getQueryCallCount() const { return queryCallCount; }
|
||||
|
||||
void recreatePipelines();
|
||||
|
||||
// Stats
|
||||
bool isInitialized() const { return initialized_; }
|
||||
uint32_t getModelCount() const { return static_cast<uint32_t>(models.size()); }
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public:
|
|||
|
||||
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);
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout, pipeline::AssetManager* assetManager);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* Add or update a quest marker at a position
|
||||
|
|
|
|||
|
|
@ -241,6 +241,7 @@ private:
|
|||
public:
|
||||
void setShadowsEnabled(bool enabled) { shadowsEnabled = enabled; }
|
||||
bool areShadowsEnabled() const { return shadowsEnabled; }
|
||||
void setMsaaSamples(VkSampleCountFlagBits samples);
|
||||
|
||||
private:
|
||||
void renderShadowPass();
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* Render the skybox
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* Render the star field
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ public:
|
|||
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void shutdown();
|
||||
void recreatePipelines();
|
||||
void update(const Camera& camera, const CameraController& cc,
|
||||
const WaterRenderer& water, float deltaTime);
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet);
|
||||
|
|
|
|||
|
|
@ -104,6 +104,8 @@ public:
|
|||
|
||||
void clear();
|
||||
|
||||
void recreatePipelines();
|
||||
|
||||
void setWireframe(bool enabled) { wireframe = enabled; }
|
||||
void setFrustumCulling(bool enabled) { frustumCullingEnabled = enabled; }
|
||||
void setFogEnabled(bool enabled) { fogEnabled = enabled; }
|
||||
|
|
@ -139,7 +141,7 @@ private:
|
|||
|
||||
// Descriptor pool for material sets
|
||||
VkDescriptorPool materialDescPool = VK_NULL_HANDLE;
|
||||
static constexpr uint32_t MAX_MATERIAL_SETS = 8192;
|
||||
static constexpr uint32_t MAX_MATERIAL_SETS = 16384;
|
||||
|
||||
// Loaded terrain chunks
|
||||
std::vector<TerrainChunkGPU> chunks;
|
||||
|
|
|
|||
|
|
@ -71,6 +71,11 @@ public:
|
|||
|
||||
bool isSwapchainDirty() const { return swapchainDirty; }
|
||||
|
||||
// MSAA
|
||||
VkSampleCountFlagBits getMsaaSamples() const { return msaaSamples_; }
|
||||
void setMsaaSamples(VkSampleCountFlagBits samples);
|
||||
VkSampleCountFlagBits getMaxUsableSampleCount() const;
|
||||
|
||||
private:
|
||||
bool createInstance(SDL_Window* window);
|
||||
bool createSurface(SDL_Window* window);
|
||||
|
|
@ -126,6 +131,15 @@ private:
|
|||
bool createDepthBuffer();
|
||||
void destroyDepthBuffer();
|
||||
|
||||
// MSAA resources
|
||||
VkSampleCountFlagBits msaaSamples_ = VK_SAMPLE_COUNT_1_BIT;
|
||||
VkImage msaaColorImage_ = VK_NULL_HANDLE;
|
||||
VkImageView msaaColorView_ = VK_NULL_HANDLE;
|
||||
VmaAllocation msaaColorAllocation_ = VK_NULL_HANDLE;
|
||||
|
||||
bool createMsaaColorImage();
|
||||
void destroyMsaaColorImage();
|
||||
|
||||
// ImGui resources
|
||||
VkRenderPass imguiRenderPass = VK_NULL_HANDLE;
|
||||
VkDescriptorPool imguiDescriptorPool = VK_NULL_HANDLE;
|
||||
|
|
|
|||
|
|
@ -79,6 +79,8 @@ public:
|
|||
void removeTile(int tileX, int tileY);
|
||||
void clear();
|
||||
|
||||
void recreatePipelines();
|
||||
|
||||
void render(VkCommandBuffer cmd, VkDescriptorSet perFrameSet, const Camera& camera, float time);
|
||||
|
||||
void setEnabled(bool enabled) { renderingEnabled = enabled; }
|
||||
|
|
|
|||
|
|
@ -40,6 +40,7 @@ public:
|
|||
* @return true if initialization succeeded
|
||||
*/
|
||||
bool initialize(VkContext* ctx, VkDescriptorSetLayout perFrameLayout);
|
||||
void recreatePipelines();
|
||||
|
||||
/**
|
||||
* @brief Update weather particles
|
||||
|
|
|
|||
|
|
@ -156,6 +156,7 @@ public:
|
|||
/**
|
||||
* Get number of loaded models
|
||||
*/
|
||||
void recreatePipelines();
|
||||
bool isInitialized() const { return initialized_; }
|
||||
uint32_t getModelCount() const { return loadedModels.size(); }
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue