storm-devs / storm-engine

Game engine behind Sea Dogs, Pirates of the Caribbean and Age of Pirates games.
https://storm-devs.github.io/storm-engine
GNU General Public License v3.0
843 stars 121 forks source link

Feature: understand why bPostProcessEnabled is false and what will happen after enabling it #356

Open q4a opened 2 years ago

q4a commented 2 years ago

I would like to understand:

Some log from discord - already known information:

q4a — 03.05.2021 I wanted to understand what current shaders do and started with small one: https://github.com/storm-devs/storm-engine/blob/develop/src/techniques/postprocess/postprocess_shader.h But looks like it was disabled and newer calls because of this line commented out: https://github.com/storm-devs/storm-engine/blob/develop/src/libs/renderer/sdevice.cpp#L361 It was modified in this commit: https://github.com/storm-devs/storm-engine/commit/02d86a97a369685a7b959cecf93821031140fde0#diff-d19d7f5cf5224e1c43653497eae01f143fa786809b3c5bcf651d98e13db8720aL391 and I would like to know - should I ignore this shader or better remove it?

kb31 — 03.05.2021 Honestly, I do not remember why did I disable it Likely it was causing issues I think we should try to turn it back anyway

q4a — 03.05.2021 when I turned on it in code and engine.ini - I got black screen instead of intro video

kb31 — 03.05.2021 That might be because some code is missing from dx9render.cpp...

cooodesloth — 03.05.2021 @q4a you could also try to find a related commit in the thunderstorm fork to know exactly why it was disabled

q4a — 03.05.2021 I found: https://github.com/storm-devs/thunderstorm-engine/commit/696d2eb3ad68e658b8c54ffd43312ed19aae873a

cooodesloth — 03.05.2021 seems like it was disabled even before https://github.com/storm-devs/thunderstorm-engine/commit/696d2eb3ad68e658b8c54ffd43312ed19aae873a#diff-7baa1c729b48852f3fa56b26eb0338225e2071f7e2ae4697c86835bccb8348e7L736

kb31 — 03.05.2021 Yeah as I said I disabled it long time ago As I recall now, I likely tried to achieve correct sequence of directx device free So this was not meant to be disabled forever, that's why the shader was not removed

q4a commented 2 years ago

I did simple enabling it in develop branch: https://github.com/storm-devs/storm-engine/tree/0a36c919d09cd3c903ff328341a5e1caad797ec8

user@ali MINGW64 /c/git/storm-engine-noChang (develop)
$ git status
On branch develop
Your branch is up to date with 'origin/develop'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   src/libs/renderer/src/s_device.cpp

no changes added to commit (use "git add" and/or "git commit -a")

user@ali MINGW64 /c/git/storm-engine-noChang (develop)
$ git show --summary
commit 0a36c919d09cd3c903ff328341a5e1caad797ec8 (HEAD -> develop, origin/develop
, origin/HEAD)
Merge: abdce362 6f1aea88
Author: espkk <espkk@protonmail.ch>
Date:   Mon Apr 4 18:24:24 2022 +0300

    Merge pull request #351 from storm-devs/fix/script-cache-crash

    [core] Fix script cache crash

user@ali MINGW64 /c/git/storm-engine-noChang (develop)
$ git diff
diff --git a/src/libs/renderer/src/s_device.cpp b/src/libs/renderer/src/s_device
.cpp
index dd756e75..474a19ba 100644
--- a/src/libs/renderer/src/s_device.cpp
+++ b/src/libs/renderer/src/s_device.cpp
@@ -491,7 +491,7 @@ bool DX9RENDER::Init()
     if (ini)
     {
         // bPostProcessEnabled = ini->GetInt(0, "PostProcess", 0) == 1;
-        bPostProcessEnabled = false; //~!~
+        bPostProcessEnabled = true; //~!~

         // screenshot format and extension
         ini->ReadString(nullptr, "screenshot_format", str, sizeof(str), "jpg");

And got many bugs. Intro video was black. Also here is main screen + few in game screens: main-screen in-game1 in-game2 in-game3