diff --git a/example/Vulkan/Deferred.cpp b/example/Vulkan/Deferred.cpp index 741aa4ac..80b405f4 100644 --- a/example/Vulkan/Deferred.cpp +++ b/example/Vulkan/Deferred.cpp @@ -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); diff --git a/example/Vulkan/InlineGeometryScene.cpp b/example/Vulkan/InlineGeometryScene.cpp index 81e12ac2..725f3edd 100644 --- a/example/Vulkan/InlineGeometryScene.cpp +++ b/example/Vulkan/InlineGeometryScene.cpp @@ -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)); diff --git a/example/Vulkan/VulkanAppFramework.h b/example/Vulkan/VulkanAppFramework.h index e30bc386..e3a95b01 100644 --- a/example/Vulkan/VulkanAppFramework.h +++ b/example/Vulkan/VulkanAppFramework.h @@ -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(); //更新矩阵计算 } diff --git a/inc/hgl/graph/Camera.h b/inc/hgl/graph/Camera.h index d83e78e2..1a118916 100644 --- a/inc/hgl/graph/Camera.h +++ b/inc/hgl/graph/Camera.h @@ -39,7 +39,7 @@ namespace hgl float height; ///<视图高 float fov=60; ///<水平FOV - float znear=-1,zfar=1; ///