Commit Graph

34 Commits

Author SHA1 Message Date
temx dd8439b767 Factor out scale support, add bmodels and sprites 2022-09-05 23:56:30 +03:00
Ozkan Sezer 947c782f64 Un-revert the model scale patch.
See https://github.com/sezero/quakespasm/pull/32 for the followup discussions,
and https://github.com/sezero/quakespasm/pull/36 for the followup patches.
2022-09-05 23:56:20 +03:00
Andrei Drexler 7e4c88aed9 Try light trace from entity origin first
Fixes issues described at https://github.com/Novum/vkQuake/issues/550.
2022-08-28 20:28:02 +03:00
Ozkan Sezer e4e914c8a6 reverted the model scale patch :
see https://github.com/sezero/quakespasm/pull/32 for the issues
associated with it.
2022-08-11 01:32:00 +03:00
JosiahJack 6ebf6f097a Add support for model scale 2022-08-08 08:55:00 +03:00
Ozkan Sezer 02b953e993 use C11 _Generic macros for q_min, q_max and CLAMP, if available.
.. if not, then use GCC expression macros for them, if available.
2022-06-12 14:32:28 +03:00
Ozkan Sezer 57a32b567f r_alias.c: (R_DrawAliasModel): avoid a possible undefined behavior.
See https://github.com/Novum/vkQuake/issues/476 for original discussion.
2022-06-01 14:15:00 +03:00
Andrei Drexler e632b79725 Start the light trace for alias models from slightly above their origin
This fixes the black candles in the DOTM start map (see vkQuake issue:
https://github.com/Novum/vkQuake/issues/367 )
2021-09-20 11:55:10 +03:00
Andrei Drexler 401aa52d45 Compensate viewmodel distortion at fov > 90
See: https://github.com/Novum/vkQuake/issues/281

Controlled by new cvar cl_gun_fovscale (defaults to 1).
Based on code from Qrack:
3bc2862b1a/gl_rmain.c (L2384-L2392)
2021-09-02 20:50:50 +03:00
Eric Wasylishen ec4b6115d1 world shader: avoid matrix multiplication in the fragment shader
alias shader: sync fog implementation with world shader

Thanks to Axel for the suggestion.

Add a FIXME where our shader differs from vkQuake in treatment of
alpha transparent faces + fog.

see:
https://sourceforge.net/p/quakespasm/bugs/24/
https://github.com/Novum/vkQuake/blob/master/Shaders/world.vert
https://github.com/Novum/vkQuake/blob/master/Shaders/world.frag

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1546 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-12-24 18:59:44 +00:00
Eric Wasylishen caceebb7a3 r_alias.c: display skin 0 instead of checkerboard for invalid skin num
metlslime says:

> I was the one that at added the blue checkerboard feature.
> I didn't realize at the time how many mods relied on the behavior of
> vanilla quake to show skin 0 when the mod asks for an invalid skin. So
> I now agree, the engine should replicate vanilla quake's permissive
> behavior and maybe just put up a non-spamy console warning when the
> bad skin is first set.

TODO: The warning is currently spammy (but only if developer 1).
Would be a bit of a pain to make non-spammy.

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1532 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-11-12 22:16:34 +00:00
Ozkan Sezer daf5ebec2f "W007: '&array' may not produce intended result" Watcom warning fixes.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1504 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-09-17 08:00:32 +00:00
Eric Wasylishen 6b2affaebc r_alias: add MF_HOLEY (0x4000) model flag, from QSS.
(MarkV compatible).
For more info see: http://celephais.net/board/view_thread.php?id=61351&start=1&end=1

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1463 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-08-04 19:45:11 +00:00
Ozkan Sezer be437dd258 r_alias.c: change *AttrIndex into macros instead of static const vars.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1443 af15c1b1-3010-417e-b628-4374ebc0bcbd
2017-07-28 20:01:19 +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
Eric Wasylishen 76909f07c2 r_alias.c, r_sprite.c: print the model name in the "no such skin" (r_alias.c) and "no such frame" (r_sprite.c) developer messages
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1246 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-31 18:36:38 +00:00
Ozkan Sezer ec833cde0f r_alias.c: remove duplicated shadevector (was introduced in r1151)
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1243 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-23 09:53:05 +00:00
Eric Wasylishen 2fdd3946bc r_alias.c: Add model name to "no such frame" warning
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1239 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-08-02 18:21:57 +00:00
Eric Wasylishen 1f29972017 r_alias.c: GLSL: fix for fullbright pixels on alias models not respecting alpha.
e.g. fixes light_flame_small_yellow entity (progs/flame2.mdl) with alpha 0.5 showing up as solid (most of the pixels on flame2.mdl are fullbright)

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1207 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-16 20:55:56 +00:00
Eric Wasylishen 3806a5d2d5 r_alias.c: for out of range skin numbers, bring back the checkerboard texture wihch was removed in the last commit
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1205 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-05 04:51:05 +00:00
Eric Wasylishen 825e5c8f4f r_alias.c: fix crash on out-of-range skin numbers. This bounds check was in WinQuake, but not FitzQuake.
Fixes crash in malice TC reported by NightFright: http://www.celephais.net/board/view_thread.php?id=60831&start=829

git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@1204 af15c1b1-3010-417e-b628-4374ebc0bcbd
2015-05-01 09:24:06 +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 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
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
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
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 a7d57b4b51 * renamed Length() to VectorLength() for consistency with its friends.
* mathlib.c: Removed the unnecessary sqrt() prototype.
(VectorLength): Made it to just return sqrt(DotProduct(arg,arg))
(VectorNormalize): Calculate the length as sqrt(DotProduct(arg,arg)).
* mathlib.h (CLAMP): Renamed the macro arguments from min and max to
_minval and _maxval.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@248 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-08-01 19:22:46 +00:00
Ozkan Sezer 4bc2b26e79 r_alias.c (GL_DrawAliasFrame): Initialize vert2 to vert1 when not lerping,
which avoids a bogus compiler warning.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@152 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 14:02:37 +00:00
Ozkan Sezer adf384e8b9 r_alias.c (GL_DrawAliasFrame): Initialize blend and iblend to 0 when not
lerping, which avoids a bogus compiler warning.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@150 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-04-26 13:44:24 +00:00
Ozkan Sezer f9928b24ac 64 bit compatibility effort, 2/nn: type correctness work in common.h,
gl_draw.c, gl_model.c, gl_sky.c, gl_texmgr.c, gl_texmgr.h, r_alias.c,
r_brush.c, r_part.c, r_world.c, snd_mem.c.  next step will be server
side (progs) work which is actually the heart of the problems.


git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@34 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 21:26:11 +00:00
Ozkan Sezer d857aff0f3 gl_sky.c, r_alias.c, r_part.c, r_world.c: added newline at the end of the files.
git-svn-id: svn://svn.code.sf.net/p/quakespasm/code/trunk/quakespasm@24 af15c1b1-3010-417e-b628-4374ebc0bcbd
2010-02-16 12:24:38 +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 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