From 898d01ac62f58aeff243a326da8b4b58fcad53ec Mon Sep 17 00:00:00 2001 From: hyzboy Date: Thu, 18 Jul 2024 01:53:23 +0800 Subject: [PATCH] Change MaterialRenderList::Add --- CMCore | 2 +- inc/hgl/graph/MaterialRenderList.h | 3 ++- src/SceneGraph/MaterialRenderList.cpp | 7 ++++--- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMCore b/CMCore index b07a4bb5..8bb99765 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit b07a4bb5be991df77d601c78924f15b5ee8c95cf +Subproject commit 8bb9976503947b89d181e6957afe801c62d8d9d9 diff --git a/inc/hgl/graph/MaterialRenderList.h b/inc/hgl/graph/MaterialRenderList.h index c86218de..24ce8b98 100644 --- a/inc/hgl/graph/MaterialRenderList.h +++ b/inc/hgl/graph/MaterialRenderList.h @@ -6,6 +6,7 @@ VK_NAMESPACE_BEGIN class RenderAssignBuffer; +class SceneNode; /** * 同一材质的对象渲染列表 @@ -73,7 +74,7 @@ public: MaterialRenderList(GPUDevice *d,bool l2w,Material *m); ~MaterialRenderList(); - void Add(Renderable *ri,const Matrix4f &mat); + void Add(SceneNode *); void Clear() { diff --git a/src/SceneGraph/MaterialRenderList.cpp b/src/SceneGraph/MaterialRenderList.cpp index 4d04c451..133d5866 100644 --- a/src/SceneGraph/MaterialRenderList.cpp +++ b/src/SceneGraph/MaterialRenderList.cpp @@ -7,6 +7,7 @@ #include #include"RenderAssignBuffer.h" #include +#include /** * @@ -93,12 +94,12 @@ MaterialRenderList::~MaterialRenderList() SAFE_CLEAR(assign_buffer); } -void MaterialRenderList::Add(Renderable *ri,const Matrix4f &mat) +void MaterialRenderList::Add(SceneNode *sn) { RenderNode rn; - rn.local_to_world=mat; - rn.ri=ri; + rn.local_to_world =sn->GetLocalToWorldMatrix(); + rn.ri =sn->GetRenderable(); rn_list.Add(rn); }