Commit graph

513 commits

Author SHA1 Message Date
myT
f8567ecba0 added world shader tracing 2023-11-12 01:32:59 +01:00
myT
3b6a3a5019 added D3D12 rendering and removed D3D11, GL2, GL3
don't track .user files except for cnq3 and cnq3-server

disabled FPS hack

disabled FPS hack, part 2
2023-11-12 01:32:58 +01:00
myT
1dca257c9d format float CVars without trailing zeroes 2023-10-30 21:46:55 +01:00
myT
609e11f11d fixed drop errors when opening demos in subdirectories on Linux 2023-09-29 22:47:32 +02:00
myT
b60db6b1f0 updated version and date for 1.53 release 2023-09-20 23:11:20 +02:00
myT
23ce3e0982 added NDP server pause tracking and improved command sequence handling 2023-08-08 02:05:42 +02:00
myT
db25062b05 fixed NDP vid_restart fatal errors when demo file names contain spaces 2023-08-08 02:05:11 +02:00
myT
a202404d16 only run the main thread on P-cores 2023-08-02 18:11:36 +02:00
myT
9e19d22d46 added /registerdemos and /unregisterdemos 2023-08-02 02:43:31 +02:00
myT
b3480c7129 fixed crashes due to bad shader stage collapse data 2023-07-29 04:53:18 +02:00
myT
c8e1eb546f added r_teleporterFlash 2023-07-03 03:44:06 +02:00
myT
5b591f270d fixed GL2 portal clip plane not being used 2023-05-30 19:51:06 +02:00
myT
815b8d0c02 fixed texel offset in the CPU mip-map generator 2023-05-30 19:49:55 +02:00
myT
3960c7d32e fixed NDP executing end-of-demo commands when starting playback 2023-05-22 02:16:56 +02:00
myT
9f32a13f05 fixed video recording issues with long demo file names 2023-04-30 00:55:55 +02:00
myT
ab44152713 tweaked NDP behavior for beta 2
- more accurate seeking to enable scrubbing
- rate-limiting is now the mod's reponsability
- using the same FULL_SNAPSHOT_INTERVAL in all builds to make bugs less difficult to track
2023-04-04 22:52:16 +02:00
myT
8ed8d26481 removed the R_SetPVSCulling extension
reverted 7e0de354c2
the mod can feed a different area mask to force drawing everything
2023-04-04 22:42:24 +02:00
myT
c75b2b27fa fixed invalid skybox texture mip/filter settings 2023-03-02 18:57:49 +01:00
myT
693415a6e2 added .wav files to the pure client read exception list 2023-03-01 02:43:28 +01:00
myT
7e0de354c2 added the R_SetPVSCulling extension 2023-02-25 23:01:11 +01:00
myT
ec95faad1b fixed the RB_CalcDiffuseColor color array offset 2023-02-24 04:43:48 +01:00
myT
cae492053f CVar sets always use all arguments 2022-12-28 14:37:30 +01:00
myT
608b223f52 can set the "dedicated" CVar from the command-line again 2022-12-28 04:10:24 +01:00
myT
ebfa9346b2 added s_khz
defaulting to 22.05 KHz on Windows again due to (presumably) chipset/driver issues
chipsets involved: Realtek ALC887, Realtek ALC892
2022-12-27 20:40:03 +01:00
myT
e64de08ef2 printing WSAEWOULDBLOCK on recvfrom is far too verbose 2022-12-27 19:18:17 +01:00
myT
15bea75d06 fixed new demo player not always writing to all entities in a snapshot 2022-12-27 04:20:56 +01:00
myT
b36fce3234 fixed multiple instances of variable shadowing 2022-12-26 22:08:46 +01:00
myT
cb38533de5 invertedpenguin: replaced the shader of the blood pool behind RA 2022-12-13 05:10:57 +01:00
myT
3c8cb0f592 simplified R_ImageList_f 2022-12-11 19:13:33 +01:00
myT
3e18b2d0e1 forcing the nopicmip flag on specific texture folders
for now: "textures/npmenv" and "textures/npmpads"
2022-12-11 19:12:40 +01:00
myT
6b9d35df8c fixed /imageinfo and /shadermixeduse 2022-12-11 19:09:34 +01:00
myT
952da7c009 added the -f option to /writeconfig 2022-12-05 21:07:06 +01:00
myT
a7e87a065b fixed the reported selected MSAA sample counts for GL2/GL3 2022-12-04 01:02:37 +01:00
myT
69c1bee127 simplified and improved r_vertexLight handling 2022-12-03 04:57:58 +01:00
myT
5e0739fdf9 preventing unnecessary work when g_forcedLoadImages gets larger 2022-11-25 05:45:04 +01:00
myT
b8d9f7e5f1 fixed the default strategy for D3D11 buffer offsets 2022-11-25 05:39:52 +01:00
myT
cfdba32b24 added /imageinfo and /shadermixeduse 2022-11-25 03:32:41 +01:00
myT
d43a016e61 improved mark mode's end key handling of white space 2022-11-23 20:42:54 +01:00
myT
b517f56959 only print warnings for excessive sound loads with /developer 1 2022-11-22 22:19:35 +01:00
myT
f7a1d6655e fixed invalid printf argument lists
the CL_AddKeyUpCommands case was quite peculiar:
"time" wasn't a variable but the standard C library function
2022-11-22 20:34:46 +01:00
myT
79b2457783 added printf annotations for VC++'s analyzer 2022-11-22 20:20:45 +01:00
myT
a7a233699e bots can no longer get timed out
this was just annoying when testing things
one less CVar to remember and set...
2022-11-06 02:36:15 +01:00
myT
af52b71e03 fixed the void argument list in DEF_TRAP_0 to help catch mistakes 2022-11-05 05:01:17 +01:00
myT
ea435faf1f added a legend to clarify the output of /shaderlist 2022-11-04 23:16:33 +01:00
myT
0be40a60a7 the new demo player now has smoother animations at low time scales 2022-11-04 05:06:38 +01:00
myT
f401f742ee added a new demo player with fast seeking support
added cl_demoPlayer and cl_escapeAbortsDemo
2022-11-04 05:01:00 +01:00
myT
9f90a6ee8b added Sys_IsDebuggerAttached and Q_assert 2022-11-04 04:46:04 +01:00
myT
6dbf731973 improved the VM argument type conversion shim 2022-11-04 04:40:23 +01:00
myT
439177057c fixed FS_FileForHandle's range check 2022-11-04 04:36:05 +01:00
myT
2fd422c053 let the mod handle syscall fix-ups in a unified way across build types 2022-10-28 23:39:05 +02:00
myT
03ae2d0d05 removed a lot of unused code 2022-10-28 23:32:27 +02:00
myT
be0746dfc4 fixed read-only CVar registration keeping the existing value 2022-10-23 05:23:27 +02:00
myT
c8c9bef131 added r_depthClamp and cap_DepthClamp 2022-10-23 02:58:20 +02:00
myT
74acd92d91 fixed the D3D projection transform not matching GL 2022-10-18 19:09:14 +02:00
myT
1b74aed8b9 removed the useless myftol macro 2022-06-17 03:38:39 +02:00
myT
9895f3b895 fixed RB_RenderLitSurfList still crashing because of an invalid stage index
the first attempt was f99c223495
this is really not a proper fix since I haven't solved how it gets to that stage
but, knowing I will be deleting this whole part of the code soon enough anyway...
2022-06-17 03:26:36 +02:00
myT
928c9a71ec added a clang-format config for use with new source files 2022-06-17 02:00:41 +02:00
myT
3dc34d47f3 replaced the CPU image resampling functions with something better 2022-06-17 01:59:56 +02:00
myT
0ee2a50e90 image read/write errors print warnings instead of causing drop errors 2022-06-17 01:53:32 +02:00
myT
2389b5db39 updated stb_image.h 2022-06-17 01:46:01 +02:00
myT
2aa92b3cde a better way to deal with Clang's vexing parse warning 2022-06-01 03:53:52 +02:00
myT
e56a11b638 added /shaderinfo 2022-05-28 16:50:42 +02:00
myT
049793f8f9 made some expression more legible as originally intended
the code is equivalent since && has higher precedence than ||
in other words, I messed up but got it right by sheer luck
2022-05-26 23:12:02 +02:00
myT
75f0635f3f fixed /video writing incorrect audio stream lengths to the AVI file headers 2022-05-26 22:52:25 +02:00
myT
928a8df74a fixed a potential 1-byte buffer overflow in CL_ServerInfoPacket 2022-05-26 22:29:00 +02:00
myT
dcb3c80998 added default to a switch statement to make it clear we didn't forget any case 2022-05-26 22:25:25 +02:00
myT
96e4d2d7cb added a couple of explicit casts for Clang to keep quiet 2022-05-26 22:23:50 +02:00
myT
4b131f258c no longer checking whether unsigned integers are negative... 2022-05-26 22:22:45 +02:00
myT
15d457adb0 no longer letting Clang complain about the size of an empty struct 2022-05-26 22:20:58 +02:00
myT
8e563d6c4a fixed Info_Print crashing when a token is too long
too long being >= 512 but < BIG_INFO_KEY/BIG_INFO_VALUE
Info_NextPair will still crash when key/value string lengths exceed BIG_INFO_KEY/BIG_INFO_VALUE
2022-05-26 17:22:20 +02:00
myT
bf0c8ec492 using an updated icon courtesy of deft 2022-05-04 18:28:57 +02:00
myT
83284b15c5 resetting the search line index when clearing the console 2022-04-30 18:53:36 +02:00
myT
533e0872c1 added console mark mode 2022-04-30 04:03:47 +02:00
myT
3f189e58be added console search 2022-04-29 21:18:50 +02:00
myT
866b93ef5e turned r_showtris and r_shownormals into bitmasks 2022-04-29 21:12:01 +02:00
myT
a12cf70700 fixed the r_mapGreyscaleCTF shader list
removed duplicates
fixed the q3wcp14 asymmetry
2022-04-29 21:04:45 +02:00
myT
4670a811c1 added r_ignoreShaderSortKey as a work-around for broken maps 2022-04-24 22:44:25 +02:00
myT
b8fd6e7c64 added the net_printoverhead and net_clearoverhead dev functions 2022-04-24 22:40:01 +02:00
myT
8c32b986f6 added r_mapGreyscale and r_mapGreyscaleCTF 2022-04-23 23:38:06 +02:00
myT
178d91b000 removed the nextmap CVar 2022-04-22 23:30:24 +02:00
myT
f99c223495 fixed crashes when a DL affects a transparent surface with r_lightmap 1 2022-04-14 00:37:00 +02:00
myT
a47c8c8dd1 added net_proxy 2022-04-12 04:31:03 +02:00
myT
1544a61cfc added waitms 2022-04-12 04:18:32 +02:00
myT
9e445bc284 fixed vertex lighting applying to non-lightmapped surfaces 2022-04-12 04:12:38 +02:00
myT
51863892f0 no longer denying looping sounds
this is mostly undoing e50a60fe17
and warning when delayed loads happen in quick succession

with this change:
- we no longer block legit looping sounds like the RG hum
- we only warn when there are too many loads instead of spamming for legit stuff
2022-04-11 00:40:27 +02:00
myT
dbfb3c5028 fixed delayed shader loads leading to incorrect rendering and crashes (dynamic lights) 2022-04-10 22:14:19 +02:00
myT
981f059b7b do not replace older surfaces with newer ones but refuse to add new ones instead
surfaces added first are part of the map itself
it's better to drop e.g. some plasma cells rather than e.g. entire walls
it's also less error-prone to work with since we don't need to fix numbers on read
but only check on write in exactly 2 spots

also removed tr.shiftedEntityNum because it was unnecessary...
2022-04-10 21:45:59 +02:00
myT
1317ce54cb added Sys_DebugPrintf 2022-04-10 21:24:36 +02:00
myT
fa1cee73e0 fixed CL_NextDemo not being called after a drop error or fopen failing 2022-04-09 03:50:16 +02:00
myT
9b114e7886 fixed music playback crash in CPMA credits with s_musicvolume > 0 2022-04-08 21:41:26 +02:00
myT
7923a0a94e fixed a Linux/FreeBSD start-up crash 2022-04-08 21:29:19 +02:00
myT
c534ed8048 fixed the alpha channel blend factors in the D3D11 backend 2020-11-06 02:48:55 +01:00
myT
c12f7e8541 removed a redundant if statement 2020-11-05 03:55:37 +01:00
myT
b1df6ac8f7 added new stats to r_speeds 1 (shader changes, draw calls) 2020-11-05 03:50:58 +01:00
myT
f4e8e81ab5 fixed draw surface sorting
got broken with commit 633c5bd13c
2020-11-05 03:47:55 +01:00
myT
3e0f5b2760 fixed RB_CalcTurbulentTexCoords by using the correct vertex offset
it got broken with db4fb31658
2020-10-27 00:30:13 +01:00
myT
55ed0e80af r_lightmap 1 now handles most alpha-tested surfaces 2020-10-20 01:55:53 +02:00
myT
7262b90655 no longer whining about mixed image settings with external lightmap atlases 2020-10-15 05:25:51 +02:00
myT
e50a60fe17 sound loads during gameplay print warnings and get denied for looping sounds 2020-10-15 05:07:55 +02:00
myT
bb9e814837 throwing a fatal error when com_soundMegs is too low for a map load 2020-10-15 05:04:01 +02:00
myT
a4397252c3 com_soundMegs now defaults to 16 2020-10-15 04:48:41 +02:00
myT
ad2d3386a6 D3D11 now does depth clipping and the near clip plane distance is now 1 2020-10-11 18:24:35 +02:00
myT
45f66b1a88 added sys_compiler and sys_cplusplus to embed build information 2020-10-11 02:27:27 +02:00
myT
e0b04b55c3 cl_aviFrameRate now defaults to 60 2020-10-09 04:57:02 +02:00
myT
0af1422190 Windows audio output device sampling rate is now 44.1 kHz 2020-10-09 04:51:21 +02:00
myT
8adf87e7c7 fixed .avi files starting with silence when not first in the sequence 2020-10-09 04:28:37 +02:00
myT
dea818a260 fixed a D3D11 resource hazard warning about depth/stencil buffer bindings
swapped the calls back so that the depth buffer is never bound as both a RT and SRV at the same time
2020-10-09 04:01:26 +02:00
myT
6f7d4892df added detailed live objects reporting for full shutdowns in D3D11 debug
the name tweaks are there because the run-time erroneously reports this warning:
"Existing private data of same name with different size found!"
2020-10-09 01:22:04 +02:00
myT
5466b65735 caching the pixel shader resource views in D3D11 2020-10-08 04:50:32 +02:00
myT
249bcb2d07 caching the current active texture slot in GL3
it reduces the total number of API calls by a good amount
2020-10-08 04:45:33 +02:00
myT
2aaf17b061 fixed the GL3 debug uniform location check
it would incorrectly trigger with r_alphaToCoverage 1 and r_msaa 0
2020-10-08 04:19:20 +02:00
myT
633c5bd13c tweaked the draw surface sort key for better performance
it minimizes depth fade <-> generic pipeline transitions
2020-10-08 04:08:38 +02:00
myT
78cf275a62 fixed depth fade with MSAA in the GL3 backend 2020-10-08 03:55:40 +02:00
myT
427172edcf fixed D3D11 device resets being sometimes treated as fatal errors
after getting DXGI_ERROR_DEVICE_REMOVED or D3DDDIERR_DEVICEREMOVED,
GetDeviceRemovedReason can return DXGI_ERROR_DEVICE_RESET
this particular case should trigger a video restart instead of a fatal error
2020-07-07 09:07:53 +02:00
myT
49028a3f36 simplified the new D3D11 partial clear code to not needlessly change primitive topology 2020-07-07 04:44:31 +02:00
myT
a5c820644a CVar slots that have been freed can now be allocated again 2020-07-07 04:25:21 +02:00
myT
7412c4b373 added r_alphaToCoverageMipBoost and did some other changes to A2C
- r_alphaToCoverageMipBoost scales the alpha value based on the current texture LoD
  this prevents the "fading with distance" effect
- mip 0 dimensions are tested to decide whether contrast boosting around 0.5 is enabled
  this is to deal with high r_picmip configs
- improved algorithm for excellent sharpness and minimized temporal artefacts
- GLSL 4.00 is required for the GL3 backend to use A2C (for textureQueryLod)
2020-07-07 03:49:52 +02:00
myT
180a0187b7 fixed the R_AddWorldSurface optimization so it won't remove the sky 2020-06-20 03:04:00 +02:00
myT
70ba2e7939 fixed and improved GL3 shader uniforms caching 2020-06-20 02:28:55 +02:00
myT
6fcabd83b7 fixed D3D11 partial render target clears
viewport/scissor settings do NOT apply to:
- ClearDepthStencilView
- ClearRenderTargetView

hence this fix
2020-06-18 04:19:34 +02:00
myT
05d92ab6f0 1.52 release 2020-06-01 21:08:56 +02:00
myT
54ee6436fe updated copyright years 2020-06-01 20:28:44 +02:00
myT
178a61b953 fixed r_mode 1 issues with the D3D11 backend (screenshots and scissor rects)
the issues were:
- screenshots were black because of mismatched dimensions in the CopyResource call
- display was showing garbage because the scissor rect was too large
2020-05-11 20:07:29 +02:00
myT
f484ee94a7 fixed alpha to coverage for the greater than 0 alpha test 2020-05-09 17:11:47 +02:00
myT
d6f77a9b35 fixed crashes due to render command list overflows
also increased the buffer's size (e.g. to draw all chars in the console in 4K)

one of the crashes happens in R_SortDrawSurfs:
-> render command list is too full
-> RE_EndFrame returns early because it can't allocate RC_SWAP_BUFFERS
-> R_ClearFrame in RE_EndFrame doesn't get called
-> the next frame starts with r_firstSceneDrawSurf etc. not being reset to 0
-> r_firstSceneDrawSurf becomes really close to the maximum draw surface limit
-> the draw surface list is iterated incorrectly (no wrapping handled)
-> we fetch a draw surface we shouldn't
-> its sort key gets decoded and we get an invalid sorted shader index
-> we fetch a NULL shader at that index location
-> we attempt to read shader->sort
-> we crash reading address 76
-> 76 bytes is exactly the offset of the sort member into the shader_t struct
2020-05-08 03:38:26 +02:00
myT
1cf28d87fe r_speeds is no longer cheat-protected 2020-04-28 17:20:02 +02:00
myT
1994475982 renamed r_noiseScale to r_ditherStrength for consistency 2020-04-28 17:04:43 +02:00
myT
718b966414 depth fade fixes and improvements
- renamed r_softSprites to r_depthFade
  the term's more descriptive and it helps that UE4 uses it
- fixed the GL3 fragment shader halving the depth bias
- fixed the D3D11 pixel shader only fetching depth sample 0
  not fixed for GL3 yet, see the code comments for that
- added support for more blend states
- added the q3map_cnq3_depthFade general shader directive
2020-04-26 16:32:51 +02:00
myT
a59875200c fixed the D3D11 back-end sometimes colorizing mip level 0 with r_gpuMipGen 1 and r_colorMipLevels 0
it happened because the color channels for blendColor weren't initialized,
that memory could have at least one channel initialized as a NaN value and
throwing a NaN in the shader logic would break it
2020-04-16 05:24:11 +02:00
myT
a5e28eb08f added r_transpSort and we can now sort all surface types by depth
also fixed up RE_AddPolyToScene's overflow check
2020-04-16 05:01:48 +02:00
myT
0fcd462244 improved the map download initiation logic and updated the CNQ3 map server addresses 2020-04-06 03:46:14 +02:00
myT
4e9d0ad709 fixed the soft sprite status console print always saying it's "ON" with GL3 and D3D11 2020-04-05 06:40:34 +02:00
myT
a5b6ee33da made more keys bindable on Linux/FreeBSD and /bind now accepts uppercase hex digits 2020-04-04 03:20:03 +02:00
myT
d5984db690 removed r_nobind and r_showImages, wrote help etc. for the renderer's other temp/cheat CVars 2020-04-02 05:06:00 +02:00
myT
546296e6ef fixed r_showsky and cleaned up the related GAL code 2020-04-02 04:50:12 +02:00
myT
24e6cd9277 GL3 can now print shader compile/link warnings even when successful with r_verbose 1 2020-04-02 04:40:12 +02:00
myT
e013893c1b fixed GL3 generic program link issue due to variable type qualifier mismatches (centroid vs not)
this problem proved fatal on some Intel drivers
2020-04-02 04:37:03 +02:00
myT
9e061c4aff increased the small zone's size 2020-03-30 03:55:21 +02:00
myT
89aca4069e now fixing up the CVar hash table in Cvar_Nuke 2020-03-30 03:09:25 +02:00
myT
ae30c5a311 r_mapBrightness can now be used with r_fullbright for lightmapped surfaces 2020-02-27 05:26:19 +01:00
myT
69d6cdf42b fixed r_detailTextures 0 messing up shaders 2020-02-27 05:22:06 +01:00
myT
f773d2a783 fixed dynamic light face culling using the untransformed (world-space) light position 2020-02-26 23:01:28 +01:00
myT
7b01f8b8d3 fixed a bunch of variable shadowing cases and removed unused variables 2020-02-24 01:52:29 +01:00
myT
36f363b47a D3D11 tweaks, added r_d3d11_presentMode, removed r_d3d11_maxQueuedFrames
the D3D11 tweaks:
- better error message formatting
- D3DDDIERR_DEVICEREMOVED from Present is a fatal error too
- synchronized offsets is always the automatic behavior for now
  it turns out that split mode isn't always the fastest for nVidia
2020-02-24 01:48:43 +01:00
myT
85583acc9c dynamic lights apply to even more surfaces and have a nicer fall-off
- ditched vertex colors (not wanted) and alpha tests (not needed) in the shaders
- using a Bezier fall-off to get much softer edges
- added no-depth-write transparent surfaces support by adjusting the depth test
- multiplying the diffuse texture's color by its alpha in non-opaque passes
- fixed triangle rejection based on cull type and normal direction
- reflecting normals in shaders to support two-sided surfaces
- rejecting surfaces with no diffuse stage or bad blend states as early as possible
- liquids get lit weaker than other surfaces
2020-02-21 08:26:12 +01:00
myT
8ef496d22b reverting to old code for .tga image decoding, but with tweaks and fixes
the problem is that stb_image can and will allocate much more than it needs to
e.g. for a 2048x2048 BGR image:
it allocates an unnecessary intermediate 12 MB buffer to decode the image
instead of decoding it directly into the final 16 MB RGBA buffer

the old CNQ3 code didn't decode greyscale properly because of a missing macro call
it also didn't range-check memory accesses at all
2020-02-18 04:42:28 +01:00
myT
8a1d1c539b Escape down in cgame triggers CG_EVENT_HANDLING again instead of CG_KEY_EVENT
with that, CPMA demo playback and /protect work as intended again
2020-02-09 04:25:31 +01:00
myT
ca9757082f r_colorMipLevels disables MSAA when centroid sampling would be used
this is because it would draw (parts of) geometric edges with different colors and that makes visual inspections annoying
also, final MSAA sample counts are always reported by GL3 and GL2 now
2020-02-05 03:43:19 +01:00
myT
c72c8d5ad7 fixed r_fastsky handling in the GL3 renderer back-end 2020-01-19 22:38:35 +01:00
myT
01ce4063b5 added r_lightmapGreyscale
thanks to Jakub 'kubaxvx' Matraszek for his contribution
2020-01-12 23:03:54 +01:00