renamed to Renderable from RenderableInstance, renamed to PrimitiveCreater from RenderableCreater

This commit is contained in:
2022-06-24 21:06:38 +08:00
parent 43c60c16e2
commit d8d8d97abd
46 changed files with 178 additions and 178 deletions

View File

@@ -5,7 +5,7 @@
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VKRenderableInstance.h>
#include<hgl/graph/VKRenderable.h>
#include<hgl/graph/RenderList.h>
using namespace hgl;
@@ -83,7 +83,7 @@ private:
{
ro_sphere=CreateRenderableSphere(db,material_instance->GetVAB(),128);
render_root.CreateSubNode(scale(100),db->CreateRenderableInstance(ro_sphere,material_instance,pipeline_solid));
render_root.CreateSubNode(scale(100),db->CreateRenderable(ro_sphere,material_instance,pipeline_solid));
render_root.RefreshMatrix();
render_list->Expend(GetCameraInfo(),&render_root);

View File

@@ -5,7 +5,7 @@
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VKRenderableInstance.h>
#include<hgl/graph/VKRenderable.h>
#include<hgl/graph/VKTexture.h>
#include<hgl/graph/RenderList.h>
@@ -150,7 +150,7 @@ private:
SceneNode *Add(Primitive *r,MaterialInstance *mi,Pipeline *pl)
{
auto ri=db->CreateRenderableInstance(r,mi,pl);
auto ri=db->CreateRenderable(r,mi,pl);
return render_root.CreateSubNode(ri);
}

View File

@@ -4,7 +4,7 @@
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VKRenderableInstance.h>
#include<hgl/graph/VKRenderable.h>
#include<hgl/graph/RenderList.h>
#include<hgl/graph/VKTexture.h>
#include<hgl/graph/VKImageView.h>
@@ -89,7 +89,7 @@ private:
*ro_gbc_plane,
*ro_axis;
RenderableInstance *ro_gbc_plane_ri;
Renderable *ro_gbc_plane_ri;
struct
{
@@ -329,7 +329,7 @@ private:
ro_gbc_plane=CreateRenderableGBufferComposition(db,sp_composition.material_instance->GetVAB());
if(!ro_gbc_plane)return(false);
ro_gbc_plane_ri=db->CreateRenderableInstance(ro_gbc_plane,sp_composition.material_instance,sp_composition.pipeline_fan);
ro_gbc_plane_ri=db->CreateRenderable(ro_gbc_plane,sp_composition.material_instance,sp_composition.pipeline_fan);
if(!ro_gbc_plane_ri)return(false);
return(true);
@@ -338,12 +338,12 @@ private:
bool InitScene(SubpassParam *sp)
{
CreateRenderObject(sp->material_instance->GetVAB());
render_root.CreateSubNode( scale(100,100,1), db->CreateRenderableInstance(ro_plane ,sp->material_instance,sp->pipeline_fan ));
render_root.CreateSubNode( db->CreateRenderableInstance(ro_torus ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode( scale(20,20,20), db->CreateRenderableInstance(ro_sphere ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate(-30, 0,10)*scale(10,10,10), db->CreateRenderableInstance(ro_cube ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate( 30, 30,10)*scale(1,1,2), db->CreateRenderableInstance(ro_cylinder ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate( 0,-30, 0)*scale(1,1,2), db->CreateRenderableInstance(ro_cone ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode( scale(100,100,1), db->CreateRenderable(ro_plane ,sp->material_instance,sp->pipeline_fan ));
render_root.CreateSubNode( db->CreateRenderable(ro_torus ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode( scale(20,20,20), db->CreateRenderable(ro_sphere ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate(-30, 0,10)*scale(10,10,10), db->CreateRenderable(ro_cube ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate( 30, 30,10)*scale(1,1,2), db->CreateRenderable(ro_cylinder ,sp->material_instance,sp->pipeline_triangles));
render_root.CreateSubNode(translate( 0,-30, 0)*scale(1,1,2), db->CreateRenderable(ro_cone ,sp->material_instance,sp->pipeline_triangles));
render_root.RefreshMatrix();
render_list->Expend(GetCameraInfo(),&render_root);

View File

@@ -15,7 +15,7 @@ private:
TextRender * text_render =nullptr;
TextPrimitive * text_render_obj =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
public:
@@ -44,7 +44,7 @@ private:
if(!text_render_obj)
return(false);
render_instance=text_render->CreateRenderableInstance(text_render_obj);
render_instance=text_render->CreateRenderable(text_render_obj);
if(!render_instance)
return(false);

View File

@@ -41,7 +41,7 @@ private:
Sampler * sampler =nullptr;
MaterialInstance * material_instance =nullptr;
Primitive * primitive =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -180,7 +180,7 @@ private:
primitive->Set(VAN::Position,db->CreateVBO(VF_V4F,tile_count,position_data));
primitive->Set(VAN::TexCoord,db->CreateVBO(VF_V4F,tile_count,tex_coord_data));
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
return(render_instance);
}

View File

@@ -5,7 +5,7 @@
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VKRenderableInstance.h>
#include<hgl/graph/VKRenderable.h>
#include<hgl/graph/VKTexture.h>
#include<hgl/graph/RenderList.h>
@@ -76,7 +76,7 @@ private:
SceneNode *Add(Primitive *r,MaterialInstance *mi,Pipeline *pl)
{
auto ri=db->CreateRenderableInstance(r,mi,pl);
auto ri=db->CreateRenderable(r,mi,pl);
return render_root.CreateSubNode(ri);
}

View File

@@ -25,7 +25,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
Pipeline * pipeline =nullptr;
@@ -52,7 +52,7 @@ private:
if(!primitive->Set(VAN::Position,db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
renderable_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
renderable=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}
@@ -69,7 +69,7 @@ public:
if(!InitVBO())
return(false);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
return(true);
}
@@ -78,7 +78,7 @@ public:
{
VulkanApplicationFramework::Resize(w,h);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
}
};//class TestApp:public VulkanApplicationFramework

View File

@@ -15,7 +15,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
Pipeline * pipeline =nullptr;
@@ -38,7 +38,7 @@ private:
auto primitive=db->CreatePrimitive(3);
if(!primitive)return(false);
renderable_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
renderable=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}
@@ -56,7 +56,7 @@ public:
if(!InitVBO())
return(false);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
return(true);
}
@@ -65,7 +65,7 @@ public:
{
VulkanApplicationFramework::Resize(w,h);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
}
};//class TestApp:public VulkanApplicationFramework

View File

@@ -47,9 +47,9 @@ private:
return(true);
}
RenderableInstance *Add(Primitive *r,const Matrix4f &mat)
Renderable *Add(Primitive *r,const Matrix4f &mat)
{
RenderableInstance *ri=db->CreateRenderableInstance(r,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(r,material_instance,pipeline);
render_root.CreateSubNode(mat,ri);

View File

@@ -5,7 +5,7 @@
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/VKRenderResource.h>
#include<hgl/graph/VKRenderableInstance.h>
#include<hgl/graph/VKRenderable.h>
#include<hgl/graph/VKTexture.h>
#include<hgl/graph/RenderList.h>
@@ -232,21 +232,21 @@ private:
void Add(Primitive *r,Pipeline *pl)
{
auto ri=db->CreateRenderableInstance(r,material_instance,pl);
auto ri=db->CreateRenderable(r,material_instance,pl);
render_root.CreateSubNode(ri);
}
void Add(Primitive *r,Pipeline *pl,const Matrix4f &mat)
{
auto ri=db->CreateRenderableInstance(r,material_instance,pl);
auto ri=db->CreateRenderable(r,material_instance,pl);
render_root.CreateSubNode(mat,ri);
}
bool InitScene()
{
render_root.CreateSubNode(db->CreateRenderableInstance(ro_axis,axis_mi,axis_pipeline));
render_root.CreateSubNode(db->CreateRenderable(ro_axis,axis_mi,axis_pipeline));
Add(ro_torus ,pipeline_solid);
Add(ro_cube ,pipeline_solid,translate(-10, 0, 5)*scale(10,10,10));

View File

@@ -32,7 +32,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -59,7 +59,7 @@ private:
if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data)))return(false);
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}

View File

@@ -4,7 +4,7 @@
#include"VulkanAppFramework.h"
#include<hgl/filesystem/FileSystem.h>
#include<hgl/graph/InlineGeometry.h>
#include<hgl/graph/RenderableInstance.h>
#include<hgl/graph/Renderable.h>
#include<hgl/graph/VertexAttribData.h>
#include<hgl/graph/data/SceneNodeData.h>
@@ -110,13 +110,13 @@ private:
ModelData *model_data;
vulkan::Primitive **mesh_renderable;
RenderableInstance **mesh_renderable_instance;
Renderable **mesh_renderable_instance;
vulkan::Primitive *axis_renderable;
RenderableInstance *axis_renderable_instance;
Renderable *axis_renderable_instance;
vulkan::Primitive *bbox_renderable;
RenderableInstance *bbox_renderable_instance;
Renderable *bbox_renderable_instance;
private:
@@ -163,9 +163,9 @@ private:
return(true);
}
RenderableInstance *CreateRenderableInstance(const MP &mp,vulkan::Primitive *r)
Renderable *CreateRenderable(const MP &mp,vulkan::Primitive *r)
{
return db->CreateRenderableInstance(mp.pipeline,mp.material_instance,r);
return db->CreateRenderable(mp.pipeline,mp.material_instance,r);
}
void CreateRenderObject()
@@ -174,12 +174,12 @@ private:
MeshData **md=model_data->mesh_list.GetData();
mesh_renderable =new vulkan::Primitive *[count];
mesh_renderable_instance=new RenderableInstance *[count];
mesh_renderable_instance=new Renderable *[count];
for(uint i=0;i<count;i++)
{
mesh_renderable[i]=CreateMeshRenderable(db,mp_solid.material,*md);
mesh_renderable_instance[i]=CreateRenderableInstance(mp_solid,mesh_renderable[i]);
mesh_renderable_instance[i]=CreateRenderable(mp_solid,mesh_renderable[i]);
++md;
}
@@ -189,7 +189,7 @@ private:
aci.size.Set(1000,1000,1000);
axis_renderable=CreateRenderableAxis(db,mp_line.material,&aci);
axis_renderable_instance=CreateRenderableInstance(mp_line,axis_renderable);
axis_renderable_instance=CreateRenderable(mp_line,axis_renderable);
}
{
@@ -199,7 +199,7 @@ private:
cci.color.Set(1,1,1,1);
bbox_renderable=CreateRenderableBoundingBox(db,mp_line.material,&cci);
bbox_renderable_instance=CreateRenderableInstance(mp_line,bbox_renderable);
bbox_renderable_instance=CreateRenderable(mp_line,bbox_renderable);
}
}

View File

@@ -25,7 +25,7 @@ class TestApp:public CameraAppFramework
RenderCmdBuffer * command_buffer =nullptr;
Pipeline * pipeline =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
public:
@@ -45,7 +45,7 @@ class TestApp:public CameraAppFramework
Sampler * sampler =nullptr;
Pipeline * pipeline =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
SceneNode scene_root;
RenderList * render_list =nullptr;
@@ -108,12 +108,12 @@ public:
Primitive *primitive=CreateRenderableCircle(db,os.material_instance->GetVAB(),&cci);
if(!primitive)return(false);
os.renderable_instance=db->CreateRenderableInstance(primitive,os.material_instance,os.pipeline);
os.renderable=db->CreateRenderable(primitive,os.material_instance,os.pipeline);
if(!os.renderable_instance)return(false);
if(!os.renderable)return(false);
}
VulkanApplicationFramework::BuildCommandBuffer(os.command_buffer,os.render_taget,os.renderable_instance);
VulkanApplicationFramework::BuildCommandBuffer(os.command_buffer,os.render_taget,os.renderable);
os.Submit();
@@ -144,9 +144,9 @@ public:
Primitive *primitive=CreateRenderableCube(db,cube.material_instance->GetVAB(),&cci);
if(!primitive)return(false);
cube.renderable_instance=db->CreateRenderableInstance(primitive,cube.material_instance,cube.pipeline);
cube.renderable=db->CreateRenderable(primitive,cube.material_instance,cube.pipeline);
cube.scene_root.CreateSubNode(cube.renderable_instance);
cube.scene_root.CreateSubNode(cube.renderable);
}
camera->pos=Vector4f(5,5,5,1.0);

View File

@@ -67,9 +67,9 @@ private:
return(true);
}
RenderableInstance *Add(Primitive *r,const Matrix4f &mat)
Renderable *Add(Primitive *r,const Matrix4f &mat)
{
RenderableInstance *ri=db->CreateRenderableInstance(r,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(r,material_instance,pipeline);
render_root.CreateSubNode(mat,ri);

View File

@@ -38,7 +38,7 @@ private:
Sampler * sampler =nullptr;
MaterialInstance * material_instance =nullptr;
Primitive * primitive =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -73,7 +73,7 @@ private:
primitive->Set(VAN::Position,db->CreateVBO(VF_V4F,VERTEX_COUNT,position_data));
primitive->Set(VAN::TexCoord,db->CreateVBO(VF_V4F,VERTEX_COUNT,tex_coord_data));
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
return(render_instance);
}

View File

@@ -112,7 +112,7 @@ private:
uint count;
float size;
RenderableInstance *ri=db->CreateRenderableInstance(renderable_object,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(renderable_object,material_instance,pipeline);
for(uint i=0;i<360;i++)
{

View File

@@ -77,9 +77,9 @@ private:
return(true);
}
RenderableInstance *Add(Primitive *r,const Matrix4f &mat)
Renderable *Add(Primitive *r,const Matrix4f &mat)
{
RenderableInstance *ri=db->CreateRenderableInstance(r,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(r,material_instance,pipeline);
render_root.CreateSubNode(mat,ri);

View File

@@ -66,9 +66,9 @@ private:
return(true);
}
RenderableInstance *Add(Primitive *r,const Matrix4f &mat)
Renderable *Add(Primitive *r,const Matrix4f &mat)
{
RenderableInstance *ri=db->CreateRenderableInstance(r,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(r,material_instance,pipeline);
render_root.CreateSubNode(mat,ri);
@@ -100,7 +100,7 @@ private:
bool InitScene()
{
RenderableInstance *ri=db->CreateRenderableInstance(renderable,material_instance,pipeline);
Renderable *ri=db->CreateRenderable(renderable,material_instance,pipeline);
render_root.CreateSubNode(ri);

View File

@@ -32,7 +32,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -59,7 +59,7 @@ private:
if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data)))return(false);
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}

View File

@@ -35,7 +35,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
Pipeline * pipeline =nullptr;
@@ -62,7 +62,7 @@ private:
if(!primitive->Set(VAN::Position,db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
if(!primitive->Set(db->CreateIBO16(INDEX_COUNT,index_data)))return(false);
renderable_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
renderable=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}
@@ -80,7 +80,7 @@ public:
if(!InitVBO())
return(false);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
return(true);
}
@@ -89,7 +89,7 @@ public:
{
VulkanApplicationFramework::Resize(w,h);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
}
};//class TestApp:public VulkanApplicationFramework

View File

@@ -32,7 +32,7 @@ class TestApp:public VulkanApplicationFramework
private:
MaterialInstance * material_instance =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -61,7 +61,7 @@ private:
if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data)))return(false);
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}

View File

@@ -50,7 +50,7 @@ private:
Texture2D * texture =nullptr;
Sampler * sampler =nullptr;
MaterialInstance * material_instance =nullptr;
RenderableInstance *renderable_instance =nullptr;
Renderable *renderable =nullptr;
Pipeline * pipeline =nullptr;
private:
@@ -87,7 +87,7 @@ private:
if(!primitive->Set(VAN::TexCoord,db->CreateVBO(VF_V2F,VERTEX_COUNT,tex_coord_data)))return(false);
if(!primitive->Set(db->CreateIBO16(INDEX_COUNT,index_data)))return(false);
renderable_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
renderable=db->CreateRenderable(primitive,material_instance,pipeline);
return(true);
}
@@ -105,7 +105,7 @@ public:
if(!InitVBO())
return(false);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
return(true);
}
@@ -114,7 +114,7 @@ public:
{
VulkanApplicationFramework::Resize(w,h);
BuildCommandBuffer(renderable_instance);
BuildCommandBuffer(renderable);
}
};//class TestApp:public VulkanApplicationFramework

View File

@@ -34,7 +34,7 @@ private:
RenderList * render_list =nullptr;
MaterialInstance * material_instance =nullptr;
RenderableInstance *render_instance =nullptr;
Renderable *render_instance =nullptr;
Pipeline * pipeline =nullptr;
@@ -63,7 +63,7 @@ private:
if(!primitive->Set(VAN::Position, db->CreateVBO(VF_V2F,VERTEX_COUNT,position_data)))return(false);
if(!primitive->Set(VAN::Color, db->CreateVBO(VF_V4F,VERTEX_COUNT,color_data)))return(false);
render_instance=db->CreateRenderableInstance(primitive,material_instance,pipeline);
render_instance=db->CreateRenderable(primitive,material_instance,pipeline);
render_root.CreateSubNode(render_instance);