From 12923669214ba73a809f4e221a634244888b0146 Mon Sep 17 00:00:00 2001 From: LaG1924 Date: Thu, 15 Dec 2022 15:53:56 +0500 Subject: Added liquid rendering pass --- src/RendererSection.hpp | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src/RendererSection.hpp') diff --git a/src/RendererSection.hpp b/src/RendererSection.hpp index 0a03f44..8125e4e 100644 --- a/src/RendererSection.hpp +++ b/src/RendererSection.hpp @@ -7,26 +7,39 @@ class RenderState; class RendererSectionData; class RendererSection { - std::shared_ptr pipelineInstance; - std::shared_ptr buffer; - size_t hash; + std::shared_ptr solidPipelineInstance; + std::shared_ptr solidBuffer; + std::shared_ptr liquidPipelineInstance; + std::shared_ptr liquidBuffer; Vector sectionPos; + size_t hash = 0; + size_t solidFacesCount = 0; + size_t liquidFacesCount = 0; RendererSection(const RendererSection &other) = delete; public: - RendererSection(const RendererSectionData& data, std::shared_ptr pipeline, std::shared_ptr bufferBinding); + RendererSection( + const RendererSectionData& data, + std::shared_ptr solidPipeline, + std::shared_ptr solidBufferBinding, + std::shared_ptr liquidPipeline, + std::shared_ptr liquidBufferBinding); RendererSection(RendererSection &&other); ~RendererSection(); - void Render(); + void RenderSolid(); + + void RenderLiquid(); Vector GetPosition(); size_t GetHash(); - size_t numOfFaces; + inline size_t GetSolidFacesCount() { return solidFacesCount; } + + inline size_t GetLiquidFacesCount() { return liquidFacesCount; } friend void swap(RendererSection &lhs, RendererSection &rhs); -- cgit v1.2.3