MadDeCoDeR / Classic-RBDOOM-3-BFG

DOOM: BFA (Big Freaking Anniversary) Edition (former Classic RBDoom 3 BFG) is a source port based on RBDOOM-3-BFG and enchance the experience of Ultimate DOOM, DOOM 2 and DOOM 3.
GNU General Public License v3.0
211 stars 22 forks source link

Soft Shadows Enabled = nearly black scene #110

Open donizettilorenzo opened 1 year ago

donizettilorenzo commented 1 year ago

Is it intended or expected behaviour?

https://i.postimg.cc/kgDp4s68/Doom-BFA-2023-08-10-14-48-41-416.jpg

MadDeCoDeR commented 1 year ago

Kind of expected. HDR over-illuminates the game and the britness option can reach some ridiculous low light levels. Try to increase the brightness when HDR is disabled

donizettilorenzo commented 1 year ago

So maybe it's not HDR by itself.

https://i.postimg.cc/TwkYXGKg/0.jpg https://i.postimg.cc/dQxtHsPK/1.jpg

How can I tell/see if SSGI is working?

donizettilorenzo commented 1 year ago

(by the way, i suggest to merge "advanced options" submenu with "game options" one - and as I've said before, flashlight shadows option seems to have a problem but the major one is the "pitch black" rendering with soft shadows on, it's not the HDR, pardon)

MadDeCoDeR commented 1 year ago

Check the latest update I did on 1.3.0

donizettilorenzo commented 1 year ago

Tested on a Radeon RX 570 no problem, it's an Nvidia related issue with soft shadows (not HDR, please correct the topic, thanks, my bad) :)

MadDeCoDeR commented 1 year ago

I also have a RX 570, so it's more expected to work on it. The issue was with old GPUs (ref #109 You mention that is a Geforce 3060 not a RTX 3060). But also I don't have any new nVidia GPU to test it

donizettilorenzo commented 1 year ago

An RTX 3060 of course.

MadDeCoDeR commented 1 year ago

An RTX 3060 of course.

Umf. I uploaded some new nightly builds with debug enabled. You can find them here https://github.com/MadDeCoDeR/Classic-RBDOOM-3-BFG/releases. Just download the RC-debug and launch it with the launch argument +set logfile 1 and try to enable/disable soft shadows, it should generate a log file in C:\Users\\Id Software\ DOOM BFA\base\qconsole.log. Send me that to check if there is any OpenGL errors.

NOTE: The debug builds are NOT OPTIMIZED and that means that they might have LOW FPS no matter what you will do

donizettilorenzo commented 1 year ago

It just crashes at start "0(100) : error C1101:

_ambiguous overloaded function reference "clamp(float, int, float)" gp5 float64_t clamp(float64_t, float64_t, float64t) float clamp(float, float, float)

MadDeCoDeR commented 1 year ago

That's odd both windows and linux debug binaries run on my system. What OS do you have? And also have you installed any C/C++ compiler or tool on it?

donizettilorenzo commented 1 year ago

Got the problem using the lastest build retail version. When you switch on the Soft Shadows in the log you can find:

WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL WARNING: RB_DrawElementsWithCounters, vertexBuffer == NULL

etc etc etc, the same message That's why it's pitch black :p

MadDeCoDeR commented 1 year ago

That's an expected warning and it shouldn't cause the issue you have.

MadDeCoDeR commented 1 year ago

Try to use the launch arguments +set r_debugcontext 3 +set logfile 1 and send me the log file

MadDeCoDeR commented 1 year ago

Associated with #94. Please check the latest nightly builds to see if the issue still persist

MadDeCoDeR commented 1 year ago

Just FYI. You can disable OpenGL DSA with the launch argument +set r_useopengldsa 0. It might worth a try

MadDeCoDeR commented 1 year ago

I believe the clamp error is fixed now you can check the latest nightly build

mmillar-bolis commented 10 months ago

Describe the Bug: Okay, this took me a bit to narrow down—actually, I accidentally triggered it the other day while writing up issue #134—anyway, I have figured out a set of steps to reproduce the bug, and how to alleviate it as well.

For some background, the only three renderer options I have for testing this in my autoexec.cfg are seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0. I start by removing any files or directories in my fs_savepath and then execute DoomBFA.exe. This creates the standard slew of files, including the renderprogs directory. Once the main menu is reached, I select the Doom 3 Campaign, skip the intro videos, and load into gameplay. To reiterate, no SSAO or HDR has been toggled on up to this point. The engine has only been launched while rendering stencil shadows. The game appears like Screenshot 1 below. Attached is a snapshot of my save directory up to this point:

pre-bug.zip

Now, here is where things get interesting! Next, I set these two rendering options, set r_useHDR 1; set r_useShadowMapping 1. As soon as I do, DBFAConfig.cfg and a bunch of lighting-related files in renderprogs/glsl & renderprogs/hlsl are touched and modified to reflect the change to shadow-mapping mode. At this time, the game appears like Screenshot 2 below.

To exhibit the lighting bug, I must first close and then re-execute DoomBFA.exe. When I do, autoexec.cfg runs and again issues seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0. No changes have occurred to the contents of renderprogs, however. Once the main menu is reached, I load the Doom 3 autosave into gameplay. At this time, the game appears like Screenshot 3 below. Attached is a snapshot of my save directory upon second run:

post-bug.zip

The game will continue to appear like Screenshot 3 for as many times as I close and re-execute DoomBFA.exe until I delete DBFAConfig.cfg from my save directory. It appears that when the program is launched without that file, a rebuild of renderprogs is triggered. Because my autoexec.cfg reflects seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0, the contents of renderprogs are remade with the exact same values as the pre-bug state. The game once again appears like Screenshot 1 below.

I couldn't reproduce this when leaving r_useSSAO 1, only when I started the process with it disabled. I also could not reproduce this when either toggling r_useShadowMapping or r_useHDR. I had to toggle both to produce the issue.

So it appears that there is some sort of problem with switching from shadow maps back to stencil mode, it's related to toggling HDR in some way, and it isn't exposed unless SSAO is off.

Apologies if I did not explain this well.

To Reproduce:

  1. Clear contents of fs_savepath.
  2. Run DoomBFA.exe with seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0.
  3. Load into gameplay, open the console and issue set r_useHDR 1; set r_useShadowMapping 1.
  4. Exit gameplay and close DoomBFA.exe.
  5. Re-run DoomBFA.exe and load into gameplay to exhibit lighting issue.
  6. Exit gameplay and close DoomBFA.exe.
  7. Delete DBFAConfig.cfg from fs_savepath.
  8. Re-run DoomBFA.exe and load into gameplay to exhibit lighting fix.

Screenshots: screenshot001 Screenshot 1 - Initial run with seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0

screenshot002 Screenshot 2 - Same initial run with seta r_useSSAO 0; seta r_useShadowMapping 1; seta r_useHDR 1

screenshot003 Screenshot 3 - Second run with seta r_useSSAO 0; seta r_useShadowMapping 0; seta r_useHDR 0

Desktop: OS: Windows 10 x64 (21H2) GPU: Nvidia GeForce RTX 2060 Version: Doom BFA 1.3.0 win-x64 Nov 16 2023 21:46:58 (Nightly build 697a71a)