From 6623f16f0b51005a22ed3b85f597ffd1c74554ab Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 15 Jun 2021 15:04:17 +0800 Subject: [PATCH] added MVPMatrix attrib and GetUBOBytes function at RenderNode. --- inc/hgl/graph/RenderNode.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/inc/hgl/graph/RenderNode.h b/inc/hgl/graph/RenderNode.h index 64483c78..076c32b9 100644 --- a/inc/hgl/graph/RenderNode.h +++ b/inc/hgl/graph/RenderNode.h @@ -1,8 +1,9 @@ -#ifndef HGL_GRAPH_RENDER_NODE_INCLUDE +#ifndef HGL_GRAPH_RENDER_NODE_INCLUDE #define HGL_GRAPH_RENDER_NODE_INCLUDE #include #include +#include namespace hgl { namespace graph @@ -11,12 +12,21 @@ namespace hgl struct RenderNode { + MVPMatrix matrix; + Vector4f WorldCenter; float distance_to_camera_square; // float distance_to_camera; RenderableInstance *ri; + + public: + + /** + * 取得渲染对象ubo独占区大小 + */ + virtual const uint32 GetUBOBytes()const{return sizeof(MVPMatrix);} };//struct RenderNode using RenderNodeList=List;