Commit Graph

48 Commits

Author SHA1 Message Date
Shpoike 0ca6d9ad77 Fix host_errors with csqc+r_showbboxes. 2021-08-31 04:59:13 +01:00
Shpoike 367b799998 r_fastsky should skip skyroom drawing too, for people with really slow computers. 2021-08-31 04:59:12 +01:00
Shpoike 3016b0201f Fix menuqc-related crash with r_shadows enabled. 2021-08-31 04:59:12 +01:00
Shpoike 54538a054a Menuqc support. Only tested against menusys so far. 2021-08-31 04:59:12 +01:00
Shpoike 1f521aadb2 Fix bug from resizing the window with glsl gamma in use. 2021-08-31 04:59:12 +01:00
Shpoike 9d15653e46 Add proper collision support for angles on SOLID_BSP entities. 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 9a03e77742 Added FTE_ENT_SKIN_CONTENTS support. 2021-08-31 04:59:12 +01:00
Shpoike 81b7ba9e4b Added FTE_ENT_SKIN_CONTENTS support. 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 4d5fd6c688 Implement exteriormodeltoclient 2021-08-31 04:59:11 +01:00
Shpoike 8a7609f3fe Fix r_showbboxes bug (reported by c0burn) 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 fe4b224c7d Added support for simple csqc.
This is a subset of csqc, with alternative entry points that can be invoked by compat wrappers.

Also added sv_gameplayfix_setmodelrealbox cvar. Default value of 1 matches QuakeSpasm, whereas a value of 0 matches vanilla quake's behaviour.
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
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 150be12da1 Contrast support with a "contrast" cvar, behaving the same as MarkV's.
It may be a useful alternative to the existing gamma control for laptops in a bright environment, etc.
(raising contrast gives less of a gray/washed out look than raising gamma, but as a disadvantage, colours near white get clipped to white.)

It's also implemented for both GLSL and SDL gamma ramps, but only if USE_GAMMA_RAMPS is set to 1.
Since USE_GAMMA_RAMPS  is 0, currently it only works with GLSL.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1290 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-02-12 23:26:36 +00:00
Eric Wasylishen 36d9cc4b42 Default gl_clear to 1, as described in "Common mistakes" https://www.opengl.org/wiki/Common_Mistakes#Swap_Buffers
"The buffers should always be cleared. On much older hardware, there was a technique to get away without clearing the scene, but on even semi-recent hardware, this will actually make things slower. So always do the clear."
Plus it's nice for map development / debugging.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1287 af15c1b1-3010-417e-b628-4374ebc0bcbd
2016-01-29 20:47:24 +00:00
Eric Wasylishen be808701ea GLSLGamma_GammaCorrect: clear the cached texture binding in GL_Bind properly, after the glBindTexture calls earlier in this function.
Fixes a obscure bug where:
 - a bsp with no textures (pink checkerboard displayed)
 - gamma != 1
 - nothing else on screen (sbar hidden, r_drawviewmodel 0)
would result in the screen turning to noise.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1263 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-12-13 07:23:04 +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 271f05bf63 R_DrawEntitiesOnList: revert entity texture sorting added in r1151 as it introduces wrong alpha-sorting in contract revoked start.bsp
reported here: http://www.celephais.net/board/view_thread.php?id=60452&start=1515

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1234 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-24 18:22:56 +00:00
Eric Wasylishen 56a7b45200 GLSLGamma_GammaCorrect: support this code path on old cards without the NPOT extension
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1231 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-06-15 21:17:39 +00:00
Eric Wasylishen 95e0be7afe add r_noshadow_list cvar (from MarkV), removing hardcoded list of models to not have shadows
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1210 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-18 18:00:49 +00:00
Eric Wasylishen 2e2b110ecb r_shadows: Better stencil shadow rendering from MarkV.
Now an 8-bit stencil buffer is requested when using a 24-bit depth buffer (the default).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1209 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-18 06:11:56 +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 dbed5c9426 GLSL gamma: implement some suggestions from Spike - remove redundant glClear, remove matrix changes (not used in programmable pipeline), change filter mode to nearest (no filtering will happen anyway)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1188 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-03-08 21:13:26 +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 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
Eric Wasylishen b694b513ec Tweak the MH dynamic lighting speedup to be more correct: upload the lightmaps from the current frame instead of the previous frame.
It was possible, but unlikely, to see artifacts from the previous code in some circumstances, e.g. "host_maxfps 10" and spin around quickly near a flashing light e1m1, you may see a surface drawn with an out-of-date lightmap for one frame.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1130 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-10-21 19:27:42 +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
Sander van Dijk 093ecad80b gl_rmain.c: make gl_zfix default to 0, no longer save it to config.cfg
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@990 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-09-07 19:35:52 +00:00
Eric Wasylishen 9c6f93eb8a Remove R_DrawSequentialPoly and use texture chains for drawing brush models.
To make this work with the drawing order we use in gl_rmain (world excluding water, opaque ents, world water, transparent ents), I made each texture_t have two texture chains, one for world and one for bmodels. This way they can be cleared during entity drawing without having to regenerate the world ones.

Other than this the changes are mostly minor adjustments to the R_DrawTextureChains_* functions so they can work for things other than the world.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@979 af15c1b1-3010-417e-b628-4374ebc0bcbd
2014-08-29 08:27:22 +00:00
Sander van Dijk 22f426441f remove isIntelVideo special handling, simply set gl_clear instead
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@830 af15c1b1-3010-417e-b628-4374ebc0bcbd
2013-03-02 12:31:09 +00:00
Sander van Dijk d91f083ee4 Remove more dead code.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@790 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-11-28 19:10:52 +00:00
Ozkan Sezer c66cadc05a removed the envmap command which drew to front buffer. adjusted the
timerefresh command not to draw to the front buffer. also made sure
that there is an active connection when timerefresh is called.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@660 af15c1b1-3010-417e-b628-4374ebc0bcbd
2012-04-22 07:55:56 +00:00
Ozkan Sezer 17a4f90bb2 gl_texmgr.c, gl_vidsdl.c: made a lot of functions and variables static.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@584 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-30 14:00:28 +00:00
Ozkan Sezer 1928f2e1b8 * first shot at cvar flag system and cvar layer clean-ups :
- removed the archive and server members of cvar_t structure
  which are now represented by the CVAR_ARCHIVE, CVAR_NOTIFY
  and CVAR_SERVERINFO flags.
- added new Cvar_SetROM and Cvar_SetValueROM functions to 
  set vars marked as CVAR_ROM (read-only vars) programaticaly
- added Cvar_SetCallback() as a new function to assign (or
  remove) a callback function to a cvar.
- changed Cvar_RegisterVariable() to only accept a var pointer
  as in original quake
- moved notification handling from Cvar_Set() to callbacks.
- changed Cvar_Set() so that it doesn't reallocate the var's
  string buffer if nothing is changed, nor does it run the
  var's callback.
- changed the 'registered' and 'cmdline' cvars to be read-only
  so that the users can't change it using the console.  (and
  with 'registered' flagged as CVAR_ROM, the 'static_registered'
  thing is no longer required)
- added comment that sending cmdline upon CCREQ_RULE_INFO is
  evil...
- more to follow later.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@566 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-28 22:01:33 +00:00
Ozkan Sezer 2b919188d6 renamed Sys_FloatTime to Sys_DoubleTime (the thing always returned double
you know..) and adjusted all callers accordingly.  changed Sys_Sleep() to
take a milliseconds argument, added implementations for unix (usleep) and
windows (Sleep).

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@512 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-12-12 16:01:01 +00:00
Steven 9b721b0a01 z-fighting (flickering gl texture clash most notable in e1m1) bug fix, from Sander.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@480 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-08-24 07:47:29 +00:00
Ozkan Sezer 3281636a96 fixed rest of the strict-aliasing and uninitialized use warnings.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@367 af15c1b1-3010-417e-b628-4374ebc0bcbd
2011-01-01 14:05:20 +00:00
Ozkan Sezer 10b8caa816 gl_rmain.c, gl_rmisc.c, cl_tent.c, quakedef.h: removed leftovers from GLTEST.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@177 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-06-01 10:55:40 +00:00
Ozkan Sezer 317e2d4bd5 make the code to compile with -fno-common flag:
glquake.h (dev_stats): Add extern.
(dev_peakstats): Likewise.
(dev_overflows): Likewise.
(lightmap_textures): Likewise.
(gl_warpimagesize): Likewise.
(r_drawflat_cheatsafe): Likewise.
(r_fullbright_cheatsafe): Likewise.
(r_lightmap_cheatsafe): Likewise.
(r_drawworld_cheatsafe): Likewise.
gl_texmgr.h (notexture): Likewise.
(nulltexture): Likewise.
(d_8to24table): Likewise.
(d_8to24table_fbright): Likewise.
(d_8to24table_nobright): Likewise.
(d_8to24table_conchars): Likewise.
(d_8to24table_shirt): Likewise.
(d_8to24table_pants): Likewise.
gl_screen.c (sb_lines): Remove and make it live only in sbar.c.
(vid): Remove and make it live only in gl_vid*.c
gl_vidsdl.c (m_state): Remove and make it live only in menu.c.
gl_vidnt.c (m_state): Likewise.
net_dgrm.c (m_state): Remove extern declaration.
menu.c (m_state): Tagged the m_state enum as m_state_e and moved it to menu.h.
Declared m_state as enum m_state_e.
menu.h (enum m_state_e): Moved from menu.c to here.
(m_state): Added extern declaration.
gl_rmain.c (r_drawflat_cheatsafe): Made the global to live here.
(r_fullbright_cheatsafe): Likewise.
(r_lightmap_cheatsafe): Likewise.
(r_drawworld_cheatsafe): Likewise.
gl_warp.c (gl_warpimagesize): Likewise.
host.c (dev_stats): Likewise.
(dev_peakstats): Likewise.
(dev_overflows): Likewise.
gl_texmgr.c (notexture): Likewise.
(nulltexture): Likewise.
(d_8to24table): Likewise.
(d_8to24table_fbright): Likewise.
(d_8to24table_nobright): Likewise.
(d_8to24table_conchars): Likewise.
(d_8to24table_shirt): Likewise.
(d_8to24table_pants[): Likewise.
r_brush.c (lightmap_textures): Likewise.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@117 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-22 19:02:29 +00:00
Ozkan Sezer 68fc38c3a6 chase.c, cl_input.c, cl_parse.c, client.h, common.c, common.h, console.h,
cvar.h, draw.h, gl_draw.c, gl_fog.c, gl_mesh.c, gl_model.c, gl_model.h,
gl_rmain.c, gl_rmisc.c, gl_screen.c, gl_sky.c, gl_texmgr.c, glquake.h,
host.c, keys.c, keys.h, main.c, menu.c, menu.h, pr_cmds.c, quakedef.h,
r_alias.c, r_brush.c, r_part.c, r_sprite.c, r_world.c, sbar.c, sbar.h,
screen.h, snd_dma.c, snd_mem.c, snd_mix.c, sv_main.c, sys_sdl.c, vid.h,
view.h, world.c, world.h:  Loads of warning fixes about missing function
prototypes, missing parens around &, missing braces leading to ambiguous
else statements and unused and uninitialized variables. There are still a
couple of unitialised variables here and there, but not much. The warnings
about strict aliasing violations need taking care of.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@21 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:01:07 +00:00
Ozkan Sezer 8309029808 several cvar tweaks by Steven:
gl_draw.c (scr_conalpha): change value from 1.0 to 0.5
gl_rmain.c (r_shadows): write to config.cfg.
gl_rmain.c (r_wateralpha): write to config.cfg.
gl_rmain.c (r_dynamic): write to config.cfg.
gl_rmain.c (r_novis): write to config.cfg.
gl_rmain.c (gl_flashblend): change to 0 (disable) and write to config.cfg.
gl_screen.c (scr_conspeed): change value from 300 to 500
gl_vidsdl.c (vid_fullscreen): change value to 0 (disable)
gl_vidsdl.c (vid_width): change value from 640 to 800
gl_vidsdl.c (vid_height): change value from 480 to 600


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@11 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 08:50:45 +00:00
Ozkan Sezer db613ab35d initial import of SDL port of Fitzquake-0.85 / 20090510 sources.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@2 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-15 23:26:55 +00:00