From 5186e891a5f3b5fd71b03d42c26fecdea385ddf4 Mon Sep 17 00:00:00 2001 From: cryham Date: Thu, 7 Nov 2024 03:20:32 +0100 Subject: [PATCH] ed too --- data/gui/Editor_Options.layout | 4 ++-- data/gui/Game_Options.layout | 2 +- data/materials/Pbs/object.material.json | 4 ++-- src/common/AppGui_GI.cpp | 22 +++++++++---------- src/editor/App_SceneInitEd.cpp | 5 +++++ src/editor/Update_Frame.cpp | 5 ++++- ...p_SceneInitGame.cpp => Game_SceneInit.cpp} | 4 ++-- src/game/Game_Update.cpp | 12 +++++----- 8 files changed, 34 insertions(+), 24 deletions(-) rename src/game/{App_SceneInitGame.cpp => Game_SceneInit.cpp} (96%) diff --git a/data/gui/Editor_Options.layout b/data/gui/Editor_Options.layout index 56271175..4d454ef3 100644 --- a/data/gui/Editor_Options.layout +++ b/data/gui/Editor_Options.layout @@ -189,8 +189,8 @@ - - + + diff --git a/data/gui/Game_Options.layout b/data/gui/Game_Options.layout index c73be17d..bf0f021a 100644 --- a/data/gui/Game_Options.layout +++ b/data/gui/Game_Options.layout @@ -189,7 +189,7 @@ - + diff --git a/data/materials/Pbs/object.material.json b/data/materials/Pbs/object.material.json index d28bf063..fabbdd76 100644 --- a/data/materials/Pbs/object.material.json +++ b/data/materials/Pbs/object.material.json @@ -153,7 +153,7 @@ }, "fresnel" : { - "value" : 0.1, + "value" : 0.6, "mode" : "coeff" }, "normal" : @@ -164,7 +164,7 @@ }, "roughness" : { - "value" : 0.4 + "value" : 0.1 } }, diff --git a/src/common/AppGui_GI.cpp b/src/common/AppGui_GI.cpp index 737e01fa..6fc4124e 100644 --- a/src/common/AppGui_GI.cpp +++ b/src/common/AppGui_GI.cpp @@ -68,16 +68,16 @@ void AppGui::DestroyGI() //----------------------------------------------------------------------------------- void AppGui::UpdateGI() { - //if (mGraphicsSystem->getRenderWindow()->isVisible()) - //{ - // static int frame = 0; - // if (frame > 1) - // { - // mVoxelizer->build( mSceneMgr ); - // mVctLighting->update( mSceneMgr, mNumBounces ); - // } - // ++frame; - //} + /*if (mGraphicsSystem->getRenderWindow()->isVisible()) + { + static int frame = 0; + if (frame > 1) + { + mVoxelizer->build( mSceneMgr ); + mVctLighting->update( mSceneMgr, mNumBounces ); + } + ++frame; + }*/ // ? ^ if (mIrradianceField) if (GIgetMode() == IfdVct || GIgetMode() == Ifd) @@ -211,7 +211,7 @@ void AppGui::GInextIrradianceField( int add ) } } -// Voxelize scene +// 🌄🔁 Voxelize scene //----------------------------------------------------------------------------------- void AppGui::GIVoxelizeScene() { diff --git a/src/editor/App_SceneInitEd.cpp b/src/editor/App_SceneInitEd.cpp index a0b64276..6cf40da3 100644 --- a/src/editor/App_SceneInitEd.cpp +++ b/src/editor/App_SceneInitEd.cpp @@ -300,6 +300,8 @@ void App::LoadTrackEv() NewCommon(false); // full destroy iObjCur = -1; iEmtCur = -1; + DestroyGI(); // 🌄 + scn->DestroyRoads(); scn->DestroyPace(); scn->DestroyTrails(); @@ -380,6 +382,9 @@ void App::LoadTrackEv() scn->LoadRoadDens(); scn->CreateVegets(); // trees after objects so they aren't inside them scn->grass->Create(this); // 🌿 + + if (pSet->gi) + InitGI(); // 🌄 } diff --git a/src/editor/Update_Frame.cpp b/src/editor/Update_Frame.cpp index d5ceb3bb..5fba150f 100644 --- a/src/editor/Update_Frame.cpp +++ b/src/editor/Update_Frame.cpp @@ -359,8 +359,11 @@ void App::update( float dt ) processCamera(mDTime); + if (pSet->ssao) - UpdateSSAO(); + UpdateSSAO(); // 🕳️ + if (pSet->gi) + UpdateGI(); // 🌄 /// gui diff --git a/src/game/App_SceneInitGame.cpp b/src/game/Game_SceneInit.cpp similarity index 96% rename from src/game/App_SceneInitGame.cpp rename to src/game/Game_SceneInit.cpp index eaf78975..a4560506 100644 --- a/src/game/App_SceneInitGame.cpp +++ b/src/game/Game_SceneInit.cpp @@ -263,7 +263,7 @@ void App::LoadCleanUp() LogO("DD-- LoadCleanUp ------DD"); updMouse(); - DestroyGI(); + DestroyGI(); // 🌄 if (dstTrk) { @@ -752,7 +752,7 @@ void App::LoadTrees() scn->grass->Create(this); // 🌿 if (pSet->gi) - InitGI(); + InitGI(); // 🌄 } // check for cars inside terrain ___ diff --git a/src/game/Game_Update.cpp b/src/game/Game_Update.cpp index 026cb724..c56d2029 100644 --- a/src/game/Game_Update.cpp +++ b/src/game/Game_Update.cpp @@ -49,16 +49,18 @@ void App::update( float dt ) { fLastFrameDT = dt; - if (pSet->ssao) - UpdateSSAO(); - if (pSet->gi) - UpdateGI(); - #if 0 //** log big dt if (dt > 0.02) LogO("dt "+fToStr(dt,3,5)); #endif + + if (pSet->ssao) + UpdateSSAO(); // 🕳️ + if (pSet->gi) + UpdateGI(); // 🌄 + + // fixes white texture flashes if (bLoading) {