diff --git a/example/Vulkan/CMakeLists.txt b/example/Vulkan/CMakeLists.txt index 22ba60f5..85b17f66 100644 --- a/example/Vulkan/CMakeLists.txt +++ b/example/Vulkan/CMakeLists.txt @@ -28,7 +28,7 @@ CreateProject(00.triangle first_triangle.cpp) CreateProject(01.two_triangle two_triangle.cpp) CreateProject(02.FragCoord FragCoordTest.cpp) CreateProject(03.indices_rect indices_rect.cpp) -CreateProject(04.FullScreenRect FullScreenRect.cpp) +CreateProject(04.FullScreenTriangle FullScreenTriangle.cpp) CreateProject(05.TextureFormat TextureFormat.cpp) CreateProject(06.texture_rect texture_rect.cpp) diff --git a/example/Vulkan/FullScreenRect.cpp b/example/Vulkan/FullScreenTriangle.cpp similarity index 85% rename from example/Vulkan/FullScreenRect.cpp rename to example/Vulkan/FullScreenTriangle.cpp index aeb0c6e5..1b20531a 100644 --- a/example/Vulkan/FullScreenRect.cpp +++ b/example/Vulkan/FullScreenTriangle.cpp @@ -1,5 +1,5 @@ -// 全屏矩形 -// 该范例用于演示使用索引画一个矩形,但是不传递顶点信息。 +// 全屏三角形 +// 该范例用于演示使用索引画一个覆盖全屏的三角形,但是不传递任何顶点信息,顶点坐标在vertex shader中通过gl_VertexIndex计算出来。 #include"VulkanAppFramework.h" #include @@ -10,8 +10,6 @@ using namespace hgl::graph; constexpr uint32_t SCREEN_WIDTH=256; constexpr uint32_t SCREEN_HEIGHT=256; -static Vector4f color(1,1,1,1); - class TestApp:public VulkanApplicationFramework { private: @@ -30,14 +28,14 @@ private: BindCameraUBO(material_instance); - pipeline=CreatePipeline(material_instance,InlinePipeline::Solid2D,Prim::Fan); + pipeline=CreatePipeline(material_instance,InlinePipeline::Solid2D,Prim::Triangles); return pipeline; } bool InitVBO() - { - auto render_obj=db->CreateRenderable(4); + { + auto render_obj=db->CreateRenderable(3); if(!render_obj)return(false); renderable_instance=db->CreateRenderableInstance(render_obj,material_instance,pipeline);