removed old RenderList

This commit is contained in:
2023-05-07 01:07:26 +08:00
parent 9781e6a9b3
commit 9535a4486e
11 changed files with 168 additions and 629 deletions

View File

@@ -2,69 +2,41 @@
#define HGL_GRAPH_RENDER_LIST_INCLUDE
#include<hgl/graph/VK.h>
#include<hgl/graph/Camera.h>
#include<hgl/graph/SceneNode.h>
#include<hgl/graph/RenderNode.h>
#include<hgl/graph/VKArrayBuffer.h>
#include<hgl/graph/SceneInfo.h>
#include<hgl/color/Color4f.h>
#include<hgl/graph/VKMaterial.h>
namespace hgl
{
namespace graph
{
/**
* 渲染对象列表<br>
* 已经展开的渲染对象列表最终创建RenderCommandBuffer
* 该类会长期保存使用过的材质信息避重新分配造成的时间和空间浪费。如需彻底清空列表请使用Clear()函数
*/
class RenderList
{
protected:
protected:
GPUDevice * device;
RenderCmdBuffer * cmd_buf;
private:
CameraInfo camera_info;
MaterialRenderMap mrl_map;
RenderNodeComparator *render_node_comparator;
private:
List<Renderable *> ri_list;
VkDescriptorSet ds_list[DESCRIPTOR_SET_TYPE_COUNT];
DescriptorSet *renderable_desc_sets;
uint32_t ubo_offset;
uint32_t ubo_align;
uint renderable_count; ///<可渲染对象数量
MaterialRenderMap mrl_map; ///<按材质分类的渲染列表
protected:
virtual bool Begin();
virtual bool Expend(SceneNode *);
virtual void End();
private:
Pipeline * last_pipeline;
MaterialParameters *last_mp[DESCRIPTOR_SET_TYPE_COUNT];
uint32_t last_vbo;
void Render(Renderable *);
virtual bool ExpendNode(SceneNode *);
public:
RenderList(GPUDevice *);
virtual ~RenderList();
virtual bool Expend(SceneNode *); ///<展开场景树到渲染列表
virtual bool Expend(const CameraInfo &,SceneNode *);
virtual bool Render(RenderCmdBuffer *); ///<渲染所有对象
virtual bool Render(RenderCmdBuffer *);
virtual void Clear(); ///<彻底清理
};//class RenderList
}//namespace graph
}//namespace hgl