Commit Graph

96 Commits

Author SHA1 Message Date
Alibek Omarov
5b6b372cfe ref: gl: drop broken minlight/scale cvars for litwater. Keep them for mods. Fix post-merge issues 2026-04-28 11:21:56 +05:00
Alibek Omarov
2f31cf315c ref: gl: add litwater support 2026-04-28 11:12:44 +05:00
Alibek Omarov
22391eba1b engine: handle swapping sequence files in LoadCacheFile for games with external StudioModelRenderer 2026-04-26 04:12:52 +05:00
Alibek Omarov
044523434d ref: add R_EntityDynamicLight that calculates lighting for studio and alias models, and also located in libref_common 2026-04-19 01:17:28 +05:00
Alibek Omarov
74869c8f5d ref: make R_GatherPlayerLight shared between renderers 2026-04-14 22:36:15 +05:00
Alibek Omarov
c63e13c8f4 engine: move handling of AVI textures into the engine 2026-04-14 22:36:15 +05:00
Alibek Omarov
e2e4728c7c engine: remove R_BeamCull from RefAPI 2026-04-14 22:36:15 +05:00
Alibek Omarov
dd3583d11a engine: move details textures parser to the engine 2026-04-14 21:18:57 +05:00
Alibek Omarov
a49db03561 engine: move StudioAPI negotiation to the engine 2026-04-14 21:18:03 +05:00
Alibek Omarov
9b24b08df1 ref: gl: remove onlyClientDraw, drawOrtho, RI.params with viewpass flag check. RF_DRAW_OVERVIEW and RF_DRAW_CUBEMAP are cannot be set at the same time, so drawOrtho check replaced by RF_DRAW_CUBEMAP only 2026-04-13 23:13:49 +05:00
Alibek Omarov
3440ddf443 ref: gl: read ref_viewpass_t flags instead of cached RI.drawWorld 2026-04-13 23:13:49 +05:00
Alibek Omarov
fdd3a44fa0 ref: gl: remove unused isSkyVisible 2026-04-13 23:13:49 +05:00
Alibek Omarov
148a9a5a8c ref: gl: replace RI.{vieworg,viewangles,pvsorigin} by ref_viewpass_t fields 2026-04-13 23:13:49 +05:00
Alibek Omarov
1009795d5c ref: gl: save original viewpass and access viewport and fov through it 2026-04-13 23:13:49 +05:00
Alibek Omarov
ff3a57ae8a ref: gl: drop legacy mirror viewpass code 2026-04-13 23:13:49 +05:00
Alibek Omarov
7324ff43fc ref: add GL_ResampleTexture to libref_common 2026-04-13 13:01:18 +05:00
Alibek Omarov
d85e7fc2b1 ref: move remaining light functions to libref_common 2026-04-13 13:01:18 +05:00
Alibek Omarov
5aca78951c ref: move R_PushDlights and R_MarkLights to ref_common 2026-04-13 13:01:18 +05:00
Alibek Omarov
81abae65b5 ref: move RunLightstyles to ref_common 2026-04-13 13:01:18 +05:00
Alibek Omarov
f5f6d9bbe4 engine: move sprite texture loading back to engine, only leave rendering for renderer 2026-04-13 13:01:18 +05:00
Alibek Omarov
ef73b55413 ref: common: move malloc and GL_InitRandomTable 2026-04-13 13:01:18 +05:00
Alibek Omarov
8334695522 ref: common: draft new static library, containing shared code for ref_gl and ref_soft 2026-04-13 13:01:18 +05:00
Alibek Omarov
d7f416d659 engine: draft new RefAPI 14: remove reserved functions from render api, remove CL_AddCustomBeam 2026-04-13 13:01:18 +05:00
Alibek Omarov
055d646225 ref: gl: merge refactoring changes from litwater branch 2026-04-09 11:43:47 +05:00
Alibek Omarov
abda0a07c2 ref: gl: cache worldmodel pointer instead of accessing it through gp_cl pointer 2026-04-06 11:07:08 +05:00
Alibek Omarov
02b1d15e42 ref: gl: add gl_polyoffset_bmodels to enable poly offset for drawing brush models, avoiding zfighting 2026-03-27 03:27:20 +05:00
Alibek Omarov
00ad05c92a ref: gl: move showtextures implementation to gl_image.c 2026-03-17 00:19:27 +05:00
Alibek Omarov
50147a3d48 common: replace HLSDK pmtrace.h and pm_movevars.h by it's QW counterparts 2026-02-26 10:29:09 +05:00
Alibek Omarov
c63c0ba04b ref: minor refactoring 2026-02-23 21:46:01 +05:00
lewa_j
5cdb58431a engine: ref: Remove unused declarations, fix comment after rename 2026-01-13 03:41:19 +03:00
Alibek Omarov
4dabb5d1f9 ref: gl: implement rotation for 2D 2025-10-19 06:25:43 +05:00
Alibek Omarov
7a02110a42 ref: gl: fix out of bounds access
On GPUs where GL_ARB_shading_language_100 isn't available (i.e. all mobile GPUs
I believe) this function would return total amount of texture units available.

But ref_gl only tracks and uses MAX_TEXTURE_UNITS texture units, causing memory
corruption in functions that doesn't check the limit.
2025-10-17 09:19:23 +05:00
Alibek Omarov
d039a08b4e ref: gl: fix up data types. Engine TMU type is int, rather than GLint, and texture indices are technically unsigned int only (and they aren't GLenum) 2025-09-06 01:57:36 +05:00
Alibek Omarov
699e178f62 ref: gl: remove excessive ASSERT macro, use Assert everywhere 2025-09-06 00:41:48 +05:00
Alibek Omarov
b5cb0b9f10 ref: gl: add r_dlight_virtual_radius. It potentially fixes ugly dlight cut off on largely scaled textures (or at least allows to tune it)
It also adds a fix found in JoeQuake (which traces back to FitzQuake, in which
it is attributed to LadyHavoc, Darkplaces author) to exactly calculate whether
the light hits the surface, so we don't wrongly enable lighting on a surface by
an increased radius.
2025-02-07 23:07:08 +03:00
Alibek Omarov
a955d1e957 ref: gl: make GL_BuildPolygonFromSurface static, remove one global variable usage (which is unused anyway) 2025-02-07 22:55:38 +03:00
Alibek Omarov
3ebcb08a97 ref: gl: add cvar r_large_lightmaps to enable larger lightmap sizes, opt-in, yields better performance with VBO renderer 2025-02-05 13:02:37 +03:00
Alibek Omarov
77abf621d7 ref: gl: make GL_Support and GL_MaxTextureUnits functions inlined 2025-01-30 19:02:53 +03:00
Alibek Omarov
0e27d8717c ref: remove servercount from texture struct, Xash don't use it (and it's also harmful anyway) 2025-01-21 14:36:42 +03:00
Alibek Omarov
c906aa0106 ref: gl: make DrawGLPoly and R_TextureAnimation private to brush rendering code 2025-01-18 08:39:31 +03:00
Alibek Omarov
0a41b70e44 ref: gl: store ripple texture in texture's fb_texturenum as it's only used for water and water don't have luma 2025-01-18 08:38:43 +03:00
Alibek Omarov
c6e3146290 ref: gl: fix broken water texture when it was discarded by R_UploadRipples 2024-12-26 03:49:12 +03:00
Alibek Omarov
4d1119391a ref: gl: get rid of NULL sentinels at the end of arrays 2024-12-22 07:11:28 +03:00
SNMetamorph
9244bdc7db ref: gl: added gl_fog cvar for better GoldSrc compatibility 2024-11-21 23:11:53 +03:00
Alibek Omarov
d15949d2e8 Rename _format to FORMAT_CHECK 2024-11-07 14:24:07 +03:00
Alibek Omarov
4d003bc13f ref: remove Mod_LoadMapSprite from RefAPI 2024-11-03 02:59:44 +03:00
Alibek Omarov
6cd2dbf178 engine: remove R_DrawTileClear from RefAPI 2024-11-03 02:21:38 +03:00
Alibek Omarov
6153d7f168 engine: make CL_RunLightStyles accept lightstyles array pointer as an argument. Make necessary changes in renderers. 2024-11-03 01:20:30 +03:00
Alibek Omarov
bb4e64ea58 ref: gl: migrate to new way to get lightstyles and dlights 2024-11-03 01:20:30 +03:00
Alibek Omarov
8af995cc28 engine: introduce REF_GET_*_PTR for gamma tables 2024-11-03 01:20:30 +03:00