2
0
mirror of https://github.com/FWGS/xash3d-fwgs synced 2024-11-22 09:56:22 +01:00
Commit Graph

315 Commits

Author SHA1 Message Date
901b35d4b1 ref: soft: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view) 2024-01-27 17:31:34 +03:00
eaafd0ff13 ref: gl: rework @SNMetamorph's fix for avoiding crash when no world is set (like Customize menu with enabled 3D view) 2024-01-27 17:31:26 +03:00
963d9b8f2a ref: soft: remove useless R_CountDynamicLights function 2024-01-27 17:16:01 +03:00
5696c9c96a ref: gl: remove useless R_CountDynamicLights function 2024-01-27 17:15:57 +03:00
482aa840e7 ref: soft: add PARM_TEX_FILTERING handler (stub) 2024-01-25 05:47:12 +03:00
4599983c8e ref: gl: add PARM_TEX_FILTERING handler 2024-01-25 05:46:54 +03:00
mittorn
5f31417bae ref_gl: fix missing vboarray split transition on some maps 2024-01-19 21:28:49 +03:00
150d98bd15 ref: gl: fix stuck single lightmap texture object when using VBO after updating lightmap 2024-01-19 09:57:11 +03:00
f162fbd806 ref: gl: fix fog with enabled overbrights and no vbo 2024-01-19 06:19:42 +03:00
7d8ea61ac2 ref: gl: move glBegin/glEnd outside of the loop in CL_DrawTracers 2024-01-17 02:46:38 +03:00
00b2ca7f5a ref: gl: remove duplicates from gl_export.h 2024-01-15 02:08:30 +03:00
a8cc68f6b9 ref: gl: fix ripple water is being blurry with gl_texture_nearest after startup 2024-01-14 10:56:58 +03:00
c9d29b3955 ref: gl: fix overbrights with VBO 2024-01-09 03:55:07 +03:00
cf7a79bff3 ref: gl: particles aren't supposed to care about gamma 2024-01-09 03:55:07 +03:00
55dfa1bf44 ref: soft: reorder applying light gamma 2024-01-09 03:55:07 +03:00
519c8a032a ref: soft: adapt studio renderer to new gamma implementation 2024-01-09 03:55:07 +03:00
c15822f375 ref: soft: don't depend on light gamma in recursive light point 2024-01-09 03:55:07 +03:00
0e91deec19 ref: soft: remove unused scale (remnants of r_lightmap_modulate), use integer values for non-interpolated lightstyles 2024-01-09 03:55:07 +03:00
87b204c661 ref: gl: remove unused scale (remnants of r_lightmap_modulate), use integer values for non-interpolated lightstyles 2024-01-09 03:55:07 +03:00
caefa0b7b9 engine: remove cvar r_lighting_modulate, it's some unindentifiable legacy 2024-01-09 03:55:07 +03:00
ee4cb39f3e ref: gl: adapt alias renderer to new gamma implementation (untested) 2024-01-09 03:55:07 +03:00
18436a70eb ref: gl: support overbrights, change the gamma applying order closer to the original renderer 2024-01-09 03:55:00 +03:00
8298053e6a ref: gl: don't depend on lightgamma in recursive light point 2024-01-09 03:33:39 +03:00
9304a0041d ref: gl: support kRenderFxLightMultiplier
* add undocumented kRenderFxLightMultiplier to const.h
2024-01-09 03:33:39 +03:00
64f92003fa ref: gl: adapt studio lightning to new gamma
* more accurate SHADE_LAMBERT value (extracted from v_lambert1 global variable)
2024-01-09 03:33:39 +03:00
a0c31120d9 ref: add R_GammaChanged function that engine calls on every gamma change 2024-01-07 03:35:23 +03:00
c0757bd84c ref: gl: remove vid_gamma/vid_brightness changed cvar value check 2024-01-07 03:35:23 +03:00
9fa32a9cf4 ref: soft: remove vid_gamma/vid_brightness changed cvar value check 2024-01-07 03:35:23 +03:00
5ac8f63741 ref: soft: replace skin texture num bound by a proper check, fixes wrong skin on flags in Adrenaline Gamer 2024-01-05 02:25:18 +03:00
9d3949a948 ref: gl: replace skin texture num bound by a proper check, fixes wrong skin on flags in Adrenaline Gamer 2024-01-05 02:25:10 +03:00
6862b14e59 ref: soft: only draw MOVETYPE_FOLLOW studio model if it's parent is visible 2024-01-04 22:02:14 +03:00
dc1d65f621 ref: gl: only draw MOVETYPE_FOLLOW studio model if it's parent is visible 2024-01-04 22:02:09 +03:00
fba3a2b67f ref: soft: return NULL in GetEntityByIndex and ModelHandle 2024-01-04 21:47:03 +03:00
b946c8455d ref: gl: return NULL in GetEntityByIndex and ModelHandle just in case 2024-01-04 21:46:44 +03:00
0132eb6e44 ref: gl: restore usage of FWORLD_CUSTOM_SKYBOX flag, do direct checks instead of PARM check, remove unused tr.fCustomSkybox 2023-12-30 16:55:31 +03:00
f12df54226 ref: soft: remove unused tr.fCustomSkybox 2023-12-30 16:54:56 +03:00
d971055927 engine: move PARM_SKY_SPHERE handling out of engine to renderer, after all renderers might or might not support sky spheres 2023-12-30 16:54:37 +03:00
6059538d77 ref: gl: use direct host.features instead of PARM_FEATURES 2023-12-30 16:41:51 +03:00
17deba0606 ref: gl: use direct cl.paused instead of PARM_GAMEPAUSED 2023-12-30 16:41:39 +03:00
82a2d272ad ref: gl: use direct host.features instead of PARM_FEATURES 2023-12-30 16:41:22 +03:00
59ddfb787f ref: soft: remove GetPredictedOrigin() call 2023-12-30 16:36:13 +03:00
acdf1da995 ref: soft: remove GetMoveVars() call 2023-12-30 16:36:13 +03:00
f1cdab91eb ref: soft: remove usage of PARM_VIEWENT_INDEX and PARM_PLAYER_INDEX 2023-12-30 16:36:13 +03:00
05d5abe4db ref: soft: remove usage of PARM_MAX_CLIENTS 2023-12-30 16:36:13 +03:00
44e017a410 ref: soft: convert to usage of ref_host_t to get real engine time 2023-12-30 16:36:13 +03:00
64f3884f23 ref: soft: convert to usage of ref_client_t to get client time 2023-12-30 16:36:13 +03:00
6386782674 ref: soft: acquire engine pointers 2023-12-30 16:36:13 +03:00
8084687e50 ref: gl: remove GetPredictedOrigin call 2023-12-30 16:36:13 +03:00
6c16de55c0 ref: gl: remove GetMoveVars() call 2023-12-30 16:36:13 +03:00
537237ef62 ref: gl: remove usage of PARM_VIEWENT_INDEX and PARM_PLAYER_INDEX 2023-12-30 16:36:13 +03:00
4dfc3f34cb ref: gl: remove usage of PARM_MAX_CLIENTS 2023-12-30 16:36:13 +03:00
d22bbb4213 ref: gl: remove usage of PARM_WORLD_VERSION 2023-12-30 16:36:13 +03:00
0e3b14e9a5 ref: gl: remove usage of PARM_NUMMODELS 2023-12-30 16:36:13 +03:00
afb0540aa3 ref: gl: convert to usage of ref_host_t to get real engine time 2023-12-30 16:36:13 +03:00
4d802d8901 ref: gl: convert to usage of ref_client_t to get client time 2023-12-30 16:36:13 +03:00
6a4bf4965f ref: gl: acquire engine pointers 2023-12-30 16:36:13 +03:00
mittorn
a488f79852 ref_gl: workaround freezes on adreno with vbo on dlighted decals 2023-12-25 14:21:21 +03:00
b290046503 ref: gl: remove hidden parm -gl-allow-vbo-dontuse needed to activate VBO renderer 2023-12-19 17:55:10 +03:00
Dmitry Toroshchin
e8409cee8b ref_gl: vbo: do not do zero-length drawcalls (fix glError on vivante) 2023-12-19 17:55:10 +03:00
mittorn
1d4d355b38 ref_gl: vbo: fix binding garbade texture after changelevel, fix wpoly counter 2023-12-19 17:55:10 +03:00
mittorn
dfe12535a5 ref_gl: vbo: disable R_TextureRandomTiling implementation until will be fixed 2023-12-19 17:55:10 +03:00
mittorn
74946100f1 ref_gl: fix not restoring static lightmap after decals 2023-12-19 17:55:10 +03:00
mittorn
9a1717915c ref_gl: vbo: apply a1batross's patch for uint index switch 2023-12-19 17:55:10 +03:00
mittorn
3691eb6e48 ref_gl: vbo: fix incorrect lightmap index, optimize loading maps with very big lightmap count, fix clouds drawing after VBO 2023-12-19 17:55:10 +03:00
mittorn
3bb7471fd3 ref_gl: vbo: fix lightmap0 processing, remove ilightmap 2023-12-19 17:55:10 +03:00
74e09ddb12 ref_gl: change state management in vbo renderer 2023-12-19 17:55:10 +03:00
6b73d056b2 ref_gl: vbo dlights refactiring 2023-12-19 17:55:10 +03:00
3e7847551a ref_gl: add ability to skip uploading unused data (disabled) 2023-12-19 17:55:10 +03:00
mittorn
91d92935fa ref_gl: try avoid gpu locking on dlights in vbo renderer 2023-12-19 17:55:10 +03:00
mittorn
eff033298a ref_gl: disable singlepass detail renderer, use correct fog color multipliers in VBO 2023-12-19 17:55:10 +03:00
mittorn
3a8f4961bc ref_gl: fix rarely broken texturechain on some big maps 2023-12-19 17:55:10 +03:00
mittorn
b81f94518a ref_gl: fix out-by-one when all lightstyles are used. Also fix broken in this case in vbo after previous fix 2023-12-19 17:55:10 +03:00
a7e84230c3 ref: gl: use world version to enable large lightmaps for BSP2 automatically 2023-12-15 07:38:25 +03:00
21797f9ac8 ref: gl: fix solor to color 2023-12-06 05:22:02 +03:00
mittorn
c800b34cd4 ref_api: add R_Flush method 2023-12-06 04:13:27 +03:00
26d229c8ca engine, ref: RefAPI 5. Simplify remap calls 2023-12-06 04:13:03 +03:00
9c66e86be1 engine, ref: RefAPI 5. Remove unused calls 2023-12-06 04:13:03 +03:00
7e9f87de2d engine, ref: eliminate calls to global arrays, instead store array pointers at renderer side 2023-12-06 04:13:03 +03:00
255773b4de ref: gl: remove useless calls to glGetString if we're running under GL4ES 2023-12-04 02:53:51 +03:00
5b73a788da ref: gl: disable unused variable warning for GL functions defintions 2023-12-04 02:53:27 +03:00
08dbfc45d3 ref: gl: refactor getting edge position, texture and lightmap coords 2023-12-02 18:02:18 +03:00
Andrey Akhmichin
16cc0ca0fe ref: gl: gl2_shim: replace "malloc.h" header with ALLOCA_H macro. 2023-11-20 00:13:04 +03:00
e481e1d73e ref: gl: enable GL waves with r_ripple 2023-10-31 21:52:00 +03:00
6c0eed1b2b ref: gl: allow viewing water textures in their full glory with enabled r_ripple 2 2023-10-31 21:52:00 +03:00
a6c67fdf9f ref: gl: upload only part of texture we're using, i.e. 64x64 for 64x64, 128x128 for 128x128 2023-10-31 21:52:00 +03:00
46889ed453 ref: gl: libc rand() does better job at randomizing 2023-10-31 21:52:00 +03:00
882fcc152c ref: gl: always scale down texture to 64x64, like sw.dll does 2023-10-31 21:52:00 +03:00
a6af32dafd ref: gl: connect ripply water to others parts of renderer (init, reset, animation and rendering) 2023-10-31 21:52:00 +03:00
d6dfb83be7 ref: gl: ripply water implementation (bugfixed version from my Quake-2 patches) 2023-10-31 21:52:00 +03:00
mittorn
f2c080e736 gl2shim: fix broken matrix update when fog attribute enabled (32 bit shift overflow) 2023-10-30 22:34:34 +03:00
ea55e78855 ref: _inline -> static 2023-10-29 23:38:43 +03:00
30d1492b93 engine: remove Set/GetCurrentLoadingModel from RefAPI 2023-10-28 15:22:21 +03:00
mittorn
bf5fd40d64 gl2shim: workaround empty rgb5/rgb8 textures 2023-10-26 23:08:02 +03:00
mittorn
6bc613bdb4 ref_gl: force gles2 on non-nanogl until we support gles1 directly 2023-10-26 23:07:39 +03:00
a982562658 ref_gl: Fix missing DebugOutput functions on GLES 2023-10-26 23:07:22 +03:00
34d7664342 ref: gl: disable TGA flip for detail textures, GoldSrc ignores it, so we will too 2023-10-26 05:12:38 +03:00
b0a79df86f ref: change r_traceglow to 0, as GoldSrc does 2023-10-26 04:59:01 +03:00
3251b68df5 ref: gl: more simple search of GL func with alternative name (EXT, OES suffixes or no suffix) 2023-10-22 20:02:14 +03:00
mittorn
c1d1aa6787 ref_gl: rewrite ARB workaround to check EXT/OES names, notify user that function found with different name 2023-10-22 20:02:14 +03:00
b76a75d6b4 ref: gl: respect gl_texture_nearest value for skyboxes 2023-10-20 18:55:22 +03:00
Ivan Avdeev
a251600c8a
engine: common: imagelib: add KTX2 support (#1455)
* engine: common: imagelib: add KTX2 support

Adds basic KTX2 support for a few compressed formats. KTX2 essentially
is a Vulkan-centric texture format that supports literally hundreds of
pixel formats.
For now only support for these is added:
- `VK_FORMAT_BC4_UNORM_BLOCK`
- `VK_FORMAT_BC4_SNORM_BLOCK`
- `VK_FORMAT_BC5_UNORM_BLOCK`
- `VK_FORMAT_BC5_SNORM_BLOCK`
- `VK_FORMAT_BC6H_UFLOAT_BLOCK`
- `VK_FORMAT_BC6H_SFLOAT_BLOCK`
- `VK_FORMAT_BC7_UNORM_BLOCK`
- `VK_FORMAT_BC7_SRGB_BLOCK`

Adding more formats is relatively straightforward:
- Copy format definition from `VkFormat` enum in `vulkan_core.h`
- Add a new definition into `pixformat_t` enum.
- Add format size calculation into `Image_ComputeSize()`

While we're at it, also adds a few new formats to DDS:
- BC4_UNORM -- PF_BC4_UNSIGNED
- BC4_SNORM -- PF_BC4_SIGNED
- BC5_UNORM -- PF_BC5_UNSIGNED
- BC5_SNORM -- PF_BC5_SIGNED
- BC7 is expanded into BC7_UNORM and BC7_SRGB

ref_gl and ref_soft code is updated where it made sense. But not tested
really. Support for these formats has been tested with ref_vk.

* address spaces-vs-parentheses formatting where noticed

* parenthesize sizeofs

* move ktx2.h to imagelib as img_ktx2.h; massage it a bit

* use SetBits() instead of |=

* remove stale TODO comments
2023-10-18 10:31:40 +03:00
a2b992d865 ref_gl: fix codestyle 2023-10-16 06:47:55 +03:00
ddf3f2ffdb gl2shim: Allow drawing huge QUADS sequences by splitting drawcalls on overflow 2023-10-16 06:47:55 +03:00
2454e87509 ref_gl: gl2shim: refactoring, add missing spaces in parentheses and ternary ops, remove singleline multiple assignments, use bitset macros 2023-10-16 06:47:55 +03:00
mittorn
0dc44249a2 ref_gl: fix XASH_GL_STATIC build 2023-10-16 06:47:55 +03:00
mittorn
150cbfa4de ref_gl: do not trust REFAPI context version, get it from OpenGL anyway 2023-10-16 06:47:55 +03:00
mittorn
c0b068d81b ref_gl: add workarounds for detecting extensions correctly on gles1/gles2 without wrapper (swiftshader works now) 2023-10-16 06:47:55 +03:00
mittorn
fbc312b6cf gl2shim: remove float suffix in shaders, that makes glsl100 work in swiftshader 2023-10-16 06:47:55 +03:00
mittorn
342e0d3e2e gl2shim: add glsl100 support 2023-10-16 06:47:55 +03:00
mittorn
202b228691 gl2shim: correct allocation/cleanup 2023-10-16 06:47:55 +03:00
mittorn
c9c1286803 ref_gl: fix typo 2023-10-16 06:47:55 +03:00
mittorn
eab98b0eda gl2shim: dynamic extension checking and autoconfiguration 2023-10-16 06:47:55 +03:00
mittorn
35be80fc21 ref_gl: request gl1.1 if compatibility profile unavailiable, this fixes launching with GL <= 2.0, improve old version extension detection 2023-10-16 06:47:55 +03:00
mittorn
c7dd9d6437 ref_gl: init r_temppool before InitExtensions, fix extension string allocation 2023-10-16 06:47:55 +03:00
mittorn
d378878c91 gl2shim: try fix getting program link log 2023-10-16 06:47:55 +03:00
mittorn
4a2f8cafcd gl2shim: try fix errors in ViZual ZtudiO 2023-10-16 06:47:55 +03:00
mittorn
d254bac16b ref_gl: integrate gl2shim extensions 2023-10-16 06:47:55 +03:00
mittorn
e23b632ce5 ref_gl: add missing non-arb shader functions 2023-10-16 06:47:55 +03:00
mittorn
2f321b1471 ref_gl: implement minimum inclusion version for GL extensions, implement quering extensions on core profile 2023-10-16 06:47:55 +03:00
mittorn
0265e88d8f gl2shim: fix wrong color vertex 2023-10-16 06:47:55 +03:00
mittorn
4114d2f24d gl2shim: more refactoring 2023-10-16 06:47:55 +03:00
mittorn
8124035763 ref_gl: try fix psvita 2023-10-16 06:47:55 +03:00
mittorn
96127c6eb0 gl2shim: make shaders code more portable 2023-10-16 06:47:55 +03:00
mittorn
cf65a39b83 gl2shim: refactoring 2023-10-16 06:47:55 +03:00
mittorn
0341f96b70 gl2shim: use IBO for quads 2023-10-16 06:47:55 +03:00
mittorn
c95d91cfe3 gl2shim: limit begin-end chain length, cycle incremental buffers 2023-10-16 06:47:55 +03:00
mittorn
cbd10c6279 gl2shim: improve shader version handling, fix particle issues 2023-10-16 06:47:55 +03:00
mittorn
5df9e57743 gl2shim: support incremental non-persistent buffers for arrays 2023-10-16 06:47:55 +03:00
mittorn
c178022fb5 gl2shim: persistent incremental streaming buffers, buffer cycling support 2023-10-16 06:47:55 +03:00
mittorn
724c29d711 gl2shim: implement fallback vbo, glDrawRangeElements with non-vbo buffer works now on core contexts 2023-10-16 06:47:55 +03:00
mittorn
74a2dbeb91 gl2shim: batcher experiments (UGLY, DO NOT USE), fix bad shader bindings, Draw QUADS with TRIFAN when possible 2023-10-16 06:47:55 +03:00
mittorn
5d20d24ebc gl2shim: simple matrix invalidation, do not calculate MVP every drawcall 2023-10-16 06:47:55 +03:00
mittorn
0e2fc277c8 gl2shim: bind dummy VAO on DrawElements implementation on glcore, this generates GL Errors, but renders fine on mesa 2023-10-16 06:47:55 +03:00
mittorn
1505740b73 ref_gl: fix enabling multitexturing on GLES 2023-10-16 06:47:55 +03:00
mittorn
6bad07b39d gl2shim: support low (<130) shaders 2023-10-16 06:47:55 +03:00
mittorn
f85437dfc5 gl2shim: implement client arrays (not in glcore/vao mode), make studio/world array render work 2023-10-16 06:47:55 +03:00
mittorn
c765261db6 ref_gl: fix late studio cvars registration, enable DrawRangeElements in GLES contexts 2023-10-16 06:47:55 +03:00
mittorn
73087ead2d ref_gl: fix build with XASH_GL_STATIC, avoid using ARB shader extension on core context 2023-10-16 06:47:55 +03:00
mittorn
8c88e82709 gl2shim: support more GLSL versions 2023-10-16 06:47:55 +03:00
mittorn
40dd6e0234 gl2shim: Cleanup warnings, use APIENTRY declarations, stub unsupported functions 2023-10-16 06:47:55 +03:00
mittorn
eb23b226cc Workaround core context issues 2023-10-16 06:47:55 +03:00
mittorn
676526a518 ref_gl: fix creating core context, support core in gl2shim by creating dumb array object 2023-10-16 06:47:55 +03:00
mittorn
7e0bd86b65 ref_gl: allow enabling XASH_GLES without wrapper, add ref_gles3compat, wrap gles functions in gl2wrap when XASH_GLES enabled 2023-10-16 06:47:55 +03:00
mittorn
97489635af gl2shim: limited matrix support 2023-10-16 06:47:55 +03:00
mittorn
a9ea3976a7 ref_gl: introduce gl2_shim based on vgl_shim for future limited core/gles context support (SLOW, still needs ffp for matrix operations) 2023-10-16 06:47:55 +03:00
de19d78571 ref: fix late registration of studio cvars (thanks, @mittorn) 2023-10-14 08:11:25 +03:00
mittorn
287381d5ca ref_gl: remove complete useless macro, enable VBO under option 2023-10-14 08:04:17 +03:00
a738b2a50b ref: restore missing PARM_TEX_MEMORY RenderAPI parameter 2023-10-06 19:24:02 +03:00
95f87e24ee ref: soft: do not register cl_righthand cvar 2023-09-29 13:45:24 +03:00
8eef212726 ref: gl: fix compile 2023-09-11 21:22:53 +03:00