From dcda5b0facb118f10347922ac5dd4a797f03d1d0 Mon Sep 17 00:00:00 2001 From: hyzboy Date: Tue, 28 Sep 2021 20:26:36 +0800 Subject: [PATCH] the change don't have any effect. --- example/Vulkan/DeferredModel.cpp | 17 +++++++++-------- inc/hgl/graph/VK.h | 3 +++ res | 2 +- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/example/Vulkan/DeferredModel.cpp b/example/Vulkan/DeferredModel.cpp index 67020ebd..1d42a56b 100644 --- a/example/Vulkan/DeferredModel.cpp +++ b/example/Vulkan/DeferredModel.cpp @@ -33,7 +33,7 @@ enum class GBufferAttachment ENUM_CLASS_RANGE(Color,Normal) };// -constexpr VkFormat gbuffer_color_format[size_t(GBufferAttachment::RANGE_SIZE)]={UPF_RGB565,PF_RG8UN}; +constexpr VkFormat gbuffer_color_format[size_t(GBufferAttachment::RANGE_SIZE)]={UPF_RGB565,UPF_RG8}; constexpr VkFormat gbuffer_depth_format=PF_D16UN; struct alignas(16) PhongPointLight @@ -84,9 +84,10 @@ private: *ro_sphere, *ro_torus, *ro_cylinder, - *ro_cone, - - *ro_gbc_plane; + *ro_cone, + *ro_gbc_plane, + *ro_axis; + RenderableInstance *ro_gbc_plane_ri; Sampler * sampler=nullptr; @@ -314,7 +315,7 @@ private: { CreateRenderObject(sp->material); render_root.CreateSubNode( scale(100,100,1), db->CreateRenderableInstance(ro_plane ,sp->material_instance,sp->pipeline_fan )); - render_root.CreateSubNode(translate(0,0,0), db->CreateRenderableInstance(ro_torus ,sp->material_instance,sp->pipeline_triangles)); + render_root.CreateSubNode( db->CreateRenderableInstance(ro_torus ,sp->material_instance,sp->pipeline_triangles)); render_root.CreateSubNode( scale(20,20,20), db->CreateRenderableInstance(ro_sphere ,sp->material_instance,sp->pipeline_triangles)); render_root.CreateSubNode(translate(-30, 0,10)*scale(10,10,10), db->CreateRenderableInstance(ro_cube ,sp->material_instance,sp->pipeline_triangles)); render_root.CreateSubNode(translate( 30, 30,10)*scale(1,1,2), db->CreateRenderableInstance(ro_cylinder ,sp->material_instance,sp->pipeline_triangles)); @@ -378,9 +379,9 @@ public: const double timer=GetDoubleTime(); // White - lights.position = Vector4f(0.0f, 0.0f, 50.0f, 0.0f); - lights.color = Vector4f(1.0f); - lights.radius = 15.0f; + lights.position = Vector4f(0.0f, 0.0f, 25.0f, 0.0f); + lights.color = Vector4f(15.0f); + lights.radius = 155.0f; lights.position.x = sin(hgl_rad2deg(timer/100)) * 100.0f; lights.position.y = cos(hgl_rad2deg(timer/100)) * 100.0f; diff --git a/inc/hgl/graph/VK.h b/inc/hgl/graph/VK.h index 8b584794..1be821da 100644 --- a/inc/hgl/graph/VK.h +++ b/inc/hgl/graph/VK.h @@ -149,6 +149,9 @@ inline const uint32_t GetMipLevel(const VkExtent3D &ext) return hgl::GetMipLevel(ext.width,ext.height,ext.depth); } +/** + * 索引类型,等同于VkIndexType + */ enum IndexType { U16=0, diff --git a/res b/res index 5a45a9ec..c2797623 160000 --- a/res +++ b/res @@ -1 +1 @@ -Subproject commit 5a45a9ec3c13fe60453b4d40571fda2d912dbc0e +Subproject commit c279762326b8ca91368cb4a607230de5d9d3ff79