updated SkyColor

This commit is contained in:
hyzboy 2022-03-09 19:25:52 +08:00
parent 2feb7137cd
commit bcd373fe6f
3 changed files with 14 additions and 6 deletions

2
CMCore

@ -1 +1 @@
Subproject commit d1f7b588a3dc839a68776c4931225ff49edb7495
Subproject commit 716407fa2d16b17efa51c70396e6518fc7275676

@ -1 +1 @@
Subproject commit 59f5b9dcb58de3697d2a20448d9910dc0ae608b7
Subproject commit 4eaa9c9f5b9ae1aa3dcae63b239000113c84d1c8

View File

@ -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()