Commit Graph

68 Commits

Author SHA1 Message Date
Shpoike 6394ea27e8 Fix chasecam to deal with the viewmodel change... Also attempt to push it away from walls in a not-so-much-of-a-wallhack kind of way. 2023-07-26 11:18:06 +01:00
Shpoike 2c38d5b3e3 Merge remote-tracking branch 'sf/master' into qss 2023-03-18 12:38:25 +00:00
temx 226a0e7463 Water texture mipmapping support 2022-11-03 06:23:28 +03:00
temx dd8439b767 Factor out scale support, add bmodels and sprites 2022-09-05 23:56:30 +03:00
JosiahJack 87835bc3e3 Add support for lit water 2022-08-07 05:31:18 -05:00
Shpoike 0f1c4fca19 Merge remote-tracking branch 'sf/master' into qss 2022-08-04 07:04:30 +01:00
Ozkan Sezer 00530bda9b gl_model.c: made a lot of procs and vars static
only user of 'loadmodel' outside of gl_model.c was Sky_LoadTexture,
so changed it to accept a model pointer.

TODO: remove need for globals such as mod_base, loadmodel, loadname
2022-07-05 08:50:02 +03:00
Ozkan Sezer 2dd6a14ccf removed r_cache_thrash, showram & co. 2022-07-05 08:50:02 +03:00
Ozkan Sezer 52a3873d44 removed several unused r_speeds globals. 2022-07-05 08:50:02 +03:00
Shpoike 4ec4cde5f4 Add support for lit water. Move 'newwater' to glsl instead. 2021-11-12 03:28:09 +00:00
Shpoike 154e848d32 Try to fix some connectivity issues. 2021-10-05 06:15:34 +01:00
Shpoike a5275c95d5 Merge remote-tracking branch 'sf/master' into qss 2021-09-03 20:19:12 +01:00
Guillaume Plourde 0fc09fd95d q64 sky texture now display correctly
see https://github.com/Novum/vkQuake/pull/358
2021-09-03 01:37:50 -04:00
Shpoike 7ba6c4474b Merge Quakespasm's post-fork changes into QSS (rebased to make them compatible) 2021-08-31 06:43:13 +01:00
Shpoike f675ce9b95 Mask off sky depth after drawing skyrooms, to avoid nasty surprises. Also don't get confused by the viewmodel's depthhack. 2021-08-31 04:59:13 +01:00
Shpoike 929dd85164 Implement csqc validation, we can start on giving more capabilities now that we can distinguish between modified and unmodified csprogs. 2021-08-31 04:59:12 +01:00
Shpoike 0a61068135 Fix glCompressedTexImage2D undefined on windows. 2021-08-31 04:59:12 +01:00
Shpoike 47cae9c3f8 Added support for my extended miptex stuff for high-colour map textures. 2021-08-31 04:59:12 +01:00
Shpoike e259d0db52 Add skybox console command for dynamic use (blame sock). Additional args for skyroom speed and axis of rotation. 2021-08-31 04:59:12 +01:00
Shpoike e38664c222 Hacked in support for IQMs. 2021-08-31 04:59:12 +01:00
Shpoike 9b023749da Quick attempt at skyrooms. Seems to work for me. Note that the server's pvs is not opened, nor have I tried to depthmask sky surfaces to avoid leakage. _skyroom "x y z" in worldspawn to use. 2021-08-31 04:59:12 +01:00
Shpoike ee2ab9a593 Added support for LMSTYLES16 bspx lump, allowing up to 16 lightstyles per face and a lot more switchable light styles. 2021-08-31 04:59:12 +01:00
Shpoike 85821b6fab Better effectinfo compat 2021-08-31 04:59:11 +01:00
Spike f6d31e9db9 Bugfix - make dlights move correctly with respect to moving bsp entities, instead of the light being in the wrong place.
Obviously this doesn't affect baked lights, but at least mappers have more control over those.
2021-08-31 04:59:11 +01:00
Spike d76ca606bf All changes present in QSS-R7, plus
md3 support
quoth/etc bug fix
strzone bug fix
png/jpg replacement wall textures
rewrote mdl rendering to always use arrays, relaxing vertex+tri limits.
removed static ents limit
fixed ambient_level not working at high framerates.
2021-08-31 04:59:11 +01:00
Andrei Drexler 3c8611f604 Reset pointers to sky textures on map unload/game change
This fixes a crash when loading a skyless map after one with a sky.
( From: https://github.com/Novum/vkQuake/pull/339 )
2021-08-10 01:00:02 +03:00
Axel Gneiting 3fc32bf7fe Merge surface mark & cull optimization from vkQuake
* Remove separate surface culling pass. Instead always build texture chains every frame & cull in mark surfaces.
* Optimize R_CullBox & R_BackFaceCull
2021-07-07 23:55:50 +03:00
Ozkan Sezer 9ca7d499e5 fixed -Wshadow warnings. 2021-06-23 04:37:10 +03:00
Ozkan Sezer 39b4fccb44 move LMBLOCK_WIDTH/HEIGHT from bspfile.h to glquake.h
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1630 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 12:34:12 +00:00
Eric Wasylishen e041b958c7 r_brush.c: dynamically allocate lightmaps, from QuakeSpasm-Spike
This raises LMBLOCK_WIDTH/HEIGHT from 128 to 256 which should
be supported everywhere and decrease draw calls

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1628 af15c1b1-3010-417e-b628-4374ebc0bcbd
2019-09-12 06:49:35 +00:00
Eric Wasylishen ac42683f58 r_world.c: rewrite R_DrawTextureChains_Multitexture_VBO to use GLSL
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1524 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-11-01 04:01:02 +00:00
Eric Wasylishen 0a681bd7cd new r_scale cvar, for rendering the 3D view at 1/2, 1/3, or 1/4 res.
This is for emulating a low-resolution pixellated look,
or possibly as a performance boost on slow graphics cards.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1406 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-05-26 20:37:48 +00:00
Eric Wasylishen f92ce77fc9 PF_VarString: throttle "exceeds standard limit" warning message
Prevents console spam on "developer 1" if a mod calls PF_VarString often (e.g. In the Shadows textbooks).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1402 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-04-25 20:07:34 +00:00
Eric Wasylishen 316de63f98 limit increases to handle oms3 map pack.
MAX_MAP_LEAFS: 65535 -> 70000
MAX_LIGHTMAPS: 256 -> 512

TODO: maybe drop static arrays based on MAX_MAP_LEAFS like, see R_InitVisCache in RMQEngine.
TODO: dynamically allocate the static `lightmaps` array as well; with this last limit increase it's 32MB.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1312 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-06-24 06:15:33 +00:00
Ozkan Sezer f07ac29c0b fix C++11 -Wliteral-suffix warnings. fix -Wnarrowing errors/warnings.
fix the detestable in_sdl.c/SDL2 int-to-enum conversion failure errors
from g++.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1302 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-04-29 20:00:50 +00:00
Eric Wasylishen e2321d816b Fog: move setting of GL_FOG_MODE to GL_EXP2 to a new Fog_SetupState() function and call it in VID_Restart.
Fixes bug where the fog mode was resetting to the default (GL_EXP) after a mode switch, causing fog to look different. This was only affecting SDL1 for me.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1259 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-11-26 09:06:42 +00:00
Eric Wasylishen e007116a5d Alias model VBO renderer: restructure so each model is stored in a separate VBO and load them in Mod_LoadAliasModel, rather than R_NewMap.
Initially I thought that we would never need to draw an alias model that hadn't been precached when R_NewMap runs, but this assumption turned out to be incorrect. This fixes the issue where progs/bolt.mdl wasn't rendering in the Scourge Done Slick demos.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1253 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-20 20:10:49 +00:00
Steven b2465a4c82 r_pos cvar: Dynamic position info, aka r_speeds + viewpos.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1252 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-09-12 03:29:41 +00:00
Eric Wasylishen 01faf4e5b6 new cvars: r_lavaalpha, r_slimealpha, r_telealpha for fine-tuning specific liquid opacities (from DirectQ, RMQEngine)
new worldspawn keys: _wateralpha, _lavaalpha, _slimealpha, _telealpha, _skyfog (unique to Quakespasm)

The lava/slime/telealpha cvars are non-archived, and default to 0, which means to use the value of r_wateralpha, so they have no effect by default.

The worldspawn keys allow custom maps to set these values in a way that only applies while the map is loaded, and doesn't change the cvar value. (similar to the behaviour of the "fog" worldspawn key.) They are accepted with or without the underscore, like "fog".

see also:
http://forums.insideqc.com/viewtopic.php?f=3&t=5532
http://celephais.net/board/view_thread.php?id=60452&start=937

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1238 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-07-26 21:51:25 +00:00
Eric Wasylishen 665c81084f R_Clear: clear stencil buffer together with depth buffer if we have one.
mh suggest that not doing this may cause performance
issues: http://forums.inside3d.com/viewtopic.php?t=2408
It's also mentioned in a "Depth In-Depth" document from AMD.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1203 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-04-16 23:57:45 +00:00
Eric Wasylishen 91196a618f Disable GLSL alias model renderer on Win32+ATI/AMD until szo's bug with models drawing black can be fixed.
Replace GLAlias_SupportsShaders() with gl_glsl_alias_able variable.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1171 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-02-20 00:24:05 +00:00
Eric Wasylishen 1311398e80 New gamma correction implementation using glsl. Enabled by default on OpenGL2. Disable with -noglslgamma.
Avoids general bugginess of hardware gamma, doesn't affect the whole screen in windowed mode like HW gamma. Should fix http://sourceforge.net/p/quakespasm/bugs/5/

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1157 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-26 20:18:45 +00:00
Eric Wasylishen 6970b01052 GLAlias_GetUniformLocation: refactor to GL_GetUniformLocation, take program as an argument
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1154 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-25 20:29:30 +00:00
Eric Wasylishen 112c8b68b8 Alias model rendering fast-path using OpenGL 2.
In GL_MakeAliasModelDisplayLists, after saving the standerd triangle strips and fans onto the hunk, if the system is GL2 capable, we also save a second version of the mdl on the hunk designed to be loaded into a VBO (GL_MakeAliasModelDisplayLists_VBO). In R_NewMap, and on video mode changes, we call GLMesh_LoadVertexBuffers which loops over all precached mdl's and loads the data into a pair of VBO's (vertices and vertex indices).

Finally, in R_DrawAliasModel, assuming no rendering options are disabling the fast-path (r_drawflat 1, r_lightmap 1, or r_fullbright 1 would disable it), we call GL_DrawAliasFrame_GLSL, which sets up all of the bindings and draws the (possibly lerped) mdl in one glDrawElements call.

Special thanks to MH for some of the code from RMQEngine and the general concept.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1151 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-01-20 18:59:15 +00:00
Eric Wasylishen 4a2e29f1c1 R_SetupGL: remove some dead code (glGet call that stores GL_MODELVIEW_MATRIX into r_world_matrix, which is not used anywhere.) The glGet calls was stalling the OpenGL pipeline.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1141 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-11-11 23:27:12 +00:00
Ozkan Sezer b9032b7815 copyright years, general tidy-up, remove unused d_ifacea.h.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1059 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-22 08:55:46 +00:00
Eric Wasylishen 90b26fc215 r_world: Add a new R_DrawTextureChains_Multitexture_VBO function. Draws lightmapped surfaces with fulbrights in one pass, using the VBO. Requires 3 TMUs, GL_COMBINE_EXT, and GL_ADD.
R_DrawTextureChains_Multitexture: revert to the way it was before VBO support was added.
gl_texmgr: expose GL_SelectTexture. make the implementation less convoluted and support 3 TMUs.
gl_vidsdl: check GL_MAX_TEXTURE_UNITS
r_brush: only create VBOs if 3 TMUs available

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1035 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-20 01:08:13 +00:00
Eric Wasylishen e0680cb6d3 Load world and brush models into a VBO, and draw it in batches in R_DrawTextureChains_Multitexture. Uses the same immediate mode code as before if VBOs are not available, or if "-novbo" used at the command line. I only touched R_DrawTextureChains_Multitexture because it's usually the main bottleneck aside from alias model rendering.
This seems to help fps a fair bit on maps with a lot of world polys like jam2_tronyn. Tried on a few computers with intel and nvidia gpus, windows, mac os, linux, and there's always at least some fps improvement. Best case was 70fps -> 96fps on jam2_tronyn, on OS X + nvidia 650gt.

Interested to hear how this works for amd gpu's, just do a timedemo with and without "-novbo".

Only downside is I had to disable the fast path in Vid_Toggle_f() because at least with SDL1, the vbo no longer works after a toggle. So as a result, fullscreen toggles with alt-enter are slightly slower.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1018 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-11 04:55:16 +00:00
Ozkan Sezer b8fc8caa0f dropped support for GL_SGIS_multitexture
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@984 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 08:00:34 +00:00
Eric Wasylishen b9d280f10b Revert r981 "Simple use of vertex arrays in R_DrawTextureChains_Multitexture."
It caused a dramatic slowdown on my machine on windows (50% slower)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@983 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-30 06:30:49 +00:00