看起来似乎完全正确的DEPTH TEST/MASK

This commit is contained in:
2019-07-12 01:57:18 +08:00
parent f3a8028e7c
commit fc67299042
6 changed files with 10 additions and 36 deletions

View File

@@ -169,7 +169,7 @@ private:
const VkFormat position_format =FMT_RGBA16F;
const VkFormat color_format =FMT_RGBA16F;
const VkFormat normal_format =FMT_RGBA16F;
const VkFormat depth_format =FMT_D16UN;
const VkFormat depth_format =FMT_D32F;
gbuffer.position=device->CreateAttachmentTextureColor(position_format, gbuffer.extent.width,gbuffer.extent.height);
gbuffer.color =device->CreateAttachmentTextureColor(color_format, gbuffer.extent.width,gbuffer.extent.height);

View File

@@ -11,8 +11,8 @@
using namespace hgl;
using namespace hgl::graph;
constexpr uint32_t SCREEN_WIDTH=128;
constexpr uint32_t SCREEN_HEIGHT=128;
constexpr uint32_t SCREEN_WIDTH=1280;
constexpr uint32_t SCREEN_HEIGHT=720;
class TestApp:public CameraAppFramework
{
@@ -33,8 +33,7 @@ private:
*ro_cone;
vulkan::Pipeline *pipeline_line =nullptr,
*pipeline_solid =nullptr,
*pipeline_twoside =nullptr;
*pipeline_solid =nullptr;
private:
@@ -156,22 +155,14 @@ private:
return(false);
db->Add(pipeline_solid);
pipeline_creater->SetCullMode(VK_CULL_MODE_NONE);
pipeline_twoside=pipeline_creater->Create();
if(!pipeline_twoside)
return(false);
db->Add(pipeline_twoside);
return(true);
}
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_torus));
//render_root.Add(db->CreateRenderableInstance(pipeline_solid,descriptor_sets,ro_dome));
render_root.Add(db->CreateRenderableInstance(pipeline_solid,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));
render_root.Add(db->CreateRenderableInstance(pipeline_solid,descriptor_sets,ro_cylinder ),translate( 0, 16, 0));

View File

@@ -277,8 +277,8 @@ public:
camera.height=h;
camera.center.Set(0,0,0,1);
camera.eye.Set(100,100,0,1); //xyz三个值不要一样以方便调试
camera.znear=-1;
camera.zfar=1;
camera.znear=0.01f;
camera.zfar=1024;
camera.Refresh(); //更新矩阵计算
}