From bcd373fe6f5425867e6632f97431d0d0c6167acd Mon Sep 17 00:00:00 2001 From: hyzboy Date: Wed, 9 Mar 2022 19:25:52 +0800 Subject: [PATCH] updated SkyColor --- CMCore | 2 +- CMSceneGraph | 2 +- example/Vulkan/SkyColor.cpp | 16 ++++++++++++---- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/CMCore b/CMCore index d1f7b588..716407fa 160000 --- a/CMCore +++ b/CMCore @@ -1 +1 @@ -Subproject commit d1f7b588a3dc839a68776c4931225ff49edb7495 +Subproject commit 716407fa2d16b17efa51c70396e6518fc7275676 diff --git a/CMSceneGraph b/CMSceneGraph index 59f5b9dc..4eaa9c9f 160000 --- a/CMSceneGraph +++ b/CMSceneGraph @@ -1 +1 @@ -Subproject commit 59f5b9dcb58de3697d2a20448d9910dc0ae608b7 +Subproject commit 4eaa9c9f5b9ae1aa3dcae63b239000113c84d1c8 diff --git a/example/Vulkan/SkyColor.cpp b/example/Vulkan/SkyColor.cpp index 505b19eb..7148fdf0 100644 --- a/example/Vulkan/SkyColor.cpp +++ b/example/Vulkan/SkyColor.cpp @@ -11,9 +11,15 @@ using namespace hgl::graph; constexpr uint32_t SCREEN_WIDTH=1280; constexpr uint32_t SCREEN_HEIGHT=720; +struct SkyColorConfig +{ + Color4f Color; + Color4f LowColor; +}; + class TestApp:public CameraAppFramework { - Color3f color; + SkyColorConfig scc; GPUBuffer *ubo_color=nullptr; @@ -49,7 +55,7 @@ private: bool InitUBO() { - color.Set( + scc.Color.Set( //.1, .3, .6 //blue //.18,.19,.224 //overcast //.1, .15,.4 //dusk @@ -58,7 +64,9 @@ private: //.1, .2, .01 //green ); - ubo_sky_color=db->CreateUBO(sizeof(Color3f),&color); + scc.LowColor.Use(COLOR::DarkMidnightBlue,1.0f); + + ubo_sky_color=db->CreateUBO(sizeof(SkyColorConfig),&scc); if(!ubo_sky_color) return(false); @@ -90,7 +98,7 @@ private: { const VAB *vab=material_instance->GetVAB(); - ro_skyphere=CreateRenderableDome(db,vab,32); + ro_skyphere=CreateRenderableSphere(db,vab,1024); } bool InitScene()