Commit graph

994 commits

Author SHA1 Message Date
Daniel Gibson
c44c0ffda4 bump version to 1.5.4rc3 2024-07-30 02:41:45 +02:00
Daniel Gibson
cef1178776 Allow Soft Particles for player-weapons after all, fix issue properly
The previous commit didn't fix the issue for the pistol and only was a
workaround anyway. So I reverted that and fixed the issue properly.

The underlying issue is that the particle's material sets the
texture matrix (with "translate" or "scale" or whatever), and the soft
particle rendering code (and shader) didn't take the texture matrix
into account.
Now it does, in a similar way as the interaction shader code.

Fixes https://github.com/dhewm/dhewm3-sdk/issues/36
2024-07-30 01:49:08 +02:00
Daniel Gibson
227071bb9a Don't use Soft Particles for particles at player-weapon
or at least if weaponDepthHack is set.

That somehow broke muzzle flash effects in Dentonmod, see
https://github.com/dhewm/dhewm3-sdk/issues/36
2024-07-29 17:59:38 +02:00
Daniel Gibson
b0d7c12404 Bump version to 1.5.4rc2 2024-07-29 02:57:04 +02:00
Daniel Gibson
a4f2d4ae55 Document +set fs_game_base in dhewm3 --help 2024-07-29 02:56:45 +02:00
Daniel Gibson
9c36d2f661 Mods menu: improve base and d3xp entries, set d3xp basemod for more mods
the base game entry is now called "Doom 3 (base game)" instead of
"dhewm3", which should be more obvious, and the d3xp entry now reads
"Resurrection Of Evil (d3xp)" instead of just "d3xp", which certainly
is clearer. d3xp now is also always second in the list (if installed)

Added the freshly supported perfected_roe and sikkmodd3xp mods to the
list of mods that need fs_game_base d3xp set, so they can be started
from the menu.

also added an entry for r_gammaInShader to Configuration.md
2024-07-27 22:11:59 +02:00
Daniel Gibson
4df8495d61 Document r_glDebugContext in Configuration.md; tiny fix in settings menu 2024-07-26 01:45:19 +02:00
Daniel Gibson
961b3f60bd Bump Version to 1.5.4rc1 2024-07-26 00:00:02 +02:00
Tom Kidd
ae6997aef5 On macOS, look for the game dylib in the app bundle 2024-07-25 06:09:25 +02:00
«BielBdeLuna»
b34c625798 added a easier material name for portal skies 2024-07-25 04:38:38 +02:00
Daniel Gibson
d3b2794c24
Merge pull request #578 from DanielGibson/soft-particles
Implement Soft Particles (and capturing depth buffer), based on old The Dark Mod code
2024-07-25 04:27:35 +02:00
Daniel Gibson
7e772f09d1 Update Changelog 2024-07-25 04:19:00 +02:00
Daniel Gibson
2e0b093c79 Soft particles: Disable Particle Stage "softeningRadius" keyword
this avoid breaking the game DLL ABI (framework/DeclParticle.h is part
of the SDK), and for now doesn't make a difference, because that keyword
was introduced by TDM and thus is only used in their particle defs.

When we break the game ABI/API anyway (probably for high FPS support),
this commit can just be reverted
2024-07-25 04:05:51 +02:00
Daniel Gibson
b86d2c587d A #define in draw_arb2.cpp to load soft particle shader from disk
by default it's still compiled into the executable
2024-07-25 03:24:20 +02:00
Daniel Gibson
c394fde58a CMake: Set -ffinite-math-only so math functions get inlined
if this is not set, using fminf() actually calls that libm function,
if it is set, a CPU instruction that calculates the minimum is generated
instead. likely similar for other functions.

not sure if this causes trouble anywhere, but I don't think we rely
on NaN or INF?
2024-07-25 03:24:20 +02:00
Daniel Gibson
ac6ec0cc45 Fix some typos 2024-07-25 03:24:20 +02:00
Daniel Gibson
724ab1727c Add settings for soft particles in menu, documentation, cleanups
r_skipDepthCapture is now called r_enableDepthCapture, and instead of
being a bool it's now an int with -1 meaning "enable if soft particles
are used"
2024-07-25 03:24:20 +02:00
Daniel Gibson
3c887d5af5 Integrate (working!) soft particle shader, clean up that code a bit
turned out the whole problem with soft particles what that the vertex
shader used vertex.attrib[8] instead of vertex.texcoord (and with
nvidia drivers those are equivalent)

I integrated the shader source into the c++ code so I don't have to
ship glprogs/soft_particles.vfp
2024-07-25 03:24:20 +02:00
Daniel Gibson
a407a6060f hack to draw softened particles without blending
so when the shader writes a debug value as a color,
I get to see that color
2024-07-25 03:24:20 +02:00
Daniel Gibson
580257b47e Make r_showDepth use currentDepthImage, unless r_skipDepthCapture is 1 2024-07-25 03:24:20 +02:00
Daniel Gibson
5ff59547a4 Make r_showDepth work
before it displayed the float values from the depth buffers as
byte-wise RGBA values, which looked weird and wasn't super helpful..

now it's displayed as luminance float (i.e. one float representing
greyscale), and transformed in the same way the TDM particle shader
transforms the depth values to doom units (and then scaled back to
0..1, with 1 representing 3000 units)
2024-07-25 03:24:20 +02:00
Daniel Gibson
69e121727d Add r_glDebugContext to enable OpenGL debug context and -callback
needs SDL2 and GL_ARB_debug_output
2024-07-25 03:24:20 +02:00
Daniel Gibson
47bd8afa91 Try to ensure currentDepthImage always uses NEAREST filtering
cleaner than only setting it in CopyDepthbuffer()
2024-07-25 03:24:20 +02:00
Daniel Gibson
6a3fa8c28a Fix depth buffer texture (for soft particle shader effects)
thanks to
https://community.khronos.org/t/cannot-read-from-depth-buffer-in-fs/76169/8

apparently the default doom3 texture filter was something using mipmaps,
which doesn't work so well for textures without mipmaps..
no idea why those two lines in idImage::CopyDepthbuffer() were commented
out, but they're needed (and also un-commented in TDM, I just missed
that when merging -_-)
2024-07-25 03:24:20 +02:00
Daniel Gibson
23627380dd some debug code for soft particles in RB_STD_T_RenderShaderPasses() 2024-07-25 03:24:20 +02:00
Daniel Gibson
41eef54611 Merge soft particles from thedarkmod 2.04
don't really work, though
2024-07-25 03:24:20 +02:00
Daniel Gibson
10eee1eb43 map command without any arguments prints current map name 2024-07-25 02:47:33 +02:00
Daniel Gibson
794d40a04c Add CVar r_vidRestartAlwaysFull
disables partial vid_restarts, hopefully works around issues like
https://github.com/dhewm/dhewm3/issues/587#issuecomment-2206937752

Note that resizing the window by dragging it does *not* call vid_restart
at all, so if you're having issues that are fixed by a full vid_restart
you should also set `r_windowResizable 0`
2024-07-25 02:47:25 +02:00
Daniel Gibson
b2ba15425c Hopefully fix screenshots on Wayland
- screenshots on native wayland (SDL_VIDEODRIVER=wayland) were black,
  at least on Gnome
  => fixed(?) by reading from the default (back) buffer instead of
     the front buffer
- after taking a screenshot, resizing the window (or switching to
  fullscreen) was broken (window remained black or became invisible
  or partly contained garbage), both with native wayland and xwayland
  => fixed by restoring the glReadBuffer state after reading the pixels
2024-07-25 02:47:07 +02:00
Daniel Gibson
5c7aacb954 Make fullscreen mode with XWayland a bit less broken, #587
assert( ret.width == glConfig.winWidth
        && ret.height == glConfig.winHeight );

in GLimp_GetCurState() triggered, because SDL_GetWindowSize(),
which was used to set glConfig.winWidth/Height in
GLimp_UpdateWindowSize(), returned different values than
SDL_GetWindowDisplayMode().
Now use SDL_GetWindowDisplayMode() in GLimp_UpdateWindowSize() so it's
at least consistent.

However it seems like SDL_GetWindowSize() returns the correct values
(IN THAT CASE), because with this change the mouse cursor doesn't work
that well (in the specific case described above).
In the end this is an SDL or Wayland bug or something, and I can only
recommend not using "real" fullscreen mode with Wayland, as it's fake
anyway (Wayland doesn't allow switching the display resolution, so
you get a magically scaled borderless fullscreen window at best)
2024-07-03 01:01:16 +02:00
Daniel Gibson
cec78b5a99
Merge pull request #576 from DanielGibson/imgui-rebased
Integrate Dear ImGui and implement a new settings menu with it and much more

also replaced zlib with miniz, HiDPI support, lots of new configuration options
2024-06-18 01:18:35 +02:00
Daniel Gibson
9eff1d9be2 Dhewm3SettingsMenu: Rework resolution/windowed/MSAA part of Video Options
Now the CVars are set immediately and "Apply" only does
`vid_restart partial`, while "Reset" resets the CVars to the values
that were set when opening the menu.
This also works the other way around: Changing a CVar (in the console
or other menu or r_fullscreen with Alt-Enter) is immediately reflected
in the menu.

Furthermore, "fullscreen desktop" now is its own setting (=> can be set
even if windowed mode is selected), to accommodate switchting between
windowed and fullscreen with Alt-Enter
2024-06-12 22:47:43 +02:00
Daniel Gibson
94738f1f16 Add glimpParms_t GLimp_GetCurState() to get current window state
it's queried from SDL so it should be up-to-date.
Using it in GLimp_SetScreenParms(), as it mostly did the same SDL calls
to get the current state for the partial vid_restart
2024-06-12 22:26:30 +02:00
Daniel Gibson
387430a01f Fix vid_restart partial for real fullscreen mode 2024-06-11 19:03:54 +02:00
Daniel Gibson
c096a86ce8 Fix toggling fullscreen mode with vid_restart partial, esp for Alt-Enter
Toggling with Alt-Enter relies on idRenderSystem::IsFullScreen() which
returns glConfig.isFullscreen

That can only work if GLimp_SetScreenParms() actually sets
glConfig.isFullscreen

Thanks j4reporting for reporting this! :)
2024-06-11 18:32:35 +02:00
Daniel Gibson
44d19a4175 Implement GLimp_SetScreenParms() for "vid_restart partial"
"vid_restart partial" only changes the window size or its fullscreen
(or windowed) state, without recreating everything.
If that fails (or antialiasing settings have changed), it will fall back
to a full vid_restart (this behavior is different than original
 "vid_restart partial" that probably was implemented in Vanilla Doom3
 but not dhewm3)

This is used for Alt-Enter (which toggles between fullscreen and
windowed state) and when pressing the Apply button in the new Video Menu
2024-06-11 16:45:34 +02:00
Daniel Gibson
ac8eec932b Add r_windowResizable to configure if window is resizable
incl. setting in SettingsMenu

With SDL 2.0.5 and newer this change is applied immediately,
2.0.0 to 2.0.4 need a vid_restart
(with SDL1.2 we don't support it at all)
2024-06-08 11:39:21 +02:00
Daniel Gibson
a6870cabfc minizconf.h: (hopefully) fix MinGW compatibility of z_off64_t 2024-06-08 10:44:02 +02:00
Daniel Gibson
ab676878b9 Make dhewm3 window resizable (when using SDL2)
is this really all that's needed?!
2024-06-07 20:51:22 +02:00
Daniel Gibson
28b753d50b Fix crash in Dhewm3SettingsMenu after switching fullscreen w/ Alt-Enter
Seems like calling ImGui::CalcTextSize() is only safe after
(or at the end of) NewFrame()
2024-06-07 13:39:51 +02:00
Daniel Gibson
cff73ff591 Dhewm3SettingsMenu: Remove testing printfs 2024-06-07 11:53:04 +02:00
Daniel Gibson
49ed8ec439 Adjust imgui_savestyle.cpp for 1.90.8
ImGuiDir now is a proper enum, not just a typedef of int that happens
to have a similar name to the actual enum
2024-06-06 20:07:30 +02:00
Daniel Gibson
863dc48ff4 Update Dear ImGui to 1.90.8 2024-06-06 20:05:54 +02:00
Daniel Gibson
e8b8f5c02d Always optimize code of some integrated libraries, even in Debug builds
the stb libs, miniz and minizip are now always optimized to speed up
performance, esp. level loading times, in debug builds.

So far the stb libs implementation were dragged into the source file
that uses them, now I created additional source files just for them so
those can be optimized while the engine source files using those libs
can remain unoptimized in debug builds.
2024-06-05 21:40:59 +02:00
Daniel Gibson
af34aba577 ImGui: Apply patch from upstream that fixes tooltips of disabled buttons
Upstream commit: "Disabled: nested tooltips or other non-child window
 within a BeginDisabled() block disable the disabled state. (#211, #7640)"

Should be in the next Dear ImGui release
2024-06-05 16:58:12 +02:00
Daniel Gibson
ab5d590b6f Update Changelog, mention new settings menu in Readme 2024-06-04 12:40:43 +02:00
Daniel Gibson
51270dd390 Store imgui.ini and user.imstyle in dhewm3 config dir instead of $PWD 2024-06-04 10:52:30 +02:00
Daniel Gibson
81d912ab4b Give Dhewm3SettingsMenu a sane default size and position 2024-06-04 10:32:28 +02:00
Daniel Gibson
c317e604c6 Improve minizconf.h; in CMake, don't use C++-compilerflags for plain C 2024-06-04 09:30:54 +02:00
Daniel Gibson
1b344d4b78 Replace zlib with integrated miniz
using amalgamated miniz 3.0.2 from https://github.com/richgel999/miniz
and minizconf.h from Yamagi Quake II:
https://github.com/yquake2/yquake2/blob/master/src/common/unzip/miniz/minizconf.h
2024-06-03 22:02:56 +02:00