功能向RenderPipe集中

This commit is contained in:
2025-08-25 23:12:23 +08:00
parent 0f9f81d568
commit 9a0e6d7524
18 changed files with 50 additions and 54 deletions
+1
View File
@@ -65,6 +65,7 @@ class RenderPipe;
class Renderable;
typedef std::shared_ptr<Renderable> RenderablePtr;
typedef std::shared_ptr<const Renderable> RenderableConstPtr;
typedef std::vector<RenderableConstPtr> RenderableArray;
class VertexShaderInterface;
+13 -9
View File
@@ -2,6 +2,7 @@
#include "dvc_config.h"
#include "scene/dvc_scene.h"
#include "device/dvc_uniform_buffer.h"
#include "device/dvc_render_target.h"
DV_CORE_BEGIN_NAMESPACE
@@ -9,20 +10,23 @@ DV_CORE_BEGIN_NAMESPACE
class DV_CORE_API RenderPipe
{
public:
UniformBuffer& getUniformBuffer() {
return m_uniformBuffer;
}
AntiAliasingTech getAntiAliasingTech() const {
return m_aaTech;
}
void setAntiAliasingTech(AntiAliasingTech aaTech) {
m_aaTech = aaTech;
}
void pushRenderable(RenderableConstPtr renderable);
size_t getRenderableCounts() const {
return m_queue.size();
}
RenderableConstPtr getRenderable(size_t index) const;
void build(const Scene& scene);
void process(AntiAliasingTech aaTech, UniformBuffer& uniformBuffer, RenderTarget& renderTarget);
void process(RenderTarget& renderTarget);
protected:
AntiAliasingTech m_aaTech;
std::vector<RenderableConstPtr> m_queue;
UniformBuffer m_uniformBuffer;
RenderableArray m_renderableQueue;
public:
RenderPipe();
@@ -22,7 +22,7 @@ public:
typedef std::vector<Node> NodeArray;
public:
void process(const RenderPipe& renderQueue);
void process(const RenderableArray& renderableArray);
public:
NodeArray m_nodes;
@@ -18,7 +18,7 @@ public:
};
public:
virtual const std::string& getTypeName() const { return typeName(); }
virtual void render(const fMatrix4& transParent, RenderPipe& queue) const;
virtual void buildRenderableQueue(const fMatrix4& transParent, RenderPipe& pipe) const;
fVector3 getEye(void) const;
fVector3 getLookat(void) const;
@@ -9,7 +9,7 @@ class DV_CORE_API SceneComponent
{
public:
virtual const std::string& getTypeName() const = 0;
virtual void render(const fMatrix4& transParent, RenderPipe& queue) const;
virtual void buildRenderableQueue(const fMatrix4& transParent, RenderPipe& pipe) const;
protected:
SceneNodePtr m_owner;
@@ -27,7 +27,7 @@ public:
};
public:
virtual const std::string& getTypeName() const { return typeName(); }
virtual void render(const fMatrix4& transParent, RenderPipe& queue) const;
virtual void buildRenderableQueue(const fMatrix4& transParent, RenderPipe& pipe) const;
void setLightDefine(const LightDefine& lightDefine);
protected:
@@ -9,7 +9,7 @@ class DV_CORE_API MeshComponent : public SceneComponent
{
public:
virtual const std::string& getTypeName() const { return typeName(); }
virtual void render(const fMatrix4& transParent, RenderPipe& queue) const;
virtual void buildRenderableQueue(const fMatrix4& transParent, RenderPipe& pipe) const;
void setMesh(MeshConstPtr mesh);
+1
View File
@@ -40,6 +40,7 @@ public:
public:
SceneNodePtr newSceneNode(const std::string& name);
SceneNodePtr getRootSceneNode() const;
void buildRenderableQueue(RenderPipe& pipe) const;
public:
template<typename ComponentType>
+1 -1
View File
@@ -55,7 +55,7 @@ public:
}
public:
void buildRenderQueue(const fMatrix4& transParent, RenderPipe& queue);
void buildRenderableQueue(const fMatrix4& transParent, RenderPipe& pipe);
protected:
std::string m_name;