From e2af7fb15a1bfad5b50e81a80552d4e582ea21a3 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Fri, 7 Jan 2022 21:16:44 +0800 Subject: [PATCH] updated example --- CMPlatform | 2 +- CMSceneGraph | 2 +- example/Vulkan/Cubemap.cpp | 21 ++++++++++++++++----- example/Vulkan/indices_rect.cpp | 4 ++-- res | 2 +- 5 files changed, 21 insertions(+), 10 deletions(-) diff --git a/CMPlatform b/CMPlatform index bb671a96..72b59fc2 160000 --- a/CMPlatform +++ b/CMPlatform @@ -1 +1 @@ -Subproject commit bb671a9674155a184671caa047844dd9e82f2ad5 +Subproject commit 72b59fc22ece0a2e76b2319060dd99490297a238 diff --git a/CMSceneGraph b/CMSceneGraph index 45102e04..143cddc0 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 45102e04208043bf1ae84f9c58d4a56278527844 +Subproject commit 143cddc02c3245ba46adce414225fc2851caf667 diff --git a/example/Vulkan/Cubemap.cpp b/example/Vulkan/Cubemap.cpp index ae7d56a3..5b941c36 100644 --- a/example/Vulkan/Cubemap.cpp +++ b/example/Vulkan/Cubemap.cpp @@ -30,7 +30,7 @@ private: MaterialInstance * axis_mi =nullptr; Pipeline * axis_pipeline =nullptr; - Pipeline * pipeline_solid =nullptr; + Pipeline * sky_pipeline =nullptr; GPUBuffer * ubo_light =nullptr; GPUBuffer * ubo_phong =nullptr; @@ -57,7 +57,7 @@ private: } { - texture =db->LoadTextureCube(OS_TEXT("res/cubemap/Test.TexCube"),true); + texture =db->LoadTextureCube(OS_TEXT("res/cubemap/Storforsen4.TexCube"),true); if(!texture) return(false); @@ -107,8 +107,8 @@ private: } } - pipeline_solid=CreatePipeline(material_instance,InlinePipeline::Solid3D,Prim::Triangles); - if(!pipeline_solid)return(false); + sky_pipeline=CreatePipeline(material_instance,InlinePipeline::Sky,Prim::Triangles); + if(!sky_pipeline)return(false); return(true); } @@ -145,6 +145,17 @@ private: mp_global->Update(); } + { + MaterialParameters *mp_global=material_instance->GetMP(DescriptorSetsType::Global); + + if(!mp_global) + return(false); + + if(!mp_global->BindUBO("g_camera",GetCameraInfoBuffer()))return(false); + + mp_global->Update(); + } + return(true); } @@ -166,7 +177,7 @@ private: { render_root.CreateSubNode(db->CreateRenderableInstance(ro_axis,axis_mi,axis_pipeline)); - Add(ro_cube,pipeline_solid); + Add(ro_cube,sky_pipeline); render_root.RefreshMatrix(); render_list->Expend(GetCameraInfo(),&render_root); diff --git a/example/Vulkan/indices_rect.cpp b/example/Vulkan/indices_rect.cpp index eb255882..a7ca4b92 100644 --- a/example/Vulkan/indices_rect.cpp +++ b/example/Vulkan/indices_rect.cpp @@ -7,8 +7,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=256; +constexpr uint32_t SCREEN_HEIGHT=256; constexpr uint32_t VERTEX_COUNT=4; diff --git a/res b/res index 23303f0a..e65aa9ac 160000 --- a/res +++ b/res @@ -1 +1 @@ -Subproject commit 23303f0aff3ac24351f4f872fe657ea8c8172c1e +Subproject commit e65aa9ac86ff0bce4e1bf9bc96221d1ff3123c5d