已确认几个2D范例均可正常DEPTH TEST/WRITE,但在使用CAMERA后得出的无法写入DEPTH

This commit is contained in:
2019-07-11 02:42:11 +08:00
parent 13e9bd19e7
commit 4412766ddf
11 changed files with 17 additions and 20 deletions

View File

@@ -116,8 +116,6 @@ private:
{
AutoDelete<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(false);
pipeline_creater->SetDepthWrite(false);
pipeline_creater->CloseCullFace();
pipeline_creater->Set(PRIM_TRIANGLE_FAN);

View File

@@ -139,8 +139,6 @@ private:
{
AutoDelete<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(true);
pipeline_creater->SetDepthWrite(true);
pipeline_creater->Set(PRIM_LINES);
pipeline_line=pipeline_creater->Create();
@@ -172,7 +170,7 @@ private:
bool InitScene()
{
render_root.Add(db->CreateRenderableInstance(pipeline_line,descriptor_sets,ro_plane_grid));
render_root.Add(db->CreateRenderableInstance(pipeline_twoside,descriptor_sets,ro_dome));
//render_root.Add(db->CreateRenderableInstance(pipeline_twoside,descriptor_sets,ro_dome));
render_root.Add(db->CreateRenderableInstance(pipeline_twoside,descriptor_sets,ro_torus));
render_root.Add(db->CreateRenderableInstance(pipeline_solid,descriptor_sets,ro_cube ),translate(-10, 0, 5)*scale(10,10,10));
render_root.Add(db->CreateRenderableInstance(pipeline_solid,descriptor_sets,ro_sphere ),translate( 10, 0, 5)*scale(10,10,10));

View File

@@ -301,11 +301,11 @@ public:
virtual void Draw()override
{
const uint32_t index=AcquireNextImage();
camera.Refresh(); //更新相机矩阵
ubo_world_matrix->Write(&camera.matrix); //写入缓冲区
const uint32_t index=AcquireNextImage();
BuildCommandBuffer(index);
SubmitDraw(index);

View File

@@ -105,8 +105,6 @@ private:
{
AutoDelete<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(false);
pipeline_creater->SetDepthWrite(false);
pipeline_creater->CloseCullFace();
pipeline_creater->Set(PRIM_TRIANGLES);

View File

@@ -109,8 +109,6 @@ private:
{
AutoDelete<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(false);
pipeline_creater->SetDepthWrite(false);
pipeline_creater->CloseCullFace();
pipeline_creater->Set(PRIM_TRIANGLES);

View File

@@ -150,8 +150,6 @@ private:
{
AutoDelete<vulkan::PipelineCreater>
pipeline_creater=new vulkan::PipelineCreater(device,material,device->GetMainRenderPass(),device->GetExtent());
pipeline_creater->SetDepthTest(false);
pipeline_creater->SetDepthWrite(false);
pipeline_creater->CloseCullFace();
pipeline_creater->Set(PRIM_TRIANGLES);