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
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
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
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?
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
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)
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 -_-)
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`
- 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
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)
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
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
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
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! :)
"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
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)
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.
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